diff options
Diffstat (limited to 'plugins')
526 files changed, 16911 insertions, 5950 deletions
diff --git a/plugins/arm/v7/Makefile.am b/plugins/arm/v7/Makefile.am index e2fc96c..bac6841 100644 --- a/plugins/arm/v7/Makefile.am +++ b/plugins/arm/v7/Makefile.am @@ -7,7 +7,7 @@ libarmv7_la_SOURCES = \ core.h core.c \ cregister.h cregister.c \ fetch.h fetch.c \ - helpers.h helpers.c \ + helpers.h \ instruction.h instruction.c \ link.h link.c \ post.h post.c \ diff --git a/plugins/arm/v7/helpers.c b/plugins/arm/v7/helpers.c deleted file mode 100644 index 637cd9c..0000000 --- a/plugins/arm/v7/helpers.c +++ /dev/null @@ -1,277 +0,0 @@ - -/* Chrysalide - Outil d'analyse de fichiers binaires - * helpers.c - aide à la mise en place des opérandes ARMv7 - * - * Copyright (C) 2014-2017 Cyrille Bagard - * - * This file is part of Chrysalide. - * - * Chrysalide is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * Chrysalide is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Foobar. If not, see <http://www.gnu.org/licenses/>. - */ - - -#include "helpers.h" - - -#include <arch/register.h> -#include <arch/immediate.h> -#include <common/asm.h> -#include <common/bconst.h> - - -#include "register.h" - - - -/****************************************************************************** -* * -* Paramètres : x = valeur sur 32 bits maximum à traiter. * -* shift = nombre de décalages visés. * -* * -* Description : Effectue une rotation vers la droit d'une valeur. * -* * -* Retour : Adresse de la structure mise en place. * -* * -* Remarques : Correspond à la pseudo fonction 'ROR_C'. * -* * -******************************************************************************/ - -GArchOperand *ror_armv7_imm(uint32_t x, unsigned int shift) -{ - GArchOperand *result; /* Opérande à faire remonter */ - uint32_t val32; /* Valeur sur 32 bits */ - - shift %= 32; - - val32 = (x >> shift) | (x << (32 - shift)); - - result = g_imm_operand_new_from_value(MDS_32_BITS_UNSIGNED, val32); - - return result; - -} - - - - - - - - - - - - -#if 0 - -// Shift_C() -// ========= -(bits(N), bit) Shift_C(bits(N) value, SRType type, integer amount, bit carry_in) -assert !(type == SRType_RRX && amount != 1); -if amount == 0 then -(result, carry_out) = (value, carry_in); -else -case type of - -when SRType_LSL -(result, carry_out) = LSL_C(value, amount); - -when SRType_LSR -(result, carry_out) - -when SRType_ASR -(result, carry_out) - -when SRType_ROR -(result, carry_out) - -when SRType_RRX -(result, carry_out) -= LSR_C(value, amount); -= ASR_C(value, amount); -= ROR_C(value, amount); -= RRX_C(value, carry_in); - -#endif - - - - - - -/****************************************************************************** -* * -* Paramètres : value = valeur sur 32 bits maximum à traiter. * -* topbit = valeur du bit de poids fort manipulé. * -* size = taille de la valeur finale à constituer. * -* * -* Description : Crée un opérande de valeur immédiate avec extension de signe.* -* * -* Retour : Adresse de la structure mise en place. * -* * -* Remarques : - * -* * -******************************************************************************/ - -GArchOperand *sign_extend_armv7_imm(uint32_t value, bool topbit, unsigned int size) -{ - GArchOperand *result; /* Opérande à faire remonter */ - unsigned int msb; /* Position du premier bit à 1 */ - MemoryDataSize mds; /* Conversion de la taille */ - uint32_t val4; /* Valeur sur 4 bits */ - uint32_t val8; /* Valeur sur 8 bits */ - uint32_t val16; /* Valeur sur 16 bits */ - uint32_t val32; /* Valeur sur 32 bits */ - unsigned int i; /* Boucle de parcours */ - - result = NULL; - - topbit &= msb_32(value, &msb); - - switch (size) - { - -#define SIGN_EXTEND_CASE(sz) \ - case sz: \ - mds = MDS_ ## sz ## _BITS_SIGNED; \ - val ## sz = value; \ - if (topbit) \ - for (i = msb; i < sz; i++) \ - val ## sz |= (1 << i); \ - result = g_imm_operand_new_from_value(mds, val ## sz); \ - break; - - SIGN_EXTEND_CASE(4); - SIGN_EXTEND_CASE(8); - SIGN_EXTEND_CASE(16); - SIGN_EXTEND_CASE(32); - - } - - return result; - -} - - -/****************************************************************************** -* * -* Paramètres : value = valeur sur 32 bits maximum à traiter. * -* * -* Description : Etend une valeur immédiate en mode 'Thumb' ARMv7. * -* * -* Retour : Adresse de la structure mise en place. * -* * -* Remarques : - * -* * -******************************************************************************/ - -GArchOperand *thumb_expand_armv7_imm(uint32_t value) -{ - GArchOperand *result; /* Opérande à faire remonter */ - uint8_t byte; /* Octet à reproduire */ - uint32_t val32; /* Valeur sur 32 bits */ - uint32_t unrotated; /* Transformation à décaller */ - - result = NULL; - - if (((value >> 10) & b11) == b00) - { - byte = value & 0xff; - - switch ((value >> 8) & b11) - { - case b00: - result = zero_extend_armv7_imm(byte, 32); - break; - - case b01: - if (byte == 0) return NULL; - val32 = byte << 16 | byte; - result = g_imm_operand_new_from_value(MDS_32_BITS_UNSIGNED, val32); - break; - - case b10: - if (byte == 0) return NULL; - val32 = byte << 24 | byte << 8; - result = g_imm_operand_new_from_value(MDS_32_BITS_UNSIGNED, val32); - break; - - case b11: - if (byte == 0) return NULL; - val32 = byte << 24 | byte << 16 | byte << 8 | byte; - result = g_imm_operand_new_from_value(MDS_32_BITS_UNSIGNED, val32); - break; - - } - - } - else - { - unrotated = 1 << 7 | (value & 0x3f); - result = ror_armv7_imm(unrotated, (value >> 7) & 0x1f); - } - - return result; - -} - - - - - - -/****************************************************************************** -* * -* Paramètres : value = valeur sur 32 bits maximum à traiter. * -* size = taille de la valeur finale à constituer. * -* * -* Description : Réalise un simple transtypage de valeur entière. * -* * -* Retour : Adresse de la structure mise en place. * -* * -* Remarques : Correspond à la pseudo fonction 'ZeroExtend'. * -* * -******************************************************************************/ - -GArchOperand *zero_extend_armv7_imm(uint32_t value, unsigned int size) -{ - GArchOperand *result; /* Opérande à faire remonter */ - MemoryDataSize mds; /* Conversion de la taille */ - uint32_t val4; /* Valeur sur 4 bits */ - uint32_t val8; /* Valeur sur 8 bits */ - uint32_t val16; /* Valeur sur 16 bits */ - uint32_t val32; /* Valeur sur 32 bits */ - - result = NULL; - - switch (size) - { - -#define ZERO_EXTEND_CASE(sz) \ - case sz: \ - mds = MDS_ ## sz ## _BITS_UNSIGNED; \ - val ## sz = value; \ - result = g_imm_operand_new_from_value(mds, val ## sz); \ - break; - - ZERO_EXTEND_CASE(4); - ZERO_EXTEND_CASE(8); - ZERO_EXTEND_CASE(16); - ZERO_EXTEND_CASE(32); - - } - - return result; - -} diff --git a/plugins/arm/v7/helpers.h b/plugins/arm/v7/helpers.h index 94b85f9..aa3de34 100644 --- a/plugins/arm/v7/helpers.h +++ b/plugins/arm/v7/helpers.h @@ -25,245 +25,265 @@ #define _PLUGINS_ARM_V7_HELPERS_H -#include <arch/operand.h> +#include <arch/immediate.h> +#include <arch/register.h> -#include "cregister.h" #include "pseudo.h" +#include "register.h" #include "operands/coproc.h" #include "operands/estate.h" -#include "operands/limitation.h" #include "operands/maccess.h" -#include "operands/offset.h" #include "operands/reglist.h" #include "operands/rotation.h" #include "operands/shift.h" -#include "../register.h" +/** + * Définitions élaborées à partir des spécifications. + */ -#define BarrierLimitation(opt) \ - ({ \ - GArchOperand *__result; \ - __result = g_armv7_limitation_operand_new(opt); \ - __result; \ +#define ARMExpandImm(imm12) \ + ({ \ + GArchOperand *__result; \ + uint32_t __val; \ + if (armv7_arm_expand_imm(imm12, &__val)) \ + __result = g_imm_operand_new_from_value(MDS_32_BITS_UNSIGNED, __val); \ + else \ + __result = NULL; \ + __result; \ }) -#define BitDiff(msb, lsb) \ - ({ \ - GArchOperand *__result; \ - uint32_t __width; \ - __width = g_imm_operand_get_raw_value(G_IMM_OPERAND(msb)); \ - __width -= g_imm_operand_get_raw_value(G_IMM_OPERAND(lsb)); \ - __width += 1; \ - __result = g_imm_operand_new_from_value(MDS_32_BITS_UNSIGNED, __width); \ - __result; \ +#define ARMExpandImm_C(imm12, c) \ + ({ \ + GArchOperand *__result; \ + uint32_t __val; \ + if (armv7_arm_expand_imm_c(imm12, (bool []) { c }, &__val)) \ + __result = g_imm_operand_new_from_value(MDS_32_BITS_UNSIGNED, __val); \ + else \ + __result = NULL; \ + __result; \ }) -#define BuildImm8(val) \ - ({ \ - GArchOperand *__result; \ - __result = g_imm_operand_new_from_value(MDS_8_BITS_UNSIGNED, (uint8_t)val); \ - __result; \ +#define BitDiff(msb, lsb) \ + ({ \ + GArchOperand *__result; \ + uint32_t __width; \ + __width = msb - lsb + 1; \ + __result = g_imm_operand_new_from_value(MDS_32_BITS_UNSIGNED, __width); \ + __result; \ }) -#define BuildImm16(val) \ - ({ \ - GArchOperand *__result; \ - __result = g_imm_operand_new_from_value(MDS_16_BITS_UNSIGNED, (uint16_t)val); \ - __result; \ +#define BuildRegShift(type, reg) \ + ({ \ + GArchOperand *__result; \ + SRType __shift_t; \ + if (!armv7_decode_reg_shift(type, &__shift_t)) \ + __result = NULL; \ + else \ + __result = g_armv7_shift_operand_new(__shift_t, reg); \ + __result; \ }) -#define CoProcessor(idx) \ - ({ \ - GArchOperand *__result; \ - __result = g_armv7_coproc_operand_new(idx); \ - __result; \ +#define CoProcessor(idx) \ + ({ \ + GArchOperand *__result; \ + __result = g_armv7_coproc_operand_new(idx); \ + __result; \ }) -#define CRegister(idx) \ - ({ \ - GArchOperand *__result; \ - GArmV7CRegister *__reg; \ - __reg = g_armv7_cregister_new(idx); \ - if (__reg == NULL) \ - __result = NULL; \ - else \ - __result = g_register_operand_new(G_ARCH_REGISTER(__reg)); \ - __result; \ +#define DecodeImmShift(type, imm5) \ + ({ \ + GArchOperand *__result; \ + SRType __shift_t; \ + uint8_t __shift_n; \ + GArchOperand *__op_n; \ + if (!armv7_decode_imm_shift(type, imm5, &__shift_t, &__shift_n)) \ + __result = NULL; \ + else \ + { \ + __op_n = g_imm_operand_new_from_value(MDS_8_BITS_UNSIGNED, __shift_n); \ + __result = g_armv7_shift_operand_new(__shift_t, __op_n); \ + } \ + __result; \ }) -#define IncWidth(widthm1) \ - ({ \ - GArchOperand *__result; \ - uint32_t __width; \ - __width = widthm1 + 1; \ - __result = g_imm_operand_new_from_value(MDS_32_BITS_UNSIGNED, __width); \ - __result; \ +#define DecodeImmShiftAmount(type, imm5) \ + ({ \ + GArchOperand *__result; \ + uint8_t __shift_n; \ + if (!armv7_decode_imm_shift(type, imm5, (SRType []) { 0 }, &__shift_n)) \ + __result = NULL; \ + else \ + __result = g_imm_operand_new_from_value(MDS_8_BITS_UNSIGNED, __shift_n);\ + __result; \ }) -#define DecodeImmShift(type, imm5) \ - ({ \ - GArchOperand *__result; \ - SRType __shift_t; \ - uint32_t __shift_n; \ - GArchOperand *__op_n; \ - if (!armv7_decode_imm_shift(type, imm5, &__shift_t, &__shift_n)) \ - __result = NULL; \ - else \ - { \ - __op_n = g_imm_operand_new_from_value(MDS_32_BITS_UNSIGNED, __shift_n); \ - __result = g_armv7_shift_operand_new(__shift_t, __op_n); \ - } \ - __result; \ +#define Endian(big) \ + ({ \ + GArchOperand *__result; \ + __result = g_armv7_endian_operand_new(big); \ + __result; \ }) -#define EndianState(big) \ - ({ \ - GArchOperand *__result; \ - __result = g_armv7_endian_operand_new(big); \ - __result; \ +#define FixedShift(type, imm5) \ + ({ \ + GArchOperand *__result; \ + uint8_t __shift_n; \ + __shift_n = imm5; \ + __result = g_imm_operand_new_from_value(MDS_8_BITS_UNSIGNED, __shift_n); \ + __result; \ }) -#define MakeMemoryAccess(base, off, shift, index, add, wback) \ - ({ \ - GArchOperand *__result; \ - GArchOperand *__offset; \ - if (off != NULL) \ - __offset = g_armv7_offset_operand_new(add, off); \ - else \ - __offset = NULL; \ - __result = g_armv7_maccess_operand_new(base, __offset, shift, index, wback); \ - __result; \ +#define MemAccessOffset(base, off) \ + ({ \ + GArchOperand *__result; \ + __result = g_armv7_maccess_operand_new(base, off, NULL, false, false); \ + __result; \ }) -#define NextRegister(prev) \ - ({ \ - GRegisterOperand *__prev_op; \ - GArchRegister *__reg; \ - uint8_t __id; \ - __prev_op = G_REGISTER_OPERAND(prev); \ - __reg = g_register_operand_get_register(__prev_op); \ - __id = g_arm_register_get_index(G_ARM_REGISTER(__reg)); \ - Register(__id + 1); \ +#define MemAccessOffsetExtended(base, off, shift) \ + ({ \ + GArchOperand *__result; \ + __result = g_armv7_maccess_operand_new(base, off, shift, false, false); \ + __result; \ }) -#define RawValue(val) \ - ({ \ - GArchOperand *__result; \ - __result = g_imm_operand_new_from_value(MDS_32_BITS_UNSIGNED, (uint32_t)val); \ - __result; \ +#define MemAccessPreIndexed(base, off) \ + ({ \ + GArchOperand *__result; \ + __result = g_armv7_maccess_operand_new(base, off, NULL, false, true); \ + __result; \ }) -#define Register(idx) \ - ({ \ - GArchOperand *__result; \ - GArmV7Register *__reg; \ - __reg = g_armv7_register_new(idx); \ - if (__reg == NULL) \ - __result = NULL; \ - else \ - __result = g_register_operand_new(G_ARCH_REGISTER(__reg)); \ - __result; \ +#define MemAccessPreIndexedExtended(base, off, shift) \ + ({ \ + GArchOperand *__result; \ + __result = g_armv7_maccess_operand_new(base, off, shift, false, true); \ + __result; \ }) -#define RegisterShift(shift_t, rs) \ - ({ \ - GArchOperand *__result; \ - GArchOperand *__reg; \ - __reg = Register(rs); \ - if (__reg == NULL) \ - __result = NULL; \ - else \ - __result = g_armv7_shift_operand_new(shift_t, __reg); \ - __result; \ +#define MemAccessPostIndexed(base, off) \ + ({ \ + GArchOperand *__result; \ + __result = g_armv7_maccess_operand_new(base, off, NULL, true, true); \ + __result; \ }) -#define Rotation(val5) \ +#define MemAccessPostIndexedExtended(base, off, shift) \ ({ \ GArchOperand *__result; \ - uint8_t __rot; \ - GArchOperand *__rot_op; \ - __rot = val5; \ - __rot_op = g_imm_operand_new_from_value(MDS_8_BITS_UNSIGNED, __rot); \ - __result = g_armv7_rotation_operand_new(__rot_op); \ - if (__result == NULL) \ - g_object_unref(G_OBJECT(__rot_op)); \ + __result = g_armv7_maccess_operand_new(base, off, shift, true, true); \ __result; \ }) -#define UInt(val) \ - ({ \ - GArchOperand *__result; \ - __result = g_imm_operand_new_from_value(MDS_8_BITS_UNSIGNED, (uint8_t)val); \ - __result; \ +#define MinusBitDiff(msb, lsb) \ + ({ \ + GArchOperand *__result; \ + uint32_t __width; \ + __width = msb - lsb + 1 + 1; \ + __result = g_imm_operand_new_from_value(MDS_32_BITS_UNSIGNED, __width); \ + __result; \ }) +#define NextRegister(idx) \ + ({ \ + GArchOperand *__result; \ + GArmV7Register *__reg; \ + __reg = g_armv7_register_new(idx + 1); \ + if (__reg == NULL) \ + __result = NULL; \ + else \ + __result = g_register_operand_new(G_ARCH_REGISTER(__reg)); \ + __result; \ + }) -//#define DecodeImmShift(raw_type, raw_imm5); -//g_armv7_shift_operand_new(SRType type, GArchOperand *value) - - - -//#define MakeMemoryAccess(base, off, shift, index, add, wback) NULL - -//g_armv7_maccess_operand_new(GArchOperand *base, GArchOperand *offset, GArchOperand *shift, bool indexed, bool writeb) +#define SignExtend(val, size, top) \ + ({ \ + GArchOperand *__result; \ + MemoryDataSize __mds; \ + uint ## size ## _t __val; \ + __mds = MDS_ ## size ## _BITS_SIGNED; \ + __val = armv7_sign_extend(val, top, size); \ + __result = g_imm_operand_new_from_value(__mds, __val); \ + __result; \ + }) -//g_armv7_offset_operand_new(add, off) +#define SingleRegList(t) \ + ({ \ + GArchOperand *__result; \ + __result = g_armv7_reglist_operand_new(1 << t); \ + __result; \ + }) +#define Register(idx) \ + ({ \ + GArchOperand *__result; \ + GArmV7Register *__reg; \ + __reg = g_armv7_register_new(idx); \ + if (__reg == NULL) \ + __result = NULL; \ + else \ + __result = g_register_operand_new(G_ARCH_REGISTER(__reg)); \ + __result; \ + }) -//////////////////// -#define Imm16(imm16) \ - ({ \ - GArchOperand *__result; \ - __result = g_imm_operand_new_from_value(MDS_16_BITS_UNSIGNED, (uint16_t)imm16); \ - __result; \ +#define RegList(mask) \ + ({ \ + GArchOperand *__result; \ + __result = g_armv7_reglist_operand_new(mask); \ + __result; \ }) -#define ARMExpandImm_C(imm12, c) \ + +#define Rotation(val5) \ ({ \ GArchOperand *__result; \ - uint32_t __val; \ - if (armv7_arm_expand_imm_c(imm12, (bool []) { c }, &__val)) \ - __result = g_imm_operand_new_from_value(MDS_32_BITS_UNSIGNED, __val); \ - else \ - __result = NULL; \ + uint8_t __rot; \ + GArchOperand *__rot_op; \ + __rot = val5; \ + __rot_op = g_imm_operand_new_from_value(MDS_8_BITS_UNSIGNED, __rot); \ + __result = g_armv7_rotation_operand_new(__rot_op); \ + if (__result == NULL) \ + g_object_unref(G_OBJECT(__rot_op)); \ __result; \ }) -#define ARMExpandImm(imm12) \ + +#define ThumbExpandImm(imm12) \ ({ \ GArchOperand *__result; \ uint32_t __val; \ - if (armv7_arm_expand_imm(imm12, &__val)) \ + if (armv7_thumb_expand_imm(imm12, &__val)) \ __result = g_imm_operand_new_from_value(MDS_32_BITS_UNSIGNED, __val); \ else \ __result = NULL; \ __result; \ }) + #define ThumbExpandImm_C(imm12, c) \ ({ \ GArchOperand *__result; \ @@ -275,166 +295,98 @@ __result; \ }) -#define ThumbExpandImm(imm12) \ + +#define UInt(val) \ ({ \ GArchOperand *__result; \ - uint32_t __val; \ - if (armv7_thumb_expand_imm(imm12, &__val)) \ - __result = g_imm_operand_new_from_value(MDS_32_BITS_UNSIGNED, __val); \ - else \ - __result = NULL; \ + __result = g_imm_operand_new_from_value(MDS_32_BITS_UNSIGNED, val); \ __result; \ }) - - - - - -#define DecodeImmShiftValue(imm5) \ - ({ \ - GArchOperand *__result; \ - uint32_t __shift_n; \ - if (!armv7_decode_imm_shift(0, imm5, (SRType []) { 0 }, &__shift_n)) \ - __result = NULL; \ - else \ - __result = g_imm_operand_new_from_value(MDS_32_BITS_UNSIGNED, __shift_n); \ - __result; \ +#define UIntInc(sat4) \ + ({ \ + GArchOperand *__result; \ + uint8_t __val; \ + __val = sat4; \ + __result = g_imm_operand_new_from_value(MDS_8_BITS_UNSIGNED, __val); \ + __result; \ }) -#if 0 -// DecodeRegShift() -// ================ -SRType DecodeRegShift(bits(2) type) -case type of -when '00' shift_t = SRType_LSL; -when '01' shift_t = SRType_LSR; -when '10' shift_t = SRType_ASR; -when '11' shift_t = SRType_ROR; -return shift_t; -#endif - - - -#define ZeroExtend(x, i) \ - ({ \ - MemoryDataSize __mds; \ - uint ## i ## _t __val; \ - __mds = MDS_ ## i ## _BITS_UNSIGNED; \ - __val = armv7_zero_extend(x, 0/**/, i); \ - g_imm_operand_new_from_value(__mds, __val); \ +#define Zeros(i) \ + ({ \ + GArchOperand *__result; \ + MemoryDataSize __mds; \ + uint ## i ## _t __val; \ + __mds = MDS_ ## i ## _BITS_UNSIGNED; \ + __val = 0; \ + __result = g_imm_operand_new_from_value(__mds, __val); \ + __result; \ }) - -#define Zeros(i) \ - ({ \ - MemoryDataSize __mds; \ - uint ## i ## _t __val; \ - __mds = MDS_ ## i ## _BITS_UNSIGNED; \ - __val = 0; \ - g_imm_operand_new_from_value(__mds, __val); \ +#define ZeroExtend(x, i) \ + ({ \ + GArchOperand *__result; \ + MemoryDataSize __mds; \ + uint ## i ## _t __val; \ + __mds = MDS_ ## i ## _BITS_UNSIGNED; \ + __val = armv7_zero_extend(x, -1, i); \ + __result = g_imm_operand_new_from_value(__mds, __val); \ + __result; \ }) - - - - - - /** - * Glue purement interne. + * Définitions complémentaires. */ -#define MakeAccessOffset(add, off) \ - g_armv7_offset_operand_new(add, off) - - -#define MakeShiftedMemoryAccess(base, off, shift, wr) \ - g_armv7_maccess_operand_new(base, off, shift, wr) +#define APSR_C 0 -#define _MakeMemoryAccess(base, off, wr) \ - MakeShiftedMemoryAccess(base, off, NULL, wr) - -/* -#define MakeMemoryAccess(base, off, add, wr) \ - ({ \ - GArchOperand *__off; \ - __off = MakeAccessOffset(add, off); \ - _MakeMemoryAccess(base, __off, wr); \ - }) -*/ - -#define MakeMemoryNotIndexed(base, wr) \ - _MakeMemoryAccess(base, NULL, wr) - - - - - - - - -// type == '10', pas 2 ! (FIXME) -#define FixedShift(type, imm5) \ - ({ \ - GArchOperand *__result; \ - uint32_t __shift_n; \ - __shift_n = imm5; \ - __result = g_imm_operand_new_from_value(MDS_32_BITS_UNSIGNED, __shift_n); \ - __result; \ - }) +/** + * Petite glue vers le format ARM générique... + */ +#define g_armv7_instruction_extend_keyword(ins, ext) \ + g_arm_instruction_extend_keyword(G_ARM_INSTRUCTION(ins), ext) /** - * Glue purement interne pour les listes de registres. + * Vieilleries à conserver au cas où... */ -#define RegistersList(mask) \ - ({ \ - GArchOperand *__result; \ - __result = g_armv7_reglist_operand_new(); \ - if (!g_armv7_reglist_load_registers(G_ARMV7_REGLIST_OPERAND(__result), mask)) \ - { \ - g_object_unref(G_OBJECT(__result)); \ - __result = NULL; \ - } \ - __result; \ - }) - - -#define ListFromRegister(regop) \ - ({ \ - GArchOperand *__result; \ - GArmV7Register *__reg; \ - __result = g_armv7_reglist_operand_new(); \ - __reg = G_ARMV7_REGISTER(regop); \ - g_armv7_reglist_add_register(G_ARMV7_REGLIST_OPERAND(__result), __reg); \ - __result; \ - }) +#if 0 +#include "cregister.h" +#include "operands/limitation.h" -/* Effectue une rotation vers la droit d'une valeur. */ -GArchOperand *ror_armv7_imm(uint32_t, unsigned int); +#define BarrierLimitation(opt) \ + ({ \ + GArchOperand *__result; \ + __result = g_armv7_limitation_operand_new(opt); \ + __result; \ + }) -/* Crée un opérande de valeur immédiate avec extension de signe. */ -GArchOperand *sign_extend_armv7_imm(uint32_t, bool, unsigned int); -/* Etend une valeur immédiate en mode 'Thumb' ARMv7. */ -GArchOperand *thumb_expand_armv7_imm(uint32_t); +#define CRegister(idx) \ + ({ \ + GArchOperand *__result; \ + GArmV7CRegister *__reg; \ + __reg = g_armv7_cregister_new(idx); \ + if (__reg == NULL) \ + __result = NULL; \ + else \ + __result = g_register_operand_new(G_ARCH_REGISTER(__reg)); \ + __result; \ -/* Réalise un simple transtypage de valeur entière. */ -GArchOperand *zero_extend_armv7_imm(uint32_t, unsigned int); +#endif diff --git a/plugins/arm/v7/opcodes/Makefile.am b/plugins/arm/v7/opcodes/Makefile.am index a169c2b..ddaabb7 100644 --- a/plugins/arm/v7/opcodes/Makefile.am +++ b/plugins/arm/v7/opcodes/Makefile.am @@ -23,4 +23,7 @@ AM_CPPFLAGS = $(LIBGTK_CFLAGS) $(LIBXML_CFLAGS) AM_CFLAGS = $(DEBUG_CFLAGS) $(WARNING_FLAGS) $(COMPLIANCE_FLAGS) -I$(top_srcdir)/src +CLEANFILES = $(GENERATED_FILES) + + EXTRA_DIST = opcodes_tmp_arm.h opcodes_tmp_simd.h opcodes_tmp_thumb_16.h opcodes_tmp_thumb_32.h diff --git a/plugins/arm/v7/opdefs/Makefile.am b/plugins/arm/v7/opdefs/Makefile.am index 3f69a3f..0538359 100644 --- a/plugins/arm/v7/opdefs/Makefile.am +++ b/plugins/arm/v7/opdefs/Makefile.am @@ -1,60 +1,48 @@ -include ../../../../tools/d2c/d2c.mk +include $(top_srcdir)/tools/d2c/d2c.mk -D2C_BIN = ../../../../tools/d2c/d2c -GEN_BIN = ../../../../tools/d2c/d2c_genmakefile.sh +D2C_BIN = $(top_srcdir)/tools/d2c/d2c +GEN_BIN = $(top_srcdir)/tools/d2c/d2c_genmakefile.sh -D2C_TYPE = raw -D2C_OUTDIR = $(PWD)/.. +D2C_OUTDIR = $(PWD)/../opcodes/ + +D2C_TYPE = raw -D2C_ARCH = armv7 -D2C_HEADER = _ARCH_ARM_V7 +D2C_ARCH = ARMv7 +D2C_ARCH_CN = ARMv7 +D2C_GUARD = PLUGINS_ARM_V7_OPCODES D2C_ENCODINGS = \ - -e A=arm_ \ - -e t=thumb_16_ \ - -e T=thumb_32_ + -e A=arm \ + -e t=thumb_16 \ + -e T=thumb_32 + +D2C_ID_PREFIX = AOP7 +D2C_ID_COUNT = 500 -D2C_MACROS = \ - -M SetFlags=g_armv7_instruction_define_setflags \ - -M Condition=g_arm_instruction_set_cond \ - -M "ExpandImmC32=g_imm_operand_new_from_value(MDS_32_BITS_UNSIGNED, " \ - -M SignExtend=sign_extend_armv7_imm \ - -M SetInsFlag=g_arch_instruction_set_flag \ - -M StoreCondition=g_arm_instruction_set_cond \ - -M ExtendKeyword=g_arm_instruction_extend_keyword +D2C_SPECIFIC = -D2C_OPERANDS = \ - -n BarrierLimitation \ - -n BitDiff \ - -n IncWidth \ - -n DecodeImmShift \ - -n MakeMemoryAccess \ - -n Register \ - -n RegisterShift \ - -n UInt \ - -n ZeroExtend -FIXED_C_INCLUDES = \ - \n\#include <arch/link.h> \ - \n\#include <common/bconst.h> \ - \n \ - \n\#include \"../helpers.h\" \ - \n\#include \"../instruction.h\" \ - \n\#include \"../fetch.h\" \ - \n\#include \"../link.h\" \ - \n\#include \"../post.h\" \ - \n\#include \"../../instruction.h\" \ - \n\#include \"../../link.h\" \ - \n\n +FIXED_C_INCLUDES = \ + \#include <assert.h> \ + \n \ + \n\#include <arch/link.h> \ + \n\#include <common/bconst.h> \ + \n \ + \n\#include "../helpers.h" \ + \n\#include "../instruction.h" \ + \n\#include "../fetch.h" \ + \n\#include "../link.h" \ + \n\#include "../post.h" \ + \n\#include "../../instruction.h" \ + \n\#include "../../link.h" -FIXED_H_INCLUDES = \ - \n\#include <stdint.h> \ - \n \ - \n\#include <arch/instruction.h> \ - \n\n +FIXED_H_INCLUDES = \ + \#include <stdint.h> \ + \n \ + \n\#include <arch/instruction.h> # for i in $(seq 1 426); do test -f *A88$i.d && (ls *A88$i.d | sed 's/^/\t/' | sed 's/$/\t\t\t\t\t\t\\/') ; done @@ -278,7 +266,6 @@ ARMV7_DEFS = \ wfi_A88425.d \ yield_A88426.d -# subs_B9320.d # make dist procède répertoire par répertoire. Or le répertoire opcodes utilise # le contenu du répertoire opdefs. Il faut donc générer les fichiers nécessaires @@ -295,7 +282,7 @@ dist-hook: all: $(ARMV7_DEFS:.d=.g) fmk.done d2c_final_rules fmk.done: $(ARMV7_DEFS) - $(GEN_BIN) ../opcodes/ ../opdefs/.gen ../../../../tools/d2c/globalgen.mk arm thumb_32 thumb_16 + $(GEN_BIN) $(D2C_OUTDIR) arm thumb_32 thumb_16 touch $@ clean: diff --git a/plugins/arm/v7/opdefs/adc_A881.d b/plugins/arm/v7/opdefs/adc_A881.d index 6bc66e2..5033749 100644 --- a/plugins/arm/v7/opdefs/adc_A881.d +++ b/plugins/arm/v7/opdefs/adc_A881.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,26 +23,55 @@ @title ADC (immediate) -@desc Add with Carry (immediate) adds an immediate value and the Carry flag value to a register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. +@id 0 + +@desc { + + Add with Carry (immediate) adds an immediate value and the Carry flag value to a register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. + +} @encoding (T1) { @word 1 1 1 1 0 i(1) 0 1 0 1 0 S(1) Rn(4) 0 imm3(3) Rd(4) imm8(8) - @syntax <reg_D> <reg_N> <imm32> + @syntax { + + @assert { + + S == 0 + + } + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + imm32 = ThumbExpandImm(i:imm3:imm8) - reg_D = Register(Rd) - reg_N = Register(Rn) - setflags = (S == '1') - imm32 = ThumbExpandImm(i:imm3:imm8) + } + + @asm adc ?reg_D reg_N imm32 } - @rules { + @syntax { + + @assert { + + S == 1 + + } - if (setflags); chk_call ExtendKeyword("s") + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + imm32 = ThumbExpandImm(i:imm3:imm8) + + } + + @asm adcs ?reg_D reg_N imm32 } @@ -52,21 +81,55 @@ @word cond(4) 0 0 1 0 1 0 1 S(1) Rn(4) Rd(4) imm12(12) - @syntax <reg_D> <reg_N> <imm32> + @syntax { + + @assert { - @conv { + S == 0 - reg_D = Register(Rd) - reg_N = Register(Rn) - setflags = (S == '1') - imm32 = ARMExpandImm(imm12) + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + imm32 = ARMExpandImm(imm12) + + } + + @asm adc ?reg_D reg_N imm32 + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + imm32 = ARMExpandImm(imm12) + + } + + @asm adcs ?reg_D reg_N imm32 + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/adc_A882.d b/plugins/arm/v7/opdefs/adc_A882.d index 27ce6ad..77b53df 100644 --- a/plugins/arm/v7/opdefs/adc_A882.d +++ b/plugins/arm/v7/opdefs/adc_A882.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,18 +23,29 @@ @title ADC (register) -@desc Add with Carry (register) adds a register value, the Carry flag value, and an optionally-shifted register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. +@id 1 + +@desc { + + Add with Carry (register) adds a register value, the Carry flag value, and an optionally-shifted register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. + +} @encoding (t1) { @half 0 1 0 0 0 0 0 1 0 1 Rm(3) Rdn(3) - @syntax "adcs" <reg_DN> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rdn) + reg_N = Register(Rdn) + reg_M = Register(Rm) - reg_DN = Register(Rdn) - reg_M = Register(Rm) + } + + @asm adc ?reg_D reg_N reg_M } @@ -44,22 +55,45 @@ @word 1 1 1 0 1 0 1 1 0 1 0 S(1) Rn(4) 0 imm3(3) Rd(4) imm2(2) type(2) Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <?shift> + @syntax { + + @assert { + + S == 0 + + } - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') - shift = DecodeImmShift(type, imm3:imm2) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm3:imm2) + + } + + @asm adc.w ?reg_D reg_N reg_M ?shift } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm3:imm2) + + } - if (setflags); chk_call ExtendKeyword("s") - chk_call ExtendKeyword(".w") + @asm adcs.w ?reg_D reg_N reg_M ?shift } @@ -69,22 +103,57 @@ @word cond(4) 0 0 0 0 1 0 1 S(1) Rn(4) Rd(4) imm5(5) type(2) 0 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <?shift> + @syntax { - @conv { + @assert { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') - shift = DecodeImmShift(type, imm5) + S == 0 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) + + } + + @asm adc ?reg_D reg_N reg_M ?shift + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) + + } + + @asm adcs ?reg_D reg_N reg_M ?shift + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/adc_A883.d b/plugins/arm/v7/opdefs/adc_A883.d index a9c56d8..6371445 100644 --- a/plugins/arm/v7/opdefs/adc_A883.d +++ b/plugins/arm/v7/opdefs/adc_A883.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,28 +23,73 @@ @title ADC (register-shifted register) -@desc Add with Carry (register-shifted register) adds a register value, the Carry flag value, and a register-shifted register value. It writes the result to the destination register, and can optionally update the condition flags based on the result. +@id 2 + +@desc { + + Add with Carry (register-shifted register) adds a register value, the Carry flag value, and a register-shifted register value. It writes the result to the destination register, and can optionally update the condition flags based on the result. + +} @encoding (A1) { @word cond(4) 0 0 0 0 1 0 1 S(1) Rn(4) Rd(4) Rs(4) 0 type(2) 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <reg_shift> + @syntax { + + @assert { + + S == 0 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift_t = UInt(type) + reg_S = Register(Rs) + shift = BuildRegShift(shift_t, reg_S) + + } + + @asm adc ?reg_D reg_N reg_M shift - @conv { + @rules { - reg_shift = RegisterShift(type, Rs) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift_t = UInt(type) + reg_S = Register(Rs) + shift = BuildRegShift(shift_t, reg_S) + + } + + @asm adcs ?reg_D reg_N reg_M shift + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/add_A8810.d b/plugins/arm/v7/opdefs/add_A8810.d index 2047276..c7f30b4 100644 --- a/plugins/arm/v7/opdefs/add_A8810.d +++ b/plugins/arm/v7/opdefs/add_A8810.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title ADD (SP plus register, Thumb) -@desc This instruction adds an optionally-shifted register value to the SP value, and writes the result to the destination register. +@id 9 + +@desc { + + This instruction adds an optionally-shifted register value to the SP value, and writes the result to the destination register. + +} @encoding (t1) { @half 0 1 0 0 0 1 0 0 DM(1) 1 1 0 1 Rdm(3) - @syntax <reg_DM_1> <SP> <reg_DM_2> + @syntax { + + @conv { - @conv { + reg_D = Register(DM:Rdm) + reg_SP = Register(13) + reg_M = Register(DM:Rdm) - reg_DM_1 = Register(DM:Rdm) - reg_DM_2 = Register(DM:Rdm) - SP = Register(13) + } + + @asm add ?reg_D reg_SP reg_M } @@ -45,12 +55,17 @@ @half 0 1 0 0 0 1 0 0 1 Rm(4) 1 0 1 - @syntax <SP> <reg_M> + @syntax { + + @conv { + + reg_D = Register(13) + reg_SP = Register(13) + reg_M = Register(Rm) - @conv { + } - reg_M = Register(Rm) - SP = Register(13) + @asm add ?reg_D reg_SP reg_M } @@ -60,22 +75,45 @@ @word 1 1 1 0 1 0 1 1 0 0 0 S(1) 1 1 0 1 0 imm3(3) Rd(4) imm2(2) type(2) Rm(4) - @syntax <reg_D> <SP> <reg_M> <?shift> + @syntax { + + @assert { + + S == 0 - @conv { + } - reg_D = Register(Rd) - reg_M = Register(Rm) - setflags = (S == '1') - shift = DecodeImmShift(type, imm3:imm2) - SP = Register(13) + @conv { + + reg_D = Register(Rd) + reg_SP = Register(13) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm3:imm2) + + } + + @asm add.w ?reg_D reg_SP reg_M ?shift } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_SP = Register(13) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm3:imm2) + + } - if (setflags); chk_call ExtendKeyword("s") - chk_call ExtendKeyword(".w") + @asm adds.w ?reg_D reg_SP reg_M ?shift } diff --git a/plugins/arm/v7/opdefs/add_A8811.d b/plugins/arm/v7/opdefs/add_A8811.d index 5b6c0d1..e70c33c 100644 --- a/plugins/arm/v7/opdefs/add_A8811.d +++ b/plugins/arm/v7/opdefs/add_A8811.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,28 +23,69 @@ @title ADD (SP plus register, ARM) -@desc This instruction adds an optionally-shifted register value to the SP value, and writes the result to the destination register. +@id 10 + +@desc { + + This instruction adds an optionally-shifted register value to the SP value, and writes the result to the destination register. + +} @encoding (A1) { @word cond(4) 0 0 0 0 1 0 0 S(1) 1 1 0 1 Rd(4) imm5(5) type(2) 0 Rm(4) - @syntax <reg_D> <SP> <reg_M> <?shift> + @syntax { + + @assert { + + S == 0 + + } + + @conv { + + reg_D = Register(Rd) + reg_SP = Register(13) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) + + } + + @asm add ?reg_D reg_SP reg_M ?shift - @conv { + @rules { - reg_D = Register(Rd) - reg_M = Register(Rm) - setflags = (S == '1') - shift = DecodeImmShift(type, imm5) - SP = Register(13) + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_SP = Register(13) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) + + } + + @asm adds ?reg_D reg_SP reg_M ?shift + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/add_A884.d b/plugins/arm/v7/opdefs/add_A884.d index 8b624a7..f61d447 100644 --- a/plugins/arm/v7/opdefs/add_A884.d +++ b/plugins/arm/v7/opdefs/add_A884.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title ADD (immediate, Thumb) -@desc This instruction adds an immediate value to a register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. +@id 3 + +@desc { + + This instruction adds an immediate value to a register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. + +} @encoding (t1) { @half 0 0 0 1 1 1 0 imm3(3) Rn(3) Rd(3) - @syntax "adds" <reg_D> <reg_N> <imm32> + @syntax { + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm3, 32) - @conv { + } - reg_D = Register(Rd) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm3, 32) + @asm add ?reg_D reg_N imm32 } @@ -45,12 +55,17 @@ @half 0 0 1 1 0 Rdn(3) imm8(8) - @syntax "adds" <reg_DN> <imm32> + @syntax { - @conv { + @conv { - reg_DN = Register(Rdn) - imm32 = ZeroExtend(imm8, 32) + reg_D = Register(Rdn) + reg_N = Register(Rdn) + imm32 = ZeroExtend(imm8, 32) + + } + + @asm add ?reg_D reg_N imm32 } @@ -60,21 +75,43 @@ @word 1 1 1 1 0 i(1) 0 1 0 0 0 S(1) Rn(4) 0 imm3(3) Rd(4) imm8(8) - @syntax <reg_D> <reg_N> <imm32> + @syntax { + + @assert { + + S == 0 + + } - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - setflags = (S == '1') - imm32 = ThumbExpandImm(i:imm3:imm8) + reg_D = Register(Rd) + reg_N = Register(Rn) + imm32 = ThumbExpandImm(i:imm3:imm8) + + } + + @asm add.w ?reg_D reg_N imm32 } - @rules { + @syntax { + + @assert { + + S == 1 + + } - if (setflags); chk_call ExtendKeyword("s") - chk_call ExtendKeyword(".w") + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + imm32 = ThumbExpandImm(i:imm3:imm8) + + } + + @asm adds.w ?reg_D reg_N imm32 } @@ -84,13 +121,17 @@ @word 1 1 1 1 0 i(1) 1 0 0 0 0 0 Rn(4) 0 imm3(3) Rd(4) imm8(8) - @syntax "addw" <reg_D> <reg_N> <imm32> + @syntax { + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + imm32 = ZeroExtend(i:imm3:imm8, 32) - @conv { + } - reg_D = Register(Rd) - reg_N = Register(Rn) - imm32 = ZeroExtend(i:imm3:imm8, 32) + @asm addw ?reg_D reg_N imm32 } diff --git a/plugins/arm/v7/opdefs/add_A885.d b/plugins/arm/v7/opdefs/add_A885.d index 0f4a919..5bb4e6f 100644 --- a/plugins/arm/v7/opdefs/add_A885.d +++ b/plugins/arm/v7/opdefs/add_A885.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,27 +23,67 @@ @title ADD (immediate, ARM) -@desc This instruction adds an immediate value to a register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. +@id 4 + +@desc { + + This instruction adds an immediate value to a register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. + +} @encoding (A1) { @word cond(4) 0 0 1 0 1 0 0 S(1) Rn(4) Rd(4) imm12(12) - @syntax <reg_D> <reg_N> <imm32> + @syntax { + + @assert { + + S == 0 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + imm32 = ARMExpandImm(imm12) + + } + + @asm add ?reg_D reg_N imm32 - @conv { + @rules { - reg_D = Register(Rd) - reg_N = Register(Rn) - setflags = (S == '1') - imm32 = ARMExpandImm(imm12) + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + imm32 = ARMExpandImm(imm12) + + } + + @asm adds ?reg_D reg_N imm32 + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/add_A886.d b/plugins/arm/v7/opdefs/add_A886.d index e4f9e00..c84259f 100644 --- a/plugins/arm/v7/opdefs/add_A886.d +++ b/plugins/arm/v7/opdefs/add_A886.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title ADD (register, Thumb) -@desc This instruction adds a register value and an optionally-shifted register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. +@id 5 + +@desc { + + This instruction adds a register value and an optionally-shifted register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. + +} @encoding (t1) { @half 0 0 0 1 1 0 0 Rm(3) Rn(3) Rd(3) - @syntax "adds" <reg_D> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm add ?reg_D reg_N reg_M } @@ -45,12 +55,17 @@ @half 0 1 0 0 0 1 0 0 DN(1) Rm(4) Rdn(3) - @syntax <reg_DN> <reg_M> + @syntax { + + @conv { + + reg_D = Register(DN:Rdn) + reg_N = Register(DN:Rdn) + reg_M = Register(Rm) - @conv { + } - reg_DN = Register(DN:Rdn) - reg_M = Register(Rm) + @asm add ?reg_D reg_N reg_M } @@ -60,22 +75,45 @@ @word 1 1 1 0 1 0 1 1 0 0 0 S(1) Rn(4) 0 imm3(3) Rd(4) imm2(2) type(2) Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <?shift> + @syntax { + + @assert { + + S == 0 - @conv { + } - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') - shift = DecodeImmShift(type, imm3:imm2) + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm3:imm2) + + } + + @asm add.w ?reg_D reg_N reg_M ?shift } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm3:imm2) + + } - if (setflags); chk_call ExtendKeyword("s") - chk_call ExtendKeyword(".w") + @asm adds.w ?reg_D reg_N reg_M ?shift } diff --git a/plugins/arm/v7/opdefs/add_A887.d b/plugins/arm/v7/opdefs/add_A887.d index 18400a6..400e179 100644 --- a/plugins/arm/v7/opdefs/add_A887.d +++ b/plugins/arm/v7/opdefs/add_A887.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,28 +23,69 @@ @title ADD (register, ARM) -@desc This instruction adds a register value and an optionally-shifted register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. +@id 6 + +@desc { + + This instruction adds a register value and an optionally-shifted register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. + +} @encoding (A1) { @word cond(4) 0 0 0 0 1 0 0 S(1) Rn(4) Rd(4) imm5(5) type(2) 0 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <?shift> + @syntax { + + @assert { + + S == 0 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) + + } + + @asm add ?reg_D reg_N reg_M ?shift - @conv { + @rules { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') - shift = DecodeImmShift(type, imm5) + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) + + } + + @asm adds ?reg_D reg_N reg_M ?shift + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/add_A888.d b/plugins/arm/v7/opdefs/add_A888.d index 5549145..0e4757b 100644 --- a/plugins/arm/v7/opdefs/add_A888.d +++ b/plugins/arm/v7/opdefs/add_A888.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,28 +23,73 @@ @title ADD (register-shifted register) -@desc Add (register-shifted register) adds a register value and a register-shifted register value. It writes the result to the destination register, and can optionally update the condition flags based on the result. +@id 7 + +@desc { + + Add (register-shifted register) adds a register value and a register-shifted register value. It writes the result to the destination register, and can optionally update the condition flags based on the result. + +} @encoding (A1) { @word cond(4) 0 0 0 0 1 0 0 S(1) Rn(4) Rd(4) Rs(4) 0 type(2) 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <reg_shift> + @syntax { + + @assert { + + S == 0 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift_t = UInt(type) + reg_S = Register(Rs) + shift = BuildRegShift(shift_t, reg_S) + + } + + @asm add ?reg_D reg_N reg_M shift - @conv { + @rules { - reg_shift = RegisterShift(type, Rs) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift_t = UInt(type) + reg_S = Register(Rs) + shift = BuildRegShift(shift_t, reg_S) + + } + + @asm adds ?reg_D reg_N reg_M shift + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/add_A889.d b/plugins/arm/v7/opdefs/add_A889.d index 5fab17c..6c6c572 100644 --- a/plugins/arm/v7/opdefs/add_A889.d +++ b/plugins/arm/v7/opdefs/add_A889.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title ADD (SP plus immediate) -@desc This instruction adds an immediate value to the SP value, and writes the result to the destination register. +@id 8 + +@desc { + + This instruction adds an immediate value to the SP value, and writes the result to the destination register. + +} @encoding (t1) { @half 1 0 1 0 1 Rd(3) imm8(8) - @syntax <reg_D> <SP> <imm32> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_SP = Register(13) + imm32 = ZeroExtend(imm8:'00', 32) - reg_D = Register(Rd) - imm32 = ZeroExtend(imm8:'00', 32) - SP = Register(13) + } + + @asm add ?reg_D reg_SP imm32 } @@ -45,13 +55,17 @@ @half 1 0 1 1 0 0 0 0 0 imm7(7) - @syntax <SP_0> <SP_1> <imm32> + @syntax { + + @conv { + + reg_D = Register(13) + reg_SP = Register(13) + imm32 = ZeroExtend(imm7:'00', 32) - @conv { + } - imm32 = ZeroExtend(imm7:'00', 32) - SP_0 = Register(13) - SP_1 = Register(13) + @asm add ?reg_D reg_SP imm32 } @@ -61,21 +75,43 @@ @word 1 1 1 1 0 i(1) 0 1 0 0 0 S(1) 1 1 0 1 0 imm3(3) Rd(4) imm8(8) - @syntax <reg_D> <SP> <imm32> + @syntax { + + @assert { + + S == 0 - @conv { + } - reg_D = Register(Rd) - setflags = (S == '1') - imm32 = ThumbExpandImm(i:imm3:imm8) - SP = Register(13) + @conv { + + reg_D = Register(Rd) + reg_SP = Register(13) + imm32 = ThumbExpandImm(i:imm3:imm8) + + } + + @asm add.w ?reg_D reg_SP imm32 } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_SP = Register(13) + imm32 = ThumbExpandImm(i:imm3:imm8) + + } - if (setflags); chk_call ExtendKeyword("s") - chk_call ExtendKeyword(".w") + @asm adds.w ?reg_D reg_SP imm32 } @@ -85,13 +121,17 @@ @word 1 1 1 1 0 i(1) 1 0 0 0 0 0 1 1 0 1 0 imm3(3) Rd(4) imm8(8) - @syntax "addw" <reg_D> <SP> <imm32> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - imm32 = ZeroExtend(i:imm3:imm8, 32) - SP = Register(13) + reg_D = Register(Rd) + reg_SP = Register(13) + imm32 = ZeroExtend(i:imm3:imm8, 32) + + } + + @asm addw ?reg_D reg_SP imm32 } @@ -101,21 +141,55 @@ @word cond(4) 0 0 1 0 1 0 0 S(1) 1 1 0 1 Rd(4) imm12(12) - @syntax <reg_D> <SP> <imm32> + @syntax { + + @assert { + + S == 0 + + } + + @conv { + + reg_D = Register(Rd) + reg_SP = Register(13) + imm32 = ARMExpandImm(imm12) + + } + + @asm add ?reg_D reg_SP imm32 + + @rules { - @conv { + check g_arm_instruction_set_cond(cond) - reg_D = Register(Rd) - setflags = (S == '1') - imm32 = ARMExpandImm(imm12) - SP = Register(13) + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_SP = Register(13) + imm32 = ARMExpandImm(imm12) + + } + + @asm adds ?reg_D reg_SP imm32 + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/adr_A8812.d b/plugins/arm/v7/opdefs/adr_A8812.d index 16615cb..ee5ed75 100644 --- a/plugins/arm/v7/opdefs/adr_A8812.d +++ b/plugins/arm/v7/opdefs/adr_A8812.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,18 +23,28 @@ @title ADR -@desc This instruction adds an immediate value to the PC value to form a PC-relative address, and writes the result to the destination register. +@id 11 + +@desc { + + This instruction adds an immediate value to the PC value to form a PC-relative address, and writes the result to the destination register. + +} @encoding (t1) { @half 1 0 1 0 0 Rd(3) imm8(8) - @syntax <reg_D> <imm32> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - imm32 = ZeroExtend(imm8:'00', 32) + reg_D = Register(Rd) + imm32 = ZeroExtend(imm8:'00', 32) + + } + + @asm adr reg_D imm32 } @@ -44,12 +54,16 @@ @word 1 1 1 1 0 i(1) 1 0 1 0 1 0 1 1 1 1 0 imm3(3) Rd(4) imm8(8) - @syntax ".W" <reg_D> <imm32> + @syntax { + + @conv { + + reg_D = Register(Rd) + imm32 = ZeroExtend(i:imm3:imm8, 32) - @conv { + } - reg_D = Register(Rd) - imm32 = ZeroExtend(i:imm3:imm8, 32) + @asm adr.w reg_D imm32 } @@ -59,12 +73,16 @@ @word 1 1 1 1 0 i(1) 1 0 0 0 0 0 1 1 1 1 0 imm3(3) Rd(4) imm8(8) - @syntax ".W" <reg_D> <imm32> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - imm32 = ZeroExtend(i:imm3:imm8, 32) + reg_D = Register(Rd) + imm32 = ZeroExtend(i:imm3:imm8, 32) + + } + + @asm adr.w reg_D imm32 } @@ -74,18 +92,22 @@ @word cond(4) 0 0 1 0 1 0 0 0 1 1 1 1 Rd(4) imm12(12) - @syntax <reg_D> <imm32> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - imm32 = ARMExpandImm(imm12) + reg_D = Register(Rd) + imm32 = ARMExpandImm(imm12) - } + } + + @asm adr reg_D imm32 - @rules { + @rules { - chk_call StoreCondition(cond) + check g_arm_instruction_set_cond(cond) + + } } @@ -95,18 +117,22 @@ @word cond(4) 0 0 1 0 0 1 0 0 1 1 1 1 Rd(4) imm12(12) - @syntax <reg_D> <imm32> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - imm32 = ARMExpandImm(imm12) + reg_D = Register(Rd) + imm32 = ARMExpandImm(imm12) - } + } + + @asm adr reg_D imm32 + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/and_A8813.d b/plugins/arm/v7/opdefs/and_A8813.d index 3e1d0ed..0e303f2 100644 --- a/plugins/arm/v7/opdefs/and_A8813.d +++ b/plugins/arm/v7/opdefs/and_A8813.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,26 +23,55 @@ @title AND (immediate) -@desc This instruction performs a bitwise AND of a register value and an immediate value, and writes the result to the destination register. +@id 12 + +@desc { + + This instruction performs a bitwise AND of a register value and an immediate value, and writes the result to the destination register. + +} @encoding (T1) { @word 1 1 1 1 0 i(1) 0 0 0 0 0 S(1) Rn(4) 0 imm3(3) Rd(4) imm8(8) - @syntax <reg_D> <reg_N> <imm32> + @syntax { + + @assert { + + S == 0 + + } + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + const = ThumbExpandImm_C(i:imm3:imm8, APSR_C) - reg_D = Register(Rd) - reg_N = Register(Rn) - setflags = (S == '1') - imm32 = ThumbExpandImm_C(i:imm3:imm8, 0) + } + + @asm and ?reg_D reg_N const } - @rules { + @syntax { + + @assert { + + S == 1 + + } - if (setflags); chk_call ExtendKeyword("s") + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + const = ThumbExpandImm_C(i:imm3:imm8, APSR_C) + + } + + @asm ands ?reg_D reg_N const } @@ -52,21 +81,55 @@ @word cond(4) 0 0 1 0 0 0 0 S(1) Rn(4) Rd(4) imm12(12) - @syntax <reg_D> <reg_N> <imm32> + @syntax { + + @assert { - @conv { + S == 0 - reg_D = Register(Rd) - reg_N = Register(Rn) - setflags = (S == '1') - imm32 = ARMExpandImm_C(imm12, 0) + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + const = ARMExpandImm_C(imm12, APSR_C) + + } + + @asm and ?reg_D reg_N const + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + const = ARMExpandImm_C(imm12, APSR_C) + + } + + @asm ands ?reg_D reg_N const + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/and_A8814.d b/plugins/arm/v7/opdefs/and_A8814.d index 77f7e55..94ea843 100644 --- a/plugins/arm/v7/opdefs/and_A8814.d +++ b/plugins/arm/v7/opdefs/and_A8814.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,18 +23,29 @@ @title AND (register) -@desc This instruction performs a bitwise AND of a register value and an optionally-shifted register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. +@id 13 + +@desc { + + This instruction performs a bitwise AND of a register value and an optionally-shifted register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. + +} @encoding (t1) { @half 0 1 0 0 0 0 0 0 0 0 Rm(3) Rdn(3) - @syntax "ands" <reg_DN> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rdn) + reg_N = Register(Rdn) + reg_M = Register(Rm) - reg_DN = Register(Rdn) - reg_M = Register(Rm) + } + + @asm and ?reg_D reg_N reg_M } @@ -44,22 +55,45 @@ @word 1 1 1 0 1 0 1 0 0 0 0 S(1) Rn(4) 0 imm3(3) Rd(4) imm2(2) type(2) Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <?shift> + @syntax { + + @assert { + + S == 0 + + } - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') - shift = DecodeImmShift(type, imm3:imm2) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm3:imm2) + + } + + @asm and.w ?reg_D reg_N reg_M ?shift } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm3:imm2) + + } - if (setflags); chk_call ExtendKeyword("s") - chk_call ExtendKeyword(".w") + @asm ands.w ?reg_D reg_N reg_M ?shift } @@ -69,22 +103,57 @@ @word cond(4) 0 0 0 0 0 0 0 S(1) Rn(4) Rd(4) imm5(5) type(2) 0 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <?shift> + @syntax { - @conv { + @assert { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') - shift = DecodeImmShift(type, imm5) + S == 0 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) + + } + + @asm and ?reg_D reg_N reg_M ?shift + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) + + } + + @asm ands ?reg_D reg_N reg_M ?shift + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/and_A8815.d b/plugins/arm/v7/opdefs/and_A8815.d index 5ace3fa..ca44183 100644 --- a/plugins/arm/v7/opdefs/and_A8815.d +++ b/plugins/arm/v7/opdefs/and_A8815.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,28 +23,73 @@ @title AND (register-shifted register) -@desc This instruction performs a bitwise AND of a register value and a register-shifted register value. It writes the result to the destination register, and can optionally update the condition flags based on the result. +@id 14 + +@desc { + + This instruction performs a bitwise AND of a register value and a register-shifted register value. It writes the result to the destination register, and can optionally update the condition flags based on the result. + +} @encoding (A1) { @word cond(4) 0 0 0 0 0 0 0 S(1) Rn(4) Rd(4) Rs(4) 0 type(2) 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <reg_shift> + @syntax { + + @assert { + + S == 0 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift_t = UInt(type) + reg_S = Register(Rs) + shift = BuildRegShift(shift_t, reg_S) + + } + + @asm and ?reg_D reg_N reg_M shift - @conv { + @rules { - reg_shift = RegisterShift(type, Rs) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift_t = UInt(type) + reg_S = Register(Rs) + shift = BuildRegShift(shift_t, reg_S) + + } + + @asm ands ?reg_D reg_N reg_M shift + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/asr_A8816.d b/plugins/arm/v7/opdefs/asr_A8816.d index 006a26c..87d4b3e 100644 --- a/plugins/arm/v7/opdefs/asr_A8816.d +++ b/plugins/arm/v7/opdefs/asr_A8816.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title ASR (immediate) -@desc Arithmetic Shift Right (immediate) shifts a register value right by an immediate number of bits, shifting in copies of its sign bit, and writes the result to the destination register. It can optionally update the condition flags based on the result. +@id 15 + +@desc { + + Arithmetic Shift Right (immediate) shifts a register value right by an immediate number of bits, shifting in copies of its sign bit, and writes the result to the destination register. It can optionally update the condition flags based on the result. + +} @encoding (t1) { @half 0 0 0 1 0 imm5(5) Rm(3) Rd(3) - @syntax "asrs" <reg_D> <reg_M> <shift_imm> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_M = Register(Rm) + shift_n = DecodeImmShiftAmount('10', imm5) - reg_D = Register(Rd) - reg_M = Register(Rm) - shift_imm = DecodeImmShift('10', imm5) + } + + @asm asr ?reg_D reg_M shift_n } @@ -45,21 +55,43 @@ @word 1 1 1 0 1 0 1 0 0 1 0 S(1) 1 1 1 1 0 imm3(3) Rd(4) imm2(2) 1 0 Rm(4) - @syntax <reg_D> <reg_M> <shift_imm> + @syntax { + + @assert { + + S == 0 + + } - @conv { + @conv { - reg_D = Register(Rd) - reg_M = Register(Rm) - setflags = (S == '1') - shift_imm = DecodeImmShift('10', imm3:imm2) + reg_D = Register(Rd) + reg_M = Register(Rm) + shift_n = DecodeImmShiftAmount('10', imm3:imm2) + + } + + @asm asr.w ?reg_D reg_M shift_n } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_M = Register(Rm) + shift_n = DecodeImmShiftAmount('10', imm3:imm2) + + } - if (setflags); chk_call ExtendKeyword("s") - chk_call ExtendKeyword(".w") + @asm asrs.w ?reg_D reg_M shift_n } @@ -69,21 +101,55 @@ @word cond(4) 0 0 0 1 1 0 1 S(1) 0 0 0 0 Rd(4) imm5(5) 1 0 0 Rm(4) - @syntax <reg_D> <reg_M> <shift_imm> + @syntax { - @conv { + @assert { - reg_D = Register(Rd) - reg_M = Register(Rm) - setflags = (S == '1') - shift_imm = DecodeImmShift('10', imm5) + S == 0 + + } + + @conv { + + reg_D = Register(Rd) + reg_M = Register(Rm) + shift_n = DecodeImmShiftAmount('10', imm5) + + } + + @asm asr ?reg_D reg_M shift_n + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_M = Register(Rm) + shift_n = DecodeImmShiftAmount('10', imm5) + + } + + @asm asrs ?reg_D reg_M shift_n + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/asr_A8817.d b/plugins/arm/v7/opdefs/asr_A8817.d index 1e1e9c1..6d5b5ef 100644 --- a/plugins/arm/v7/opdefs/asr_A8817.d +++ b/plugins/arm/v7/opdefs/asr_A8817.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,18 +23,29 @@ @title ASR (register) -@desc Arithmetic Shift Right (register) shifts a register value right by a variable number of bits, shifting in copies of its sign bit, and writes the result to the destination register. The variable number of bits is read from the bottom byte of a register. It can optionally update the condition flags based on the result. +@id 16 + +@desc { + + Arithmetic Shift Right (register) shifts a register value right by a variable number of bits, shifting in copies of its sign bit, and writes the result to the destination register. The variable number of bits is read from the bottom byte of a register. It can optionally update the condition flags based on the result. + +} @encoding (t1) { @half 0 1 0 0 0 0 0 1 0 0 Rm(3) Rdn(3) - @syntax "asrs" <reg_DN> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rdn) + reg_N = Register(Rdn) + reg_M = Register(Rm) - reg_DN = Register(Rdn) - reg_M = Register(Rm) + } + + @asm asr ?reg_D reg_N reg_M } @@ -44,21 +55,43 @@ @word 1 1 1 1 1 0 1 0 0 1 0 S(1) Rn(4) 1 1 1 1 Rd(4) 0 0 0 0 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @assert { + + S == 0 + + } - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + + } + + @asm asr.w ?reg_D reg_N reg_M } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + + } - if (setflags); chk_call ExtendKeyword("s") - chk_call ExtendKeyword(".w") + @asm asrs.w ?reg_D reg_N reg_M } @@ -68,21 +101,55 @@ @word cond(4) 0 0 0 1 1 0 1 S(1) 0 0 0 0 Rd(4) Rm(4) 0 1 0 1 Rn(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @assert { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') + S == 0 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + + } + + @asm asr ?reg_D reg_N reg_M + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + + } + + @asm asrs ?reg_D reg_N reg_M + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/b_A8818.d b/plugins/arm/v7/opdefs/b_A8818.d index 9e27753..abd542f 100644 --- a/plugins/arm/v7/opdefs/b_A8818.d +++ b/plugins/arm/v7/opdefs/b_A8818.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,23 +23,33 @@ @title B -@desc Branch causes a branch to a target address. +@id 17 + +@desc { + + Branch causes a branch to a target address. + +} @encoding (t1) { @half 1 1 0 1 cond(4) imm8(8) - @syntax <imm32> + @syntax { - @conv { + @conv { - imm32 = SignExtend(imm8:'0', imm8 & 0x80, 32) + imm32 = SignExtend(imm8:'0', 32, 8) - } + } - @rules { + @asm b imm32 - chk_call StoreCondition(cond) + @rules { + + check g_arm_instruction_set_cond(cond) + + } } @@ -57,11 +67,15 @@ @half 1 1 1 0 0 imm11(11) - @syntax <imm32> + @syntax { + + @conv { + + imm32 = SignExtend(imm11:'0', 32, 11) - @conv { + } - imm32 = SignExtend(imm11:'0', imm11 & 0x400, 32) + @asm b imm32 } @@ -79,17 +93,22 @@ @word 1 1 1 1 0 S(1) cond(4) imm6(6) 1 0 J1(1) 0 J2(1) imm11(11) - @syntax ".W" <imm32> + @syntax { - @conv { + @conv { - imm32 = SignExtend(S:J2:J1:imm6:imm11:'0', S & 0x1, 32) + imm32 = SignExtend(S:J2:J1:imm6:imm11:'0', 32, 20) - } + } + + @asm b imm32 - @rules { + @rules { - chk_call StoreCondition(cond) + check g_arm_instruction_set_cond(cond) + check g_armv7_instruction_extend_keyword(".W") + + } } @@ -107,13 +126,15 @@ @word 1 1 1 1 0 S(1) imm10(10) 1 0 J1(1) 1 J2(1) imm11(11) - @syntax ".W" <imm32> + @syntax { + + @conv { - @conv { + imm32 = SignExtend(S:J2:J1:imm10:imm11:'0', 32, 24) - I1 = NOT(J1 EOR S) - I2 = NOT(J2 EOR S) - imm32 = SignExtend(S:I1:I2:imm10:imm11:'0', S & 0x1, 32) + } + + @asm b.w imm32 } @@ -131,17 +152,21 @@ @word cond(4) 1 0 1 0 imm24(24) - @syntax <imm32> + @syntax { - @conv { + @conv { - imm32 = SignExtend(imm24:'00', imm24 & 0x800000, 32) + imm32 = SignExtend(imm24:'00', 32, 25) - } + } + + @asm b imm32 + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/bfc_A8819.d b/plugins/arm/v7/opdefs/bfc_A8819.d index 0ee99c8..bb0e448 100644 --- a/plugins/arm/v7/opdefs/bfc_A8819.d +++ b/plugins/arm/v7/opdefs/bfc_A8819.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title BFC -@desc Bit Field Clear clears any number of adjacent bits at any position in a register, without affecting the other bits in the register. +@id 18 + +@desc { + + Bit Field Clear clears any number of adjacent bits at any position in a register, without affecting the other bits in the register. + +} @encoding (T1) { @word 1 1 1 1 0 0 1 1 0 1 1 0 1 1 1 1 0 imm3(3) Rd(4) imm2(2) 0 msb(5) - @syntax <reg_D> <lsbit> <width> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + lsbit = UInt(imm3:imm2) + msbit = UInt(msb) + width = BitDiff(msbit, lsbit) - reg_D = Register(Rd) - msbit = UInt(msb) - lsbit = UInt(imm3:imm2) - width = BitDiff(msbit, lsbit) + } + + @asm bfc reg_D lsbit width } @@ -46,20 +56,24 @@ @word cond(4) 0 1 1 1 1 1 0 msb(5) Rd(4) lsb(5) 0 0 1 1 1 1 1 - @syntax <reg_D> <lsbit> <width> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - msbit = UInt(msb) - lsbit = UInt(lsb) - width = BitDiff(msbit, lsbit) + reg_D = Register(Rd) + lsbit = UInt(lsb) + msbit = UInt(msb) + width = BitDiff(msbit, lsbit) - } + } + + @asm bfc reg_D lsbit width + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/bfi_A8820.d b/plugins/arm/v7/opdefs/bfi_A8820.d index 1d2bb2f..ac33950 100644 --- a/plugins/arm/v7/opdefs/bfi_A8820.d +++ b/plugins/arm/v7/opdefs/bfi_A8820.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,21 +23,31 @@ @title BFI -@desc Bit Field Insert copies any number of low order bits from a register into the same number of adjacent bits at any position in the destination register. +@id 19 + +@desc { + + Bit Field Insert copies any number of low order bits from a register into the same number of adjacent bits at any position in the destination register. + +} @encoding (T1) { @word 1 1 1 1 0 0 1 1 0 1 1 0 Rn(4) 0 imm3(3) Rd(4) imm2(2) 0 msb(5) - @syntax <reg_D> <reg_N> <lsbit> <width> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + lsbit = UInt(imm3:imm2) + msbit = UInt(msb) + width = BitDiff(msbit, lsbit) - reg_D = Register(Rd) - reg_N = Register(Rn) - msbit = UInt(msb) - lsbit = UInt(imm3:imm2) - width = BitDiff(msbit, lsbit) + } + + @asm bfi reg_D reg_N lsbit width } @@ -47,21 +57,25 @@ @word cond(4) 0 1 1 1 1 1 0 msb(5) Rd(4) lsb(5) 0 0 1 Rn(4) - @syntax <reg_D> <reg_N> <lsbit> <width> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - msbit = UInt(msb) - lsbit = UInt(lsb) - width = BitDiff(msbit, lsbit) + reg_D = Register(Rd) + reg_N = Register(Rn) + lsbit = UInt(lsb) + msbit = UInt(msb) + width = BitDiff(msbit, lsbit) - } + } + + @asm bfi reg_D reg_N lsbit width + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/bic_A8821.d b/plugins/arm/v7/opdefs/bic_A8821.d index 9171b69..1fa6092 100644 --- a/plugins/arm/v7/opdefs/bic_A8821.d +++ b/plugins/arm/v7/opdefs/bic_A8821.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,26 +23,55 @@ @title BIC (immediate) -@desc Bitwise Bit Clear (immediate) performs a bitwise AND of a register value and the complement of an immediate value, and writes the result to the destination register. It can optionally update the condition flags based on the result. +@id 20 + +@desc { + + Bitwise Bit Clear (immediate) performs a bitwise AND of a register value and the complement of an immediate value, and writes the result to the destination register. It can optionally update the condition flags based on the result. + +} @encoding (T1) { @word 1 1 1 1 0 i(1) 0 0 0 0 1 S(1) Rn(4) 0 imm3(3) Rd(4) imm8(8) - @syntax <reg_D> <reg_N> <imm32> + @syntax { + + @assert { + + S == 0 + + } + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + const = ThumbExpandImm_C(i:imm3:imm8, APSR_C) - reg_D = Register(Rd) - reg_N = Register(Rn) - setflags = (S == '1') - imm32 = ThumbExpandImm_C(i:imm3:imm8, 0) + } + + @asm bic ?reg_D reg_N const } - @rules { + @syntax { + + @assert { + + S == 1 + + } - if (setflags); chk_call ExtendKeyword("s") + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + const = ThumbExpandImm_C(i:imm3:imm8, APSR_C) + + } + + @asm bics ?reg_D reg_N const } @@ -52,21 +81,55 @@ @word cond(4) 0 0 1 1 1 1 0 S(1) Rn(4) Rd(4) imm12(12) - @syntax <reg_D> <reg_N> <imm32> + @syntax { + + @assert { - @conv { + S == 0 - reg_D = Register(Rd) - reg_N = Register(Rn) - setflags = (S == '1') - imm32 = ARMExpandImm_C(imm12, 0) + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + const = ARMExpandImm_C(imm12, APSR_C) + + } + + @asm bic ?reg_D reg_N const + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + const = ARMExpandImm_C(imm12, APSR_C) + + } + + @asm bics ?reg_D reg_N const + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/bic_A8822.d b/plugins/arm/v7/opdefs/bic_A8822.d index 8503460..858adb8 100644 --- a/plugins/arm/v7/opdefs/bic_A8822.d +++ b/plugins/arm/v7/opdefs/bic_A8822.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,18 +23,29 @@ @title BIC (register) -@desc Bitwise Bit Clear (register) performs a bitwise AND of a register value and the complement of an optionally-shifted register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. +@id 21 + +@desc { + + Bitwise Bit Clear (register) performs a bitwise AND of a register value and the complement of an optionally-shifted register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. + +} @encoding (t1) { @half 0 1 0 0 0 0 1 1 1 0 Rm(3) Rdn(3) - @syntax "bics" <reg_DN> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rdn) + reg_N = Register(Rdn) + reg_M = Register(Rm) - reg_DN = Register(Rdn) - reg_M = Register(Rm) + } + + @asm bic ?reg_D reg_N reg_M } @@ -44,22 +55,45 @@ @word 1 1 1 0 1 0 1 0 0 0 1 S(1) Rn(4) 0 imm3(3) Rd(4) imm2(2) type(2) Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <?shift> + @syntax { + + @assert { + + S == 0 + + } - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') - shift = DecodeImmShift(type, imm3:imm2) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm3:imm2) + + } + + @asm bic.w ?reg_D reg_N reg_M ?shift } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm3:imm2) + + } - if (setflags); chk_call ExtendKeyword("s") - chk_call ExtendKeyword(".w") + @asm bics.w ?reg_D reg_N reg_M ?shift } @@ -69,22 +103,57 @@ @word cond(4) 0 0 0 1 1 1 0 S(1) Rn(4) Rd(4) imm5(5) type(2) 0 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <?shift> + @syntax { - @conv { + @assert { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') - shift = DecodeImmShift(type, imm5) + S == 0 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) + + } + + @asm bic ?reg_D reg_N reg_M ?shift + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) + + } + + @asm bics ?reg_D reg_N reg_M ?shift + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/bic_A8823.d b/plugins/arm/v7/opdefs/bic_A8823.d index e6903db..3058125 100644 --- a/plugins/arm/v7/opdefs/bic_A8823.d +++ b/plugins/arm/v7/opdefs/bic_A8823.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,28 +23,73 @@ @title BIC (register-shifted register) -@desc Bitwise Bit Clear (register-shifted register) performs a bitwise AND of a register value and the complement of a register-shifted register value. It writes the result to the destination register, and can optionally update the condition flags based on the result. +@id 22 + +@desc { + + Bitwise Bit Clear (register-shifted register) performs a bitwise AND of a register value and the complement of a register-shifted register value. It writes the result to the destination register, and can optionally update the condition flags based on the result. + +} @encoding (A1) { @word cond(4) 0 0 0 1 1 1 0 S(1) Rn(4) Rd(4) Rs(4) 0 type(2) 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <reg_shift> + @syntax { + + @assert { + + S == 0 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift_t = UInt(type) + reg_S = Register(Rs) + shift = BuildRegShift(shift_t, reg_S) + + } + + @asm bic ?reg_D reg_N reg_M shift - @conv { + @rules { - reg_shift = RegisterShift(type, Rs) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift_t = UInt(type) + reg_S = Register(Rs) + shift = BuildRegShift(shift_t, reg_S) + + } + + @asm bics ?reg_D reg_N reg_M shift + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/bkpt_A8824.d b/plugins/arm/v7/opdefs/bkpt_A8824.d index f0aa13a..bc034e9 100644 --- a/plugins/arm/v7/opdefs/bkpt_A8824.d +++ b/plugins/arm/v7/opdefs/bkpt_A8824.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,17 +23,27 @@ @title BKPT -@desc Breakpoint causes a software breakpoint to occur. Breakpoint is always unconditional, even when inside an IT block. +@id 23 + +@desc { + + Breakpoint causes a software breakpoint to occur. Breakpoint is always unconditional, even when inside an IT block. + +} @encoding (t1) { @half 1 0 1 1 1 1 1 0 imm8(8) - @syntax <imm32> + @syntax { - @conv { + @conv { - imm32 = ZeroExtend(imm8, 32) + imm32 = ZeroExtend(imm8, 32) + + } + + @asm bkpt imm32 } @@ -43,11 +53,15 @@ @word cond(4) 0 0 0 1 0 0 1 0 imm12(12) 0 1 1 1 imm4(4) - @syntax <imm32> + @syntax { + + @conv { + + imm32 = ZeroExtend(imm12:imm4, 32) - @conv { + } - imm32 = ZeroExtend(imm12:imm4, 32) + @asm bkpt imm32 } diff --git a/plugins/arm/v7/opdefs/bl_A8825.d b/plugins/arm/v7/opdefs/bl_A8825.d index da0def4..f584f0b 100644 --- a/plugins/arm/v7/opdefs/bl_A8825.d +++ b/plugins/arm/v7/opdefs/bl_A8825.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,27 @@ @title BL, BLX (immediate) -@desc Branch with Link calls a subroutine at a PC-relative address. Branch with Link and Exchange Instruction Sets (immediate) calls a subroutine at a PC-relative address, and changes instruction set from ARM to Thumb, or from Thumb to ARM. +@id 24 + +@desc { + + Branch with Link calls a subroutine at a PC-relative address. Branch with Link and Exchange Instruction Sets (immediate) calls a subroutine at a PC-relative address, and changes instruction set from ARM to Thumb, or from Thumb to ARM. + +} @encoding (T1) { @word 1 1 1 1 0 S(1) imm10(10) 1 1 J1(1) 1 J2(1) imm11(11) - @syntax <imm32> + @syntax { - @conv { + @conv { - I1 = NOT(J1 EOR S) - I2 = NOT(J2 EOR S) - imm32 = SignExtend(S:I1:I2:imm10:imm11:'0', S & 0x1, 32) + imm32 = SignExtend(S:J2:J1:imm10:imm11:'0', 32, 24) + + } + + @asm bl imm32 } @@ -53,13 +61,15 @@ @word 1 1 1 1 0 S(1) imm10H(10) 1 1 J1(1) 0 J2(1) imm10L(10) H(1) - @syntax "blx" <imm32> + @syntax { + + @conv { - @conv { + imm32 = SignExtend(S:J1:J2:imm10H:imm10L:'00', 32, 24) - I1 = NOT(J1 EOR S) - I2 = NOT(J2 EOR S) - imm32 = SignExtend(S:I1:I2:imm10H:imm10L:'00', S & 0x1, 32) + } + + @asm blx imm32 } @@ -77,17 +87,21 @@ @word cond(4) 1 0 1 1 imm24(24) - @syntax <imm32> + @syntax { - @conv { + @conv { - imm32 = SignExtend(imm24:'00', imm24 & 0x800000, 32) + imm32 = SignExtend(imm24:'00', 32, 25) - } + } + + @asm bl imm32 - @rules { + @rules { - chk_call StoreCondition(cond) + check g_arm_instruction_set_cond(cond) + + } } @@ -105,11 +119,15 @@ @word 1 1 1 1 1 0 1 H(1) imm24(24) - @syntax "blx" <imm32> + @syntax { + + @conv { + + imm32 = SignExtend(imm24:H:'0', 32, 25) - @conv { + } - imm32 = SignExtend(imm24:H:'0', imm24 & 0x800000, 32) + @asm blx imm32 } diff --git a/plugins/arm/v7/opdefs/blx_A8826.d b/plugins/arm/v7/opdefs/blx_A8826.d index 29719fa..9a856b1 100644 --- a/plugins/arm/v7/opdefs/blx_A8826.d +++ b/plugins/arm/v7/opdefs/blx_A8826.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,17 +23,27 @@ @title BLX (register) -@desc Branch with Link and Exchange (register) calls a subroutine at an address and instruction set specified by a register. +@id 25 + +@desc { + + Branch with Link and Exchange (register) calls a subroutine at an address and instruction set specified by a register. + +} @encoding (t1) { @half 0 1 0 0 0 1 1 1 1 Rm(4) 0 0 0 - @syntax <reg_M> + @syntax { + + @conv { - @conv { + reg_M = Register(Rm) - reg_M = Register(Rm) + } + + @asm blx reg_M } @@ -43,17 +53,21 @@ @word cond(4) 0 0 0 1 0 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 Rm(4) - @syntax <reg_M> + @syntax { - @conv { + @conv { - reg_M = Register(Rm) + reg_M = Register(Rm) - } + } + + @asm blx reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/bx_A8827.d b/plugins/arm/v7/opdefs/bx_A8827.d index f3681e7..15d6288 100644 --- a/plugins/arm/v7/opdefs/bx_A8827.d +++ b/plugins/arm/v7/opdefs/bx_A8827.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,24 +23,33 @@ @title BX -@desc Branch and Exchange causes a branch to an address and instruction set specified by a register. +@id 26 + +@desc { + + Branch and Exchange causes a branch to an address and instruction set specified by a register. + +} @encoding (t1) { @half 0 1 0 0 0 1 1 1 0 Rm(4) 0 0 0 - @syntax <reg_M> + @syntax { + + @conv { - @conv { + reg_M = Register(Rm) - reg_M = Register(Rm) + } + + @asm bx reg_M } @hooks { fetch = help_fetching_with_instruction_bx_from_thumb - link = handle_armv7_conditional_branch_from_register } @@ -50,24 +59,27 @@ @word cond(4) 0 0 0 1 0 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 Rm(4) - @syntax <reg_M> + @syntax { - @conv { + @conv { - reg_M = Register(Rm) + reg_M = Register(Rm) - } + } + + @asm bx reg_M - @rules { + @rules { - chk_call StoreCondition(cond) + check g_arm_instruction_set_cond(cond) + + } } @hooks { - fetch = help_fetching_with_instruction_bx_from_arm - link = handle_armv7_conditional_branch_from_register + fetch = help_fetching_with_instruction_bx_from_thumb } diff --git a/plugins/arm/v7/opdefs/bxj_A8828.d b/plugins/arm/v7/opdefs/bxj_A8828.d index efa2de2..0716a31 100644 --- a/plugins/arm/v7/opdefs/bxj_A8828.d +++ b/plugins/arm/v7/opdefs/bxj_A8828.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,17 +23,27 @@ @title BXJ -@desc Branch and Exchange Jazelle attempts to change to Jazelle state. If the attempt fails, it branches to an address and instruction set specified by a register as though it were a BX instruction. In an implementation that includes the Virtualization Extensions, if HSTR.TJDBX is set to 1, execution of a BXJ instruction in a Non-secure mode other than Hyp mode generates a Hyp Trap exception. For more information see Trapping accesses to Jazelle functionality on page B1-1255. +@id 27 + +@desc { + + Branch and Exchange Jazelle attempts to change to Jazelle state. If the attempt fails, it branches to an address and instruction set specified by a register as though it were a BX instruction. In an implementation that includes the Virtualization Extensions, if HSTR.TJDBX is set to 1, execution of a BXJ instruction in a Non-secure mode other than Hyp mode generates a Hyp Trap exception. For more information see Trapping accesses to Jazelle functionality on page B1-1255. + +} @encoding (T1) { @word 1 1 1 1 0 0 1 1 1 1 0 0 Rm(4) 1 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 - @syntax <reg_M> + @syntax { + + @conv { - @conv { + reg_M = Register(Rm) - reg_M = Register(Rm) + } + + @asm bxj reg_M } @@ -43,17 +53,21 @@ @word cond(4) 0 0 0 1 0 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 Rm(4) - @syntax <reg_M> + @syntax { - @conv { + @conv { - reg_M = Register(Rm) + reg_M = Register(Rm) - } + } + + @asm bxj reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/cb_A8829.d b/plugins/arm/v7/opdefs/cb_A8829.d index 134e0f4..3ac923a 100644 --- a/plugins/arm/v7/opdefs/cb_A8829.d +++ b/plugins/arm/v7/opdefs/cb_A8829.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,26 +23,53 @@ @title CBNZ, CBZ -@desc Compare and Branch on Nonzero and Compare and Branch on Zero compare the value in a register with zero, and conditionally branch forward a constant value. They do not affect the condition flags. +@id 28 + +@desc { + + Compare and Branch on Nonzero and Compare and Branch on Zero compare the value in a register with zero, and conditionally branch forward a constant value. They do not affect the condition flags. + +} @encoding (t1) { @half 1 0 1 1 op(1) 0 i(1) 1 imm5(5) Rn(3) - @syntax <reg_N> <imm32> + @syntax { + + @assert { + + op == 0 + + } + + @conv { - @conv { + reg_N = Register(Rn) + imm32 = ZeroExtend(i:imm5:'0', 32) - reg_N = Register(Rn) - imm32 = ZeroExtend(i:imm5:'0', 32) - nonzero = (op == '1') + } + + @asm cbz reg_N imm32 } - @rules { + @syntax { + + @assert { + + op == 1 + + } + + @conv { + + reg_N = Register(Rn) + imm32 = ZeroExtend(i:imm5:'0', 32) + + } - if (nonzero); chk_call ExtendKeyword("n") - chk_call ExtendKeyword("z") + @asm cbnz reg_N imm32 } diff --git a/plugins/arm/v7/opdefs/cdp_A8830.d b/plugins/arm/v7/opdefs/cdp_A8830.d index 109b89b..6d2148d 100644 --- a/plugins/arm/v7/opdefs/cdp_A8830.d +++ b/plugins/arm/v7/opdefs/cdp_A8830.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,22 +23,32 @@ @title CDP, CDP2 -@desc Coprocessor Data Processing tells a coprocessor to perform an operation that is independent of ARM core registers and memory. If no coprocessor can execute the instruction, an Undefined Instruction exception is generated. This is a generic coprocessor instruction. Some of the fields have no functionality defined by the architecture and are free for use by the coprocessor instruction set designer. These are the opc1, opc2, CRd, CRn, and CRm fields. However, coprocessors CP8-CP15 are reserved for use by ARM, and this manual defines the valid CDP and CDP2 instructions when coproc is in the range p8-p15. For more information see Coprocessor support on page A2-94. +@id 29 + +@desc { + + Coprocessor Data Processing tells a coprocessor to perform an operation that is independent of ARM core registers and memory. If no coprocessor can execute the instruction, an Undefined Instruction exception is generated. This is a generic coprocessor instruction. Some of the fields have no functionality defined by the architecture and are free for use by the coprocessor instruction set designer. These are the opc1, opc2, CRd, CRn, and CRm fields. However, coprocessors CP8-CP15 are reserved for use by ARM, and this manual defines the valid CDP and CDP2 instructions when coproc is in the range p8-p15. For more information see Coprocessor support on page A2-94. + +} @encoding (T1) { @word 1 1 1 0 1 1 1 0 opc1(4) CRn(4) CRd(4) coproc(4) opc2(3) 0 CRm(4) - @syntax <cp> <undef_opc1> <creg_D> <creg_N> <creg_M> <undef_opc2> + @syntax { - @conv { + @conv { - cp = CoProcessor(coproc) - undef_opc1 = RawValue(opc1) - creg_D = CRegister(CRd) - creg_N = CRegister(CRn) - creg_M = CRegister(CRm) - undef_opc2 = RawValue(opc2) + cp = CoProcessor(coproc) + direct_opc1 = UInt(opc1) + direct_CRd = UInt(CRd) + direct_CRn = UInt(CRn) + direct_CRm = UInt(CRm) + direct_opc2 = UInt(opc2) + + } + + @asm cdp cp direct_opc1 direct_CRd direct_CRn direct_CRm ?direct_opc2 } @@ -46,24 +56,22 @@ @encoding (A1) { - @word cond(4) 1 1 1 0 opc1(4) CRn(4) CRd(4) coproc(4) opc2(3) 0 CRm(4) - - @syntax <cp> <undef_opc1> <creg_D> <creg_N> <creg_M> <undef_opc2> + @word 1 1 1 0 1 1 1 0 opc1(4) CRn(4) CRd(4) coproc(4) opc2(3) 0 CRm(4) - @conv { + @syntax { - cp = CoProcessor(coproc) - undef_opc1 = RawValue(opc1) - creg_D = CRegister(CRd) - creg_N = CRegister(CRn) - creg_M = CRegister(CRm) - undef_opc2 = RawValue(opc2) + @conv { - } + cp = CoProcessor(coproc) + direct_opc1 = UInt(opc1) + direct_CRd = UInt(CRd) + direct_CRn = UInt(CRn) + direct_CRm = UInt(CRm) + direct_opc2 = UInt(opc2) - @rules { + } - chk_call StoreCondition(cond) + @asm cdp cp direct_opc1 direct_CRd direct_CRn direct_CRm ?direct_opc2 } @@ -73,16 +81,20 @@ @word 1 1 1 1 1 1 1 0 opc1(4) CRn(4) CRd(4) coproc(4) opc2(3) 0 CRm(4) - @syntax "cdp2" <cp> <undef_opc1> <creg_D> <creg_N> <creg_M> <undef_opc2> + @syntax { + + @conv { - @conv { + cp = CoProcessor(coproc) + direct_opc1 = UInt(opc1) + direct_CRd = UInt(CRd) + direct_CRn = UInt(CRn) + direct_CRm = UInt(CRm) + direct_opc2 = UInt(opc2) - cp = CoProcessor(coproc) - undef_opc1 = RawValue(opc1) - creg_D = CRegister(CRd) - creg_N = CRegister(CRn) - creg_M = CRegister(CRm) - undef_opc2 = RawValue(opc2) + } + + @asm cdp cp direct_opc1 direct_CRd direct_CRn direct_CRm ?direct_opc2 } @@ -92,16 +104,20 @@ @word 1 1 1 1 1 1 1 0 opc1(4) CRn(4) CRd(4) coproc(4) opc2(3) 0 CRm(4) - @syntax "cdp2" <cp> <undef_opc1> <creg_D> <creg_N> <creg_M> <undef_opc2> + @syntax { + + @conv { + + cp = CoProcessor(coproc) + direct_opc1 = UInt(opc1) + direct_CRd = UInt(CRd) + direct_CRn = UInt(CRn) + direct_CRm = UInt(CRm) + direct_opc2 = UInt(opc2) - @conv { + } - cp = CoProcessor(coproc) - undef_opc1 = RawValue(opc1) - creg_D = CRegister(CRd) - creg_N = CRegister(CRn) - creg_M = CRegister(CRm) - undef_opc2 = RawValue(opc2) + @asm cdp cp direct_opc1 direct_CRd direct_CRn direct_CRm ?direct_opc2 } diff --git a/plugins/arm/v7/opdefs/clrex_A8832.d b/plugins/arm/v7/opdefs/clrex_A8832.d index 4f313f2..38dbca2 100644 --- a/plugins/arm/v7/opdefs/clrex_A8832.d +++ b/plugins/arm/v7/opdefs/clrex_A8832.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,17 +23,35 @@ @title CLREX -@desc Clear-Exclusive clears the local record of the executing processor that an address has had a request for an exclusive access. +@id 31 + +@desc { + + Clear-Exclusive clears the local record of the executing processor that an address has had a request for an exclusive access. + +} @encoding (T1) { @word 1 1 1 1 0 0 1 1 1 0 1 1 1 1 1 1 1 0 0 0 1 1 1 1 0 0 1 0 1 1 1 1 + @syntax { + + @asm clrex + + } + } @encoding (A1) { @word 1 1 1 1 0 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 1 + @syntax { + + @asm clrex + + } + } diff --git a/plugins/arm/v7/opdefs/clz_A8833.d b/plugins/arm/v7/opdefs/clz_A8833.d index d4fdac6..079e36d 100644 --- a/plugins/arm/v7/opdefs/clz_A8833.d +++ b/plugins/arm/v7/opdefs/clz_A8833.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,18 +23,28 @@ @title CLZ -@desc Count Leading Zeros returns the number of binary zero bits before the first binary one bit in a value. +@id 32 + +@desc { + + Count Leading Zeros returns the number of binary zero bits before the first binary one bit in a value. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 1 0 1 1 Rm(4) 1 1 1 1 Rd(4) 1 0 0 0 Rm(4) - @syntax <reg_D> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_M = Register(Rm) + } + + @asm clz reg_D reg_M } @@ -44,18 +54,22 @@ @word cond(4) 0 0 0 1 0 1 1 0 1 1 1 1 Rd(4) 1 1 1 1 0 0 0 1 Rm(4) - @syntax <reg_D> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_M = Register(Rm) - } + } + + @asm clz reg_D reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/cmn_A8834.d b/plugins/arm/v7/opdefs/cmn_A8834.d index fc0b19f..dbf0977 100644 --- a/plugins/arm/v7/opdefs/cmn_A8834.d +++ b/plugins/arm/v7/opdefs/cmn_A8834.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,18 +23,28 @@ @title CMN (immediate) -@desc Compare Negative (immediate) adds a register value and an immediate value. It updates the condition flags based on the result, and discards the result. +@id 33 + +@desc { + + Compare Negative (immediate) adds a register value and an immediate value. It updates the condition flags based on the result, and discards the result. + +} @encoding (T1) { @word 1 1 1 1 0 i(1) 0 1 0 0 0 1 Rn(4) 0 imm3(3) 1 1 1 1 imm8(8) - @syntax <reg_N> <imm32> + @syntax { + + @conv { - @conv { + reg_N = Register(Rn) + imm32 = ThumbExpandImm(i:imm3:imm8) - reg_N = Register(Rn) - imm32 = ThumbExpandImm(i:imm3:imm8) + } + + @asm cmn reg_N imm32 } @@ -44,18 +54,22 @@ @word cond(4) 0 0 1 1 0 1 1 1 Rn(4) 0 0 0 0 imm12(12) - @syntax <reg_N> <imm32> + @syntax { - @conv { + @conv { - reg_N = Register(Rn) - imm32 = ARMExpandImm(imm12) + reg_N = Register(Rn) + imm32 = ARMExpandImm(imm12) - } + } + + @asm cmn reg_N imm32 + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/cmn_A8835.d b/plugins/arm/v7/opdefs/cmn_A8835.d index cd228de..deeef21 100644 --- a/plugins/arm/v7/opdefs/cmn_A8835.d +++ b/plugins/arm/v7/opdefs/cmn_A8835.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,18 +23,28 @@ @title CMN (register) -@desc Compare Negative (register) adds a register value and an optionally-shifted register value. It updates the condition flags based on the result, and discards the result. +@id 34 + +@desc { + + Compare Negative (register) adds a register value and an optionally-shifted register value. It updates the condition flags based on the result, and discards the result. + +} @encoding (t1) { @half 0 1 0 0 0 0 1 0 1 1 Rm(3) Rn(3) - @syntax <reg_N> <reg_M> + @syntax { + + @conv { + + reg_N = Register(Rn) + reg_M = Register(Rm) - @conv { + } - reg_N = Register(Rn) - reg_M = Register(Rm) + @asm cmn reg_N reg_M } @@ -44,13 +54,17 @@ @word 1 1 1 0 1 0 1 1 0 0 0 1 Rn(4) 0 imm3(3) 1 1 1 1 imm2(2) type(2) Rm(4) - @syntax ".W" <reg_N> <reg_M> <?shift> + @syntax { - @conv { + @conv { - reg_N = Register(Rn) - reg_M = Register(Rm) - shift = DecodeImmShift(type, imm3:imm2) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm3:imm2) + + } + + @asm cmn.w reg_N reg_M ?shift } @@ -60,19 +74,23 @@ @word cond(4) 0 0 0 1 0 1 1 1 Rn(4) 0 0 0 0 imm5(5) type(2) 0 Rm(4) - @syntax <reg_N> <reg_M> <?shift> + @syntax { - @conv { + @conv { - reg_N = Register(Rn) - reg_M = Register(Rm) - shift = DecodeImmShift(type, imm5) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) - } + } + + @asm cmn reg_N reg_M ?shift + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/cmn_A8836.d b/plugins/arm/v7/opdefs/cmn_A8836.d index ad58482..44d414d 100644 --- a/plugins/arm/v7/opdefs/cmn_A8836.d +++ b/plugins/arm/v7/opdefs/cmn_A8836.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,25 +23,37 @@ @title CMN (register-shifted register) -@desc Compare Negative (register-shifted register) adds a register value and a register-shifted register value. It updates the condition flags based on the result, and discards the result. +@id 35 + +@desc { + + Compare Negative (register-shifted register) adds a register value and a register-shifted register value. It updates the condition flags based on the result, and discards the result. + +} @encoding (A1) { @word cond(4) 0 0 0 1 0 1 1 1 Rn(4) 0 0 0 0 Rs(4) 0 type(2) 1 Rm(4) - @syntax <reg_N> <reg_M> <reg_shift> + @syntax { - @conv { + @conv { - reg_shift = RegisterShift(type, Rs) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift_t = UInt(type) + reg_S = Register(Rs) + shift = BuildRegShift(shift_t, reg_S) - } + } + + @asm cmn reg_N reg_M shift + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/cmp_A8837.d b/plugins/arm/v7/opdefs/cmp_A8837.d index 76b7a76..bd35c57 100644 --- a/plugins/arm/v7/opdefs/cmp_A8837.d +++ b/plugins/arm/v7/opdefs/cmp_A8837.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,18 +23,28 @@ @title CMP (immediate) -@desc Compare (immediate) subtracts an immediate value from a register value. It updates the condition flags based on the result, and discards the result. +@id 36 + +@desc { + + Compare (immediate) subtracts an immediate value from a register value. It updates the condition flags based on the result, and discards the result. + +} @encoding (t1) { @half 0 0 1 0 1 Rn(3) imm8(8) - @syntax <reg_N> <imm32> + @syntax { + + @conv { + + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8, 32) - @conv { + } - reg_N = Register(Rn) - imm32 = ZeroExtend(imm8, 32) + @asm cmp reg_N imm32 } @@ -44,12 +54,16 @@ @word 1 1 1 1 0 i(1) 0 1 1 0 1 1 Rn(4) 0 imm3(3) 1 1 1 1 imm8(8) - @syntax ".W" <reg_N> <imm32> + @syntax { - @conv { + @conv { - reg_N = Register(Rn) - imm32 = ThumbExpandImm(i:imm3:imm8) + reg_N = Register(Rn) + imm32 = ThumbExpandImm(i:imm3:imm8) + + } + + @asm cmp.w reg_N imm32 } @@ -59,18 +73,22 @@ @word cond(4) 0 0 1 1 0 1 0 1 Rn(4) 0 0 0 0 imm12(12) - @syntax <reg_N> <imm32> + @syntax { - @conv { + @conv { - reg_N = Register(Rn) - imm32 = ARMExpandImm(imm12) + reg_N = Register(Rn) + imm32 = ARMExpandImm(imm12) - } + } + + @asm cmp reg_N imm32 + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/cmp_A8838.d b/plugins/arm/v7/opdefs/cmp_A8838.d index cd02543..4c1bf73 100644 --- a/plugins/arm/v7/opdefs/cmp_A8838.d +++ b/plugins/arm/v7/opdefs/cmp_A8838.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,18 +23,28 @@ @title CMP (register) -@desc Compare (register) subtracts an optionally-shifted register value from a register value. It updates the condition flags based on the result, and discards the result. +@id 37 + +@desc { + + Compare (register) subtracts an optionally-shifted register value from a register value. It updates the condition flags based on the result, and discards the result. + +} @encoding (t1) { @half 0 1 0 0 0 0 1 0 1 0 Rm(3) Rn(3) - @syntax <reg_N> <reg_M> + @syntax { - @conv { + @conv { - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_N = Register(Rn) + reg_M = Register(Rm) + + } + + @asm cmp reg_N reg_M } @@ -44,12 +54,16 @@ @half 0 1 0 0 0 1 0 1 N(1) Rm(4) Rn(3) - @syntax <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_N = Register(N:Rn) + reg_M = Register(Rm) - reg_N = Register(N:Rn) - reg_M = Register(Rm) + } + + @asm cmp reg_N reg_M } @@ -59,13 +73,17 @@ @word 1 1 1 0 1 0 1 1 1 0 1 1 Rn(4) 0 imm3(3) 1 1 1 1 imm2(2) type(2) Rm(4) - @syntax ".W" <reg_N> <reg_M> <?shift> + @syntax { + + @conv { + + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm3:imm2) - @conv { + } - reg_N = Register(Rn) - reg_M = Register(Rm) - shift = DecodeImmShift(type, imm3:imm2) + @asm cmp.w reg_N reg_M ?shift } @@ -75,19 +93,23 @@ @word cond(4) 0 0 0 1 0 1 0 1 Rn(4) 0 0 0 0 imm5(5) type(2) 0 Rm(4) - @syntax <reg_N> <reg_M> <?shift> + @syntax { - @conv { + @conv { - reg_N = Register(Rn) - reg_M = Register(Rm) - shift = DecodeImmShift(type, imm5) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) - } + } + + @asm cmp reg_N reg_M ?shift + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/cmp_A8839.d b/plugins/arm/v7/opdefs/cmp_A8839.d index 45ed0f9..4d8a8cf 100644 --- a/plugins/arm/v7/opdefs/cmp_A8839.d +++ b/plugins/arm/v7/opdefs/cmp_A8839.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,25 +23,37 @@ @title CMP (register-shifted register) -@desc Compare (register-shifted register) subtracts a register-shifted register value from a register value. It updates the condition flags based on the result, and discards the result. +@id 38 + +@desc { + + Compare (register-shifted register) subtracts a register-shifted register value from a register value. It updates the condition flags based on the result, and discards the result. + +} @encoding (A1) { @word cond(4) 0 0 0 1 0 1 0 1 Rn(4) 0 0 0 0 Rs(4) 0 type(2) 1 Rm(4) - @syntax <reg_N> <reg_M> <reg_shift> + @syntax { - @conv { + @conv { - reg_shift = RegisterShift(type, Rs) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift_t = UInt(type) + reg_S = Register(Rs) + shift = BuildRegShift(shift_t, reg_S) - } + } + + @asm cmp reg_N reg_M shift + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/dbg_A8842.d b/plugins/arm/v7/opdefs/dbg_A8842.d index 62142f5..aa06c16 100644 --- a/plugins/arm/v7/opdefs/dbg_A8842.d +++ b/plugins/arm/v7/opdefs/dbg_A8842.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,17 +23,27 @@ @title DBG -@desc Debug Hint provides a hint to debug and related systems. See their documentation for what use (if any) they make of this instruction. +@id 41 + +@desc { + + Debug Hint provides a hint to debug and related systems. See their documentation for what use (if any) they make of this instruction. + +} @encoding (T1) { @word 1 1 1 1 0 0 1 1 1 0 1 0 1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 option(4) - @syntax <undef_option> + @syntax { + + @conv { - @conv { + direct_option = UInt(option) - undef_option = RawValue(option) + } + + @asm dbg direct_option } @@ -43,17 +53,21 @@ @word cond(4) 0 0 1 1 0 0 1 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 option(4) - @syntax <undef_option> + @syntax { - @conv { + @conv { - undef_option = RawValue(option) + direct_option = UInt(option) - } + } + + @asm dbg direct_option + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/dmb_A8843.d b/plugins/arm/v7/opdefs/dmb_A8843.d index 34f053a..da9abdc 100644 --- a/plugins/arm/v7/opdefs/dmb_A8843.d +++ b/plugins/arm/v7/opdefs/dmb_A8843.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,17 +23,27 @@ @title DMB -@desc Data Memory Barrier is a memory barrier that ensures the ordering of observations of memory accesses, see Data Memory Barrier (DMB) on page A3-151. +@id 42 + +@desc { + + Data Memory Barrier is a memory barrier that ensures the ordering of observations of memory accesses, see Data Memory Barrier (DMB) on page A3-151. + +} @encoding (T1) { @word 1 1 1 1 0 0 1 1 1 0 1 1 1 1 1 1 1 0 0 0 1 1 1 1 0 1 0 1 option(4) - @syntax <limitation> + @syntax { - @conv { + @conv { - limitation = BarrierLimitation(option) + direct_option = UInt(option) + + } + + @asm dmb ?direct_option } @@ -43,11 +53,15 @@ @word 1 1 1 1 0 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 1 0 1 option(4) - @syntax <limitation> + @syntax { + + @conv { + + direct_option = UInt(option) - @conv { + } - limitation = BarrierLimitation(option) + @asm dmb ?direct_option } diff --git a/plugins/arm/v7/opdefs/dsb_A8844.d b/plugins/arm/v7/opdefs/dsb_A8844.d index 512220c..87925ae 100644 --- a/plugins/arm/v7/opdefs/dsb_A8844.d +++ b/plugins/arm/v7/opdefs/dsb_A8844.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,17 +23,27 @@ @title DSB -@desc Data Synchronization Barrier is a memory barrier that ensures the completion of memory accesses, see Data Synchronization Barrier (DSB) on page A3-152. +@id 43 + +@desc { + + Data Synchronization Barrier is a memory barrier that ensures the completion of memory accesses, see Data Synchronization Barrier (DSB) on page A3-152. + +} @encoding (T1) { @word 1 1 1 1 0 0 1 1 1 0 1 1 1 1 1 1 1 0 0 0 1 1 1 1 0 1 0 0 option(4) - @syntax <limitation> + @syntax { - @conv { + @conv { - limitation = BarrierLimitation(option) + direct_option = UInt(option) + + } + + @asm dsb ?direct_option } @@ -43,11 +53,15 @@ @word 1 1 1 1 0 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 1 0 0 option(4) - @syntax <limitation> + @syntax { + + @conv { + + direct_option = UInt(option) - @conv { + } - limitation = BarrierLimitation(option) + @asm dsb ?direct_option } diff --git a/plugins/arm/v7/opdefs/eor_A8846.d b/plugins/arm/v7/opdefs/eor_A8846.d index 38dc858..3dc39cc 100644 --- a/plugins/arm/v7/opdefs/eor_A8846.d +++ b/plugins/arm/v7/opdefs/eor_A8846.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,26 +23,55 @@ @title EOR (immediate) -@desc Bitwise Exclusive OR (immediate) performs a bitwise Exclusive OR of a register value and an immediate value, and writes the result to the destination register. It can optionally update the condition flags based on the result. +@id 45 + +@desc { + + Bitwise Exclusive OR (immediate) performs a bitwise Exclusive OR of a register value and an immediate value, and writes the result to the destination register. It can optionally update the condition flags based on the result. + +} @encoding (T1) { @word 1 1 1 1 0 i(1) 0 0 1 0 0 S(1) Rn(4) 0 imm3(3) Rd(4) imm8(8) - @syntax <reg_D> <reg_N> <imm32> + @syntax { + + @assert { + + S == 0 + + } + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + const = ThumbExpandImm_C(i:imm3:imm8, APSR_C) - reg_D = Register(Rd) - reg_N = Register(Rn) - setflags = (S == '1') - imm32 = ThumbExpandImm_C(i:imm3:imm8, 0) + } + + @asm eor ?reg_D reg_N const } - @rules { + @syntax { + + @assert { + + S == 1 + + } - if (setflags); chk_call ExtendKeyword("s") + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + const = ThumbExpandImm_C(i:imm3:imm8, APSR_C) + + } + + @asm eors ?reg_D reg_N const } @@ -52,21 +81,55 @@ @word cond(4) 0 0 1 0 0 0 1 S(1) Rn(4) Rd(4) imm12(12) - @syntax <reg_D> <reg_N> <imm32> + @syntax { + + @assert { - @conv { + S == 0 - reg_D = Register(Rd) - reg_N = Register(Rn) - setflags = (S == '1') - imm32 = ARMExpandImm_C(imm12, 0) + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + const = ARMExpandImm_C(imm12, APSR_C) + + } + + @asm eor ?reg_D reg_N const + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + const = ARMExpandImm_C(imm12, APSR_C) + + } + + @asm eors ?reg_D reg_N const + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/eor_A8847.d b/plugins/arm/v7/opdefs/eor_A8847.d index 66643a1..4746ef8 100644 --- a/plugins/arm/v7/opdefs/eor_A8847.d +++ b/plugins/arm/v7/opdefs/eor_A8847.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,18 +23,29 @@ @title EOR (register) -@desc Bitwise Exclusive OR (register) performs a bitwise Exclusive OR of a register value and an optionally-shifted register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. +@id 46 + +@desc { + + Bitwise Exclusive OR (register) performs a bitwise Exclusive OR of a register value and an optionally-shifted register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. + +} @encoding (t1) { @half 0 1 0 0 0 0 0 0 0 1 Rm(3) Rdn(3) - @syntax "eors" <reg_DN> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rdn) + reg_N = Register(Rdn) + reg_M = Register(Rm) - reg_DN = Register(Rdn) - reg_M = Register(Rm) + } + + @asm eor ?reg_D reg_N reg_M } @@ -44,22 +55,45 @@ @word 1 1 1 0 1 0 1 0 1 0 0 S(1) Rn(4) 0 imm3(3) Rd(4) imm2(2) type(2) Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <?shift> + @syntax { + + @assert { + + S == 0 + + } - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') - shift = DecodeImmShift(type, imm3:imm2) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm3:imm2) + + } + + @asm eor.w ?reg_D reg_N reg_M ?shift } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm3:imm2) + + } - if (setflags); chk_call ExtendKeyword("s") - chk_call ExtendKeyword(".w") + @asm eors.w ?reg_D reg_N reg_M ?shift } @@ -69,22 +103,57 @@ @word cond(4) 0 0 0 0 0 0 1 S(1) Rn(4) Rd(4) imm5(5) type(2) 0 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <?shift> + @syntax { - @conv { + @assert { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') - shift = DecodeImmShift(type, imm5) + S == 0 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) + + } + + @asm eor ?reg_D reg_N reg_M ?shift + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) + + } + + @asm eors ?reg_D reg_N reg_M ?shift + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/eor_A8848.d b/plugins/arm/v7/opdefs/eor_A8848.d index f38fa74..1248e43 100644 --- a/plugins/arm/v7/opdefs/eor_A8848.d +++ b/plugins/arm/v7/opdefs/eor_A8848.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,28 +23,73 @@ @title EOR (register-shifted register) -@desc Bitwise Exclusive OR (register-shifted register) performs a bitwise Exclusive OR of a register value and a register-shifted register value. It writes the result to the destination register, and can optionally update the condition flags based on the result. +@id 47 + +@desc { + + Bitwise Exclusive OR (register-shifted register) performs a bitwise Exclusive OR of a register value and a register-shifted register value. It writes the result to the destination register, and can optionally update the condition flags based on the result. + +} @encoding (A1) { @word cond(4) 0 0 0 0 0 0 1 S(1) Rn(4) Rd(4) Rs(4) 0 type(2) 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <reg_shift> + @syntax { + + @assert { + + S == 0 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift_t = UInt(type) + reg_S = Register(Rs) + shift = BuildRegShift(shift_t, reg_S) + + } + + @asm eor ?reg_D reg_N reg_M shift - @conv { + @rules { - reg_shift = RegisterShift(type, Rs) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift_t = UInt(type) + reg_S = Register(Rs) + shift = BuildRegShift(shift_t, reg_S) + + } + + @asm eors ?reg_D reg_N reg_M shift + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/ldr_A8862.d b/plugins/arm/v7/opdefs/ldr_A8862.d index 03df506..5672fe3 100644 --- a/plugins/arm/v7/opdefs/ldr_A8862.d +++ b/plugins/arm/v7/opdefs/ldr_A8862.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title LDR (immediate, Thumb) -@desc Load Register (immediate) calculates an address from a base register value and an immediate offset, loads a word from memory, and writes it to a register. It can use offset, post-indexed, or pre-indexed addressing. For information about memory accesses see Memory accesses on page A8-294. +@id 61 + +@desc { + + Load Register (immediate) calculates an address from a base register value and an immediate offset, loads a word from memory, and writes it to a register. It can use offset, post-indexed, or pre-indexed addressing. For information about memory accesses see Memory accesses on page A8-294. + +} @encoding (t1) { @half 0 1 1 0 1 imm5(5) Rn(3) Rt(3) - @syntax <reg_T> <mem_access> + @syntax { + + @conv { - @conv { + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm5:'00', 32) + maccess = MemAccessOffset(reg_N, imm32) - reg_T = Register(Rt) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm5:'00', 32) - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, true, true, false) + } + + @asm ldr reg_T maccess } @@ -46,14 +56,18 @@ @half 1 0 0 1 1 Rt(3) imm8(8) - @syntax <reg_T> <mem_access> + @syntax { + + @conv { - @conv { + reg_T = Register(Rt) + reg_N = Register(13) + imm32 = ZeroExtend(imm8:'00', 32) + maccess = MemAccessOffset(reg_N, imm32) - reg_T = Register(Rt) - imm32 = ZeroExtend(imm8:'00', 32) - SP = Register(13) - mem_access = MakeMemoryAccess(SP, imm32, NULL, true, true, false) + } + + @asm ldr reg_T maccess } @@ -63,14 +77,18 @@ @word 1 1 1 1 1 0 0 0 1 1 0 1 Rn(4) Rt(4) imm12(12) - @syntax ".W" <reg_T> <mem_access> + @syntax { + + @conv { - @conv { + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm12, 32) + maccess = MemAccessOffset(reg_N, imm32) - reg_T = Register(Rt) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm12, 32) - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, true, true, false) + } + + @asm ldr.w reg_T maccess } @@ -80,17 +98,69 @@ @word 1 1 1 1 1 0 0 0 0 1 0 1 Rn(4) Rt(4) 1 P(1) U(1) W(1) imm8(8) - @syntax <reg_T> <mem_access> + @syntax { + + @assert { + + P == 1 + W == 0 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8, 32) + maccess = MemAccessOffset(reg_N, imm32) + + } + + @asm ldr reg_T maccess + + } + + @syntax { + + @assert { + + P == 1 + W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8, 32) + maccess = MemAccessPreIndexed(reg_N, imm32) + + } + + @asm ldr reg_T maccess + + } + + @syntax { + + @assert { + + P == 0 + W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8, 32) + maccess = MemAccessPostIndexed(reg_N, imm32) - @conv { + } - reg_T = Register(Rt) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm8, 32) - index = (P == '1') - add = (U == '1') - wback = (W == '1') - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, index, add, wback) + @asm ldr reg_T maccess } diff --git a/plugins/arm/v7/opdefs/ldr_A8863.d b/plugins/arm/v7/opdefs/ldr_A8863.d index 0d0ce1f..3e1b255 100644 --- a/plugins/arm/v7/opdefs/ldr_A8863.d +++ b/plugins/arm/v7/opdefs/ldr_A8863.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,29 +23,99 @@ @title LDR (immediate, ARM) -@desc Load Register (immediate) calculates an address from a base register value and an immediate offset, loads a word from memory, and writes it to a register. It can use offset, post-indexed, or pre-indexed addressing. For information about memory accesses see Memory accesses on page A8-294. +@id 62 + +@desc { + + Load Register (immediate) calculates an address from a base register value and an immediate offset, loads a word from memory, and writes it to a register. It can use offset, post-indexed, or pre-indexed addressing. For information about memory accesses see Memory accesses on page A8-294. + +} @encoding (A1) { @word cond(4) 0 1 0 P(1) U(1) 0 W(1) 1 Rn(4) Rt(4) imm12(12) - @syntax <reg_T> <mem_access> + @syntax { + + @assert { + + P == 1 + P == 1 && W == 0 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm12, 32) + maccess = MemAccessOffset(reg_N, imm32) + + } + + @asm ldr reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) + + } + + } + + @syntax { - @conv { + @assert { - reg_T = Register(Rt) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm12, 32) - index = (P == '1') - add = (U == '1') - wback = (P == '0') || (W == '1') - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, index, add, wback) + P == 1 + P == 0 || W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm12, 32) + maccess = MemAccessPreIndexed(reg_N, imm32) + + } + + @asm ldr reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + P == 0 + P == 0 || W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm12, 32) + maccess = MemAccessPostIndexed(reg_N, imm32) + + } + + @asm ldr reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/ldr_A8864.d b/plugins/arm/v7/opdefs/ldr_A8864.d index 74afa2d..7c78df5 100644 --- a/plugins/arm/v7/opdefs/ldr_A8864.d +++ b/plugins/arm/v7/opdefs/ldr_A8864.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,18 +23,28 @@ @title LDR (literal) -@desc Load Register (literal) calculates an address from the PC value and an immediate offset, loads a word from memory, and writes it to a register. For information about memory accesses see Memory accesses on page A8-294. +@id 63 + +@desc { + + Load Register (literal) calculates an address from the PC value and an immediate offset, loads a word from memory, and writes it to a register. For information about memory accesses see Memory accesses on page A8-294. + +} @encoding (t1) { @half 0 1 0 0 1 Rt(3) imm8(8) - @syntax <reg_T> <imm32> + @syntax { + + @conv { + + reg_T = Register(Rt) + imm32 = ZeroExtend(imm8:'00', 32) - @conv { + } - reg_T = Register(Rt) - imm32 = ZeroExtend(imm8:'00', 32) + @asm ldr reg_T imm32 } @@ -51,12 +61,16 @@ @word 1 1 1 1 1 0 0 0 U(1) 1 0 1 1 1 1 1 Rt(4) imm12(12) - @syntax ".W" <reg_T> <imm32> + @syntax { - @conv { + @conv { - reg_T = Register(Rt) - imm32 = ZeroExtend(imm12, 32) + reg_T = Register(Rt) + imm32 = ZeroExtend(imm12, 32) + + } + + @asm ldr.w reg_T imm32 } @@ -73,18 +87,22 @@ @word cond(4) 0 1 0 1 U(1) 0 0 1 1 1 1 1 Rt(4) imm12(12) - @syntax <reg_T> <imm32> + @syntax { - @conv { + @conv { - reg_T = Register(Rt) - imm32 = ZeroExtend(imm12, 32) + reg_T = Register(Rt) + imm32 = ZeroExtend(imm12, 32) - } + } + + @asm ldr reg_T imm32 + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/ldr_A8865.d b/plugins/arm/v7/opdefs/ldr_A8865.d index ebb4e09..e94eccb 100644 --- a/plugins/arm/v7/opdefs/ldr_A8865.d +++ b/plugins/arm/v7/opdefs/ldr_A8865.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title LDR (register, Thumb) -@desc Load Register (register) calculates an address from a base register value and an offset register value, loads a word from memory, and writes it to a register. The offset register value can optionally be shifted. For information about memory accesses, see Memory accesses on page A8-294. The Thumb form of LDR (register) does not support register writeback. +@id 64 + +@desc { + + Load Register (register) calculates an address from a base register value and an offset register value, loads a word from memory, and writes it to a register. The offset register value can optionally be shifted. For information about memory accesses, see Memory accesses on page A8-294. The Thumb form of LDR (register) does not support register writeback. + +} @encoding (t1) { @half 0 1 0 1 1 0 0 Rm(3) Rn(3) Rt(3) - @syntax <reg_T> <mem_access> + @syntax { - @conv { + @conv { - reg_T = Register(Rt) - reg_N = Register(Rn) - reg_M = Register(Rm) - mem_access = MakeMemoryAccess(reg_N, reg_M, NULL, true, false, false) + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + maccess = MemAccessOffset(reg_N, reg_M) + + } + + @asm ldr reg_T maccess } @@ -46,15 +56,19 @@ @word 1 1 1 1 1 0 0 0 0 1 0 1 Rn(4) Rt(4) 0 0 0 0 0 0 imm2(2) Rm(4) - @syntax ".W" <reg_T> <mem_access> + @syntax { + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = FixedShift(SRType_LSL, imm2) + maccess = MemAccessOffsetExtended(reg_N, reg_M, shift) - @conv { + } - reg_T = Register(Rt) - reg_N = Register(Rn) - reg_M = Register(Rm) - shift = DecodeImmShift(0, imm2) - mem_access = MakeMemoryAccess(reg_N, reg_M, shift, true, false, false) + @asm ldr.w reg_T maccess } diff --git a/plugins/arm/v7/opdefs/ldr_A8866.d b/plugins/arm/v7/opdefs/ldr_A8866.d index b161043..6ba19f7 100644 --- a/plugins/arm/v7/opdefs/ldr_A8866.d +++ b/plugins/arm/v7/opdefs/ldr_A8866.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,30 +23,102 @@ @title LDR (register, ARM) -@desc Load Register (register) calculates an address from a base register value and an offset register value, loads a word from memory, and writes it to a register. The offset register value can optionally be shifted. For information about memory accesses, see Memory accesses on page A8-294. +@id 65 + +@desc { + + Load Register (register) calculates an address from a base register value and an offset register value, loads a word from memory, and writes it to a register. The offset register value can optionally be shifted. For information about memory accesses, see Memory accesses on page A8-294. + +} @encoding (A1) { @word cond(4) 0 1 1 P(1) U(1) 0 W(1) 1 Rn(4) Rt(4) imm5(5) type(2) 0 Rm(4) - @syntax <reg_T> <mem_access> + @syntax { + + @assert { + + P == 1 + P == 1 && W == 0 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) + maccess = MemAccessOffsetExtended(reg_N, reg_M, shift) + + } + + @asm ldr reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) + + } + + } + + @syntax { - @conv { + @assert { - reg_T = Register(Rt) - reg_N = Register(Rn) - reg_M = Register(Rm) - index = (P == '1') - add = (U == '1') - wback = (P == '0') || (W == '1') - shift = DecodeImmShift(type, imm5) - mem_access = MakeMemoryAccess(reg_N, reg_M, shift, index, add, wback) + P == 1 + P == 0 || W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) + maccess = MemAccessPreIndexedExtended(reg_N, reg_M, shift) + + } + + @asm ldr reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + P == 0 + P == 0 || W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) + maccess = MemAccessPostIndexedExtended(reg_N, reg_M, shift) + + } + + @asm ldr reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/ldrb_A8867.d b/plugins/arm/v7/opdefs/ldrb_A8867.d index 2dea64e..cbfa097 100644 --- a/plugins/arm/v7/opdefs/ldrb_A8867.d +++ b/plugins/arm/v7/opdefs/ldrb_A8867.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title LDRB (immediate, Thumb) -@desc Load Register Byte (immediate) calculates an address from a base register value and an immediate offset, loads a byte from memory, zero-extends it to form a 32-bit word, and writes it to a register. It can use offset, post-indexed, or pre-indexed addressing. For information about memory accesses see Memory accesses on page A8-294. +@id 66 + +@desc { + + Load Register Byte (immediate) calculates an address from a base register value and an immediate offset, loads a byte from memory, zero-extends it to form a 32-bit word, and writes it to a register. It can use offset, post-indexed, or pre-indexed addressing. For information about memory accesses see Memory accesses on page A8-294. + +} @encoding (t1) { @half 0 1 1 1 1 imm5(5) Rn(3) Rt(3) - @syntax <reg_T> <mem_access> + @syntax { + + @conv { - @conv { + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm5, 32) + maccess = MemAccessOffset(reg_N, imm32) - reg_T = Register(Rt) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm5, 32) - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, true, true, false) + } + + @asm ldrb reg_T maccess } @@ -46,14 +56,18 @@ @word 1 1 1 1 1 0 0 0 1 0 0 1 Rn(4) Rt(4) imm12(12) - @syntax ".W" <reg_T> <mem_access> + @syntax { + + @conv { - @conv { + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm12, 32) + maccess = MemAccessOffset(reg_N, imm32) - reg_T = Register(Rt) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm12, 32) - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, true, true, false) + } + + @asm ldrb.w reg_T maccess } @@ -63,17 +77,69 @@ @word 1 1 1 1 1 0 0 0 0 0 0 1 Rn(4) Rt(4) 1 P(1) U(1) W(1) imm8(8) - @syntax <reg_T> <mem_access> + @syntax { + + @assert { + + P == 1 + W == 0 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8, 32) + maccess = MemAccessOffset(reg_N, imm32) + + } + + @asm ldrb reg_T maccess + + } + + @syntax { + + @assert { + + P == 1 + W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8, 32) + maccess = MemAccessPreIndexed(reg_N, imm32) + + } + + @asm ldrb reg_T maccess + + } + + @syntax { + + @assert { + + P == 0 + W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8, 32) + maccess = MemAccessPostIndexed(reg_N, imm32) - @conv { + } - reg_T = Register(Rt) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm8, 32) - index = (P == '1') - add = (U == '1') - wback = (W == '1') - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, index, add, wback) + @asm ldrb reg_T maccess } diff --git a/plugins/arm/v7/opdefs/ldrb_A8868.d b/plugins/arm/v7/opdefs/ldrb_A8868.d index 519c309..71c6c43 100644 --- a/plugins/arm/v7/opdefs/ldrb_A8868.d +++ b/plugins/arm/v7/opdefs/ldrb_A8868.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,29 +23,99 @@ @title LDRB (immediate, ARM) -@desc Load Register Byte (immediate) calculates an address from a base register value and an immediate offset, loads a byte from memory, zero-extends it to form a 32-bit word, and writes it to a register. It can use offset, post-indexed, or pre-indexed addressing. For information about memory accesses see Memory accesses on page A8-294. +@id 67 + +@desc { + + Load Register Byte (immediate) calculates an address from a base register value and an immediate offset, loads a byte from memory, zero-extends it to form a 32-bit word, and writes it to a register. It can use offset, post-indexed, or pre-indexed addressing. For information about memory accesses see Memory accesses on page A8-294. + +} @encoding (A1) { @word cond(4) 0 1 0 P(1) U(1) 1 W(1) 1 Rn(4) Rt(4) imm12(12) - @syntax <reg_T> <mem_access> + @syntax { + + @assert { + + P == 1 + P == 1 && W == 0 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm12, 32) + maccess = MemAccessOffset(reg_N, imm32) + + } + + @asm ldrb reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) + + } + + } + + @syntax { - @conv { + @assert { - reg_T = Register(Rt) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm12, 32) - index = (P == '1') - add = (U == '1') - wback = (P == '0') || (W == '1') - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, index, add, wback) + P == 1 + P == 0 || W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm12, 32) + maccess = MemAccessPreIndexed(reg_N, imm32) + + } + + @asm ldrb reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + P == 0 + P == 0 || W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm12, 32) + maccess = MemAccessPostIndexed(reg_N, imm32) + + } + + @asm ldrb reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/ldrb_A8869.d b/plugins/arm/v7/opdefs/ldrb_A8869.d index fb80049..37abb30 100644 --- a/plugins/arm/v7/opdefs/ldrb_A8869.d +++ b/plugins/arm/v7/opdefs/ldrb_A8869.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,18 +23,28 @@ @title LDRB (literal) -@desc Load Register Byte (literal) calculates an address from the PC value and an immediate offset, loads a byte from memory, zero-extends it to form a 32-bit word, and writes it to a register. For information about memory accesses see Memory accesses on page A8-294. +@id 68 + +@desc { + + Load Register Byte (literal) calculates an address from the PC value and an immediate offset, loads a byte from memory, zero-extends it to form a 32-bit word, and writes it to a register. For information about memory accesses see Memory accesses on page A8-294. + +} @encoding (T1) { @word 1 1 1 1 1 0 0 0 U(1) 0 0 1 1 1 1 1 Rt(4) imm12(12) - @syntax <reg_T> <imm32> + @syntax { + + @conv { - @conv { + reg_T = Register(Rt) + imm32 = ZeroExtend(imm12, 32) - reg_T = Register(Rt) - imm32 = ZeroExtend(imm12, 32) + } + + @asm ldrb reg_T imm32 } @@ -44,18 +54,22 @@ @word cond(4) 0 1 0 1 U(1) 1 0 1 1 1 1 1 Rt(4) imm12(12) - @syntax <reg_T> <imm32> + @syntax { - @conv { + @conv { - reg_T = Register(Rt) - imm32 = ZeroExtend(imm12, 32) + reg_T = Register(Rt) + imm32 = ZeroExtend(imm12, 32) - } + } + + @asm ldrb reg_T imm32 + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/ldrb_A8870.d b/plugins/arm/v7/opdefs/ldrb_A8870.d index 35f95ab..3324549 100644 --- a/plugins/arm/v7/opdefs/ldrb_A8870.d +++ b/plugins/arm/v7/opdefs/ldrb_A8870.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title LDRB (register) -@desc Load Register Byte (register) calculates an address from a base register value and an offset register value, loads a byte from memory, zero-extends it to form a 32-bit word, and writes it to a register. The offset register value can optionally be shifted. For information about memory accesses see Memory accesses on page A8-294. +@id 69 + +@desc { + + Load Register Byte (register) calculates an address from a base register value and an offset register value, loads a byte from memory, zero-extends it to form a 32-bit word, and writes it to a register. The offset register value can optionally be shifted. For information about memory accesses see Memory accesses on page A8-294. + +} @encoding (t1) { @half 0 1 0 1 1 1 0 Rm(3) Rn(3) Rt(3) - @syntax <reg_T> <mem_access> + @syntax { + + @conv { - @conv { + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + maccess = MemAccessOffset(reg_N, reg_M) - reg_T = Register(Rt) - reg_N = Register(Rn) - reg_M = Register(Rm) - mem_access = MakeMemoryAccess(reg_N, reg_M, NULL, true, true, false) + } + + @asm ldrb reg_T maccess } @@ -46,15 +56,19 @@ @word 1 1 1 1 1 0 0 0 0 0 0 1 Rn(4) Rt(4) 0 0 0 0 0 0 imm2(2) Rm(4) - @syntax ".W" <reg_T> <mem_access> + @syntax { + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = FixedShift(SRType_LSL, imm2) + maccess = MemAccessOffsetExtended(reg_N, reg_M, shift) - @conv { + } - reg_T = Register(Rt) - reg_N = Register(Rn) - reg_M = Register(Rm) - shift = DecodeImmShift(0, imm2) - mem_access = MakeMemoryAccess(reg_N, reg_M, shift, true, true, false) + @asm ldrb.w reg_T maccess } @@ -64,24 +78,90 @@ @word cond(4) 0 1 1 P(1) U(1) 1 W(1) 1 Rn(4) Rt(4) imm5(5) type(2) 0 Rm(4) - @syntax <reg_T> <mem_access> + @syntax { + + @assert { + + P == 1 + P == 1 && W == 0 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) + maccess = MemAccessOffsetExtended(reg_N, reg_M, shift) + + } + + @asm ldrb reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) + + } + + } + + @syntax { + + @assert { + + P == 1 + P == 0 || W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) + maccess = MemAccessPreIndexedExtended(reg_N, reg_M, shift) + + } + + @asm ldrb reg_T maccess + + @rules { - @conv { + check g_arm_instruction_set_cond(cond) - reg_T = Register(Rt) - reg_N = Register(Rn) - reg_M = Register(Rm) - index = (P == '1') - add = (U == '1') - wback = (P == '0') || (W == '1') - shift = DecodeImmShift(type, imm5) - mem_access = MakeMemoryAccess(reg_N, reg_M, shift, index, add, wback) + } } - @rules { + @syntax { + + @assert { + + P == 0 + P == 0 || W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) + maccess = MemAccessPostIndexedExtended(reg_N, reg_M, shift) + + } + + @asm ldrb reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/ldrbt_A8871.d b/plugins/arm/v7/opdefs/ldrbt_A8871.d index 0bf9c3c..f0d91fd 100644 --- a/plugins/arm/v7/opdefs/ldrbt_A8871.d +++ b/plugins/arm/v7/opdefs/ldrbt_A8871.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title LDRBT -@desc Load Register Byte Unprivileged loads a byte from memory, zero-extends it to form a 32-bit word, and writes it to a register. For information about memory accesses see Memory accesses on page A8-294. The memory access is restricted as if the processor were running in User mode. This makes no difference if the processor is actually running in User mode. LDRBT is UNPREDICTABLE in Hyp mode. The Thumb instruction uses an offset addressing mode, that calculates the address used for the memory access from a base register value and an immediate offset, and leaves the base register unchanged. The ARM instruction uses a post-indexed addressing mode, that uses a base register value as the address for the memory access, and calculates a new address from a base register value and an offset and writes it back to the base register. The offset can be an immediate value or an optionally-shifted register value. +@id 70 + +@desc { + + Load Register Byte Unprivileged loads a byte from memory, zero-extends it to form a 32-bit word, and writes it to a register. For information about memory accesses see Memory accesses on page A8-294. The memory access is restricted as if the processor were running in User mode. This makes no difference if the processor is actually running in User mode. LDRBT is UNPREDICTABLE in Hyp mode. The Thumb instruction uses an offset addressing mode, that calculates the address used for the memory access from a base register value and an immediate offset, and leaves the base register unchanged. The ARM instruction uses a post-indexed addressing mode, that uses a base register value as the address for the memory access, and calculates a new address from a base register value and an offset and writes it back to the base register. The offset can be an immediate value or an optionally-shifted register value. + +} @encoding (T1) { @word 1 1 1 1 1 0 0 0 0 0 0 1 Rn(4) Rt(4) 1 1 1 0 imm8(8) - @syntax <reg_T> <mem_access> + @syntax { + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8, 32) + maccess = MemAccessOffset(reg_N, imm32) - @conv { + } - reg_T = Register(Rt) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm8, 32) - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, true, true, false) + @asm ldrbt reg_T maccess } @@ -46,21 +56,24 @@ @word cond(4) 0 1 0 0 U(1) 1 1 1 Rn(4) Rt(4) imm12(12) - @syntax <reg_T> <mem_access> + @syntax { - @conv { + @conv { - reg_T = Register(Rt) - reg_N = Register(Rn) - add = (U == '1') - imm32 = ZeroExtend(imm12, 32) - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, false, add, false) + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm12, 32) + maccess = MemAccessPostIndexed(reg_N, imm32) - } + } + + @asm ldrbt reg_T maccess + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } @@ -70,22 +83,25 @@ @word cond(4) 0 1 1 0 U(1) 1 1 1 Rn(4) Rt(4) imm5(5) type(2) 0 Rm(4) - @syntax <reg_T> <mem_access> + @syntax { - @conv { + @conv { - reg_T = Register(Rt) - reg_N = Register(Rn) - reg_M = Register(Rm) - add = (U == '1') - shift = DecodeImmShift(type, imm5) - mem_access = MakeMemoryAccess(reg_N, reg_M, shift, false, add, false) + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) + maccess = MemAccessPostIndexedExtended(reg_N, reg_M, shift) - } + } + + @asm ldrbt reg_T maccess + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/ldrd_A8872.d b/plugins/arm/v7/opdefs/ldrd_A8872.d index c73fdca..2b95b6d 100644 --- a/plugins/arm/v7/opdefs/ldrd_A8872.d +++ b/plugins/arm/v7/opdefs/ldrd_A8872.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,24 +23,84 @@ @title LDRD (immediate) -@desc Load Register Dual (immediate) calculates an address from a base register value and an immediate offset, loads two words from memory, and writes them to two registers. It can use offset, post-indexed, or pre-indexed addressing. For information about memory accesses see Memory accesses on page A8-294. +@id 71 + +@desc { + + Load Register Dual (immediate) calculates an address from a base register value and an immediate offset, loads two words from memory, and writes them to two registers. It can use offset, post-indexed, or pre-indexed addressing. For information about memory accesses see Memory accesses on page A8-294. + +} @encoding (T1) { @word 1 1 1 0 1 0 0 P(1) U(1) 1 W(1) 1 Rn(4) Rt(4) Rt2(4) imm8(8) - @syntax <reg_T> <reg_T2> <mem_access> + @syntax { + + @assert { + + P == 1 + W == 0 + + } + + @conv { + + reg_T = Register(Rt) + reg_T2 = Register(Rt2) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8:'00', 32) + maccess = MemAccessOffset(reg_N, imm32) + + } + + @asm ldrd reg_T reg_T2 maccess + + } + + @syntax { + + @assert { - @conv { + P == 1 + W == 1 - reg_T = Register(Rt) - reg_T2 = Register(Rt2) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm8:'00', 32) - index = (P == '1') - add = (U == '1') - wback = (W == '1') - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, index, add, wback) + } + + @conv { + + reg_T = Register(Rt) + reg_T2 = Register(Rt2) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8:'00', 32) + maccess = MemAccessPreIndexed(reg_N, imm32) + + } + + @asm ldrd reg_T reg_T2 maccess + + } + + @syntax { + + @assert { + + P == 0 + W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_T2 = Register(Rt2) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8:'00', 32) + maccess = MemAccessPostIndexed(reg_N, imm32) + + } + + @asm ldrd reg_T reg_T2 maccess } @@ -50,24 +110,90 @@ @word cond(4) 0 0 0 P(1) U(1) 1 W(1) 0 Rn(4) Rt(4) imm4H(4) 1 1 0 1 imm4L(4) - @syntax <reg_T> <reg_T2> <mem_access> + @syntax { + + @assert { - @conv { + P == 1 + P == 1 && W == 0 - reg_T = Register(Rt) - reg_T2 = NextRegister(reg_T) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm4H:imm4L, 32) - index = (P == '1') - add = (U == '1') - wback = (P == '0') || (W == '1') - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, index, add, wback) + } + + @conv { + + reg_T = Register(Rt) + reg_T2 = NextRegister(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm4H:imm4L, 32) + maccess = MemAccessOffset(reg_N, imm32) + + } + + @asm ldrd reg_T reg_T2 maccess + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + P == 1 + P == 0 || W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_T2 = NextRegister(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm4H:imm4L, 32) + maccess = MemAccessPreIndexed(reg_N, imm32) + + } + + @asm ldrd reg_T reg_T2 maccess + + @rules { + + check g_arm_instruction_set_cond(cond) + + } + + } + + @syntax { + + @assert { + + P == 0 + P == 0 || W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_T2 = NextRegister(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm4H:imm4L, 32) + maccess = MemAccessPostIndexed(reg_N, imm32) + + } + + @asm ldrd reg_T reg_T2 maccess + + @rules { + + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/ldrd_A8873.d b/plugins/arm/v7/opdefs/ldrd_A8873.d index 828e4a3..fd64c78 100644 --- a/plugins/arm/v7/opdefs/ldrd_A8873.d +++ b/plugins/arm/v7/opdefs/ldrd_A8873.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title LDRD (literal) -@desc Load Register Dual (literal) calculates an address from the PC value and an immediate offset, loads two words from memory, and writes them to two registers. For information about memory accesses see Memory accesses on page A8-294. +@id 72 + +@desc { + + Load Register Dual (literal) calculates an address from the PC value and an immediate offset, loads two words from memory, and writes them to two registers. For information about memory accesses see Memory accesses on page A8-294. + +} @encoding (T1) { @word 1 1 1 0 1 0 0 P(1) U(1) 1 W(1) 1 1 1 1 1 Rt(4) Rt2(4) imm8(8) - @syntax <reg_T> <reg_T2> <imm32> + @syntax { + + @conv { - @conv { + reg_T = Register(Rt) + reg_T2 = Register(Rt2) + imm32 = ZeroExtend(imm8:'00', 32) - reg_T = Register(Rt) - reg_T2 = Register(Rt2) - imm32 = ZeroExtend(imm8:'00', 32) + } + + @asm ldrd reg_T reg_T2 imm32 } @@ -45,19 +55,23 @@ @word cond(4) 0 0 0 1 U(1) 1 0 0 1 1 1 1 Rt(4) imm4H(4) 1 1 0 1 imm4L(4) - @syntax <reg_T> <reg_T2> <imm32> + @syntax { - @conv { + @conv { - reg_T = Register(Rt) - reg_T2 = NextRegister(reg_T) - imm32 = ZeroExtend(imm4H:imm4L, 32) + reg_T = Register(Rt) + reg_T2 = NextRegister(Rt) + imm32 = ZeroExtend(imm4H:imm4L, 32) - } + } + + @asm ldrd reg_T reg_T2 imm32 + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/ldrd_A8874.d b/plugins/arm/v7/opdefs/ldrd_A8874.d index ed055a6..abf8143 100644 --- a/plugins/arm/v7/opdefs/ldrd_A8874.d +++ b/plugins/arm/v7/opdefs/ldrd_A8874.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,30 +23,102 @@ @title LDRD (register) -@desc Load Register Dual (register) calculates an address from a base register value and a register offset, loads two words from memory, and writes them to two registers. It can use offset, post-indexed, or pre-indexed addressing. For information about memory accesses see Memory accesses on page A8-294. +@id 73 + +@desc { + + Load Register Dual (register) calculates an address from a base register value and a register offset, loads two words from memory, and writes them to two registers. It can use offset, post-indexed, or pre-indexed addressing. For information about memory accesses see Memory accesses on page A8-294. + +} @encoding (A1) { @word cond(4) 0 0 0 P(1) U(1) 0 W(1) 0 Rn(4) Rt(4) 0 0 0 0 1 1 0 1 Rm(4) - @syntax <reg_T> <reg_T2> <mem_access> + @syntax { + + @assert { + + P == 1 + P == 1 && W == 0 + + } + + @conv { + + reg_T = Register(Rt) + reg_T2 = NextRegister(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + maccess = MemAccessOffset(reg_N, reg_M) + + } + + @asm ldrd reg_T reg_T2 maccess + + @rules { + + check g_arm_instruction_set_cond(cond) + + } + + } + + @syntax { - @conv { + @assert { - reg_T = Register(Rt) - reg_T2 = NextRegister(reg_T) - reg_N = Register(Rn) - reg_M = Register(Rm) - index = (P == '1') - add = (U == '1') - wback = (P == '0') || (W == '1') - mem_access = MakeMemoryAccess(reg_N, reg_M, NULL, index, add, wback) + P == 1 + P == 0 || W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_T2 = NextRegister(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + maccess = MemAccessPreIndexed(reg_N, reg_M) + + } + + @asm ldrd reg_T reg_T2 maccess + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + P == 0 + P == 0 || W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_T2 = NextRegister(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + maccess = MemAccessPostIndexed(reg_N, reg_M) + + } + + @asm ldrd reg_T reg_T2 maccess + + @rules { + + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/ldrex_A8875.d b/plugins/arm/v7/opdefs/ldrex_A8875.d index b915061..b30ae86 100644 --- a/plugins/arm/v7/opdefs/ldrex_A8875.d +++ b/plugins/arm/v7/opdefs/ldrex_A8875.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title LDREX -@desc Load Register Exclusive calculates an address from a base register value and an immediate offset, loads a word from memory, writes it to a register and: • if the address has the Shared Memory attribute, marks the physical address as exclusive access for the executing processor in a global monitor • causes the executing processor to indicate an active exclusive access in the local monitor. For more information about support for shared memory see Synchronization and semaphores on page A3-114. For information about memory accesses see Memory accesses on page A8-294. +@id 74 + +@desc { + + Load Register Exclusive calculates an address from a base register value and an immediate offset, loads a word from memory, writes it to a register and: • if the address has the Shared Memory attribute, marks the physical address as exclusive access for the executing processor in a global monitor • causes the executing processor to indicate an active exclusive access in the local monitor. For more information about support for shared memory see Synchronization and semaphores on page A3-114. For information about memory accesses see Memory accesses on page A8-294. + +} @encoding (T1) { @word 1 1 1 0 1 0 0 0 0 1 0 1 Rn(4) Rt(4) 1 1 1 1 imm8(8) - @syntax <reg_T> <mem_access> + @syntax { + + @conv { - @conv { + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8:'00', 32) + maccess = MemAccessOffset(reg_N, imm32) - reg_T = Register(Rt) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm8:'00', 32) - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, true, false, false) + } + + @asm ldrex reg_T maccess } @@ -46,19 +56,24 @@ @word cond(4) 0 0 0 1 1 0 0 1 Rn(4) Rt(4) 1 1 1 1 1 0 0 1 1 1 1 1 - @syntax <reg_T> <mem_access> + @syntax { - @conv { + @conv { - reg_T = Register(Rt) - reg_N = Register(Rn) - mem_access = MakeMemoryAccess(reg_N, NULL, NULL, true, false, false) + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = Zeros(32) + maccess = MemAccessOffset(reg_N, imm32) - } + } + + @asm ldrex reg_T maccess + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/ldrexb_A8876.d b/plugins/arm/v7/opdefs/ldrexb_A8876.d index e398ef2..8827994 100644 --- a/plugins/arm/v7/opdefs/ldrexb_A8876.d +++ b/plugins/arm/v7/opdefs/ldrexb_A8876.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title LDREXB -@desc Load Register Exclusive Byte derives an address from a base register value, loads a byte from memory, zero-extends it to form a 32-bit word, writes it to a register and: • if the address has the Shared Memory attribute, marks the physical address as exclusive access for the executing processor in a global monitor • causes the executing processor to indicate an active exclusive access in the local monitor. For more information about support for shared memory see Synchronization and semaphores on page A3-114. For information about memory accesses see Memory accesses on page A8-294. +@id 75 + +@desc { + + Load Register Exclusive Byte derives an address from a base register value, loads a byte from memory, zero-extends it to form a 32-bit word, writes it to a register and: • if the address has the Shared Memory attribute, marks the physical address as exclusive access for the executing processor in a global monitor • causes the executing processor to indicate an active exclusive access in the local monitor. For more information about support for shared memory see Synchronization and semaphores on page A3-114. For information about memory accesses see Memory accesses on page A8-294. + +} @encoding (T1) { @word 1 1 1 0 1 0 0 0 1 1 0 1 Rn(4) Rt(4) 1 1 1 1 0 1 0 0 1 1 1 1 - @syntax <reg_T> <mem_access> + @syntax { + + @conv { - @conv { + reg_T = Register(Rt) + reg_N = Register(Rn) + maccess = MemAccessOffset(reg_N, NULL) - reg_T = Register(Rt) - reg_N = Register(Rn) - mem_access = MakeMemoryAccess(reg_N, NULL, NULL, true, false, false) + } + + @asm ldrexb reg_T maccess } @@ -45,19 +55,23 @@ @word cond(4) 0 0 0 1 1 1 0 1 Rn(4) Rt(4) 1 1 1 1 1 0 0 1 1 1 1 1 - @syntax <reg_T> <mem_access> + @syntax { - @conv { + @conv { - reg_T = Register(Rt) - reg_N = Register(Rn) - mem_access = MakeMemoryAccess(reg_N, NULL, NULL, true, false, false) + reg_T = Register(Rt) + reg_N = Register(Rn) + maccess = MemAccessOffset(reg_N, NULL) - } + } + + @asm ldrexb reg_T maccess + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/ldrexd_A8877.d b/plugins/arm/v7/opdefs/ldrexd_A8877.d index 0188cb7..16f6ea6 100644 --- a/plugins/arm/v7/opdefs/ldrexd_A8877.d +++ b/plugins/arm/v7/opdefs/ldrexd_A8877.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title LDREXD -@desc Load Register Exclusive Doubleword derives an address from a base register value, loads a 64-bit doubleword from memory, writes it to two registers and: • if the address has the Shared Memory attribute, marks the physical address as exclusive access for the executing processor in a global monitor • causes the executing processor to indicate an active exclusive access in the local monitor. For more information about support for shared memory see Synchronization and semaphores on page A3-114. For information about memory accesses see Memory accesses on page A8-294. +@id 76 + +@desc { + + Load Register Exclusive Doubleword derives an address from a base register value, loads a 64-bit doubleword from memory, writes it to two registers and: • if the address has the Shared Memory attribute, marks the physical address as exclusive access for the executing processor in a global monitor • causes the executing processor to indicate an active exclusive access in the local monitor. For more information about support for shared memory see Synchronization and semaphores on page A3-114. For information about memory accesses see Memory accesses on page A8-294. + +} @encoding (T1) { @word 1 1 1 0 1 0 0 0 1 1 0 1 Rn(4) Rt(4) Rt2(4) 0 1 1 1 1 1 1 1 - @syntax <reg_T> <reg_T2> <mem_access> + @syntax { + + @conv { - @conv { + reg_T = Register(Rt) + reg_T2 = Register(Rt2) + reg_N = Register(Rn) + maccess = MemAccessOffset(reg_N, NULL) - reg_T = Register(Rt) - reg_T2 = Register(Rt2) - reg_N = Register(Rn) - mem_access = MakeMemoryAccess(reg_N, NULL, NULL, true, false, false) + } + + @asm ldrexd reg_T reg_T2 maccess } @@ -46,20 +56,24 @@ @word cond(4) 0 0 0 1 1 0 1 1 Rn(4) Rt(4) 1 1 1 1 1 0 0 1 1 1 1 1 - @syntax <reg_T> <reg_T2> <mem_access> + @syntax { - @conv { + @conv { - reg_T = Register(Rt) - reg_T2 = NextRegister(reg_T) - reg_N = Register(Rn) - mem_access = MakeMemoryAccess(reg_N, NULL, NULL, true, false, false) + reg_T = Register(Rt) + reg_T2 = NextRegister(Rt) + reg_N = Register(Rn) + maccess = MemAccessOffset(reg_N, NULL) - } + } + + @asm ldrexd reg_T reg_T2 maccess + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/ldrexh_A8878.d b/plugins/arm/v7/opdefs/ldrexh_A8878.d index 8e9366f..637a6c9 100644 --- a/plugins/arm/v7/opdefs/ldrexh_A8878.d +++ b/plugins/arm/v7/opdefs/ldrexh_A8878.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title LDREXH -@desc Load Register Exclusive Halfword derives an address from a base register value, loads a halfword from memory, zero-extends it to form a 32-bit word, writes it to a register and: • if the address has the Shared Memory attribute, marks the physical address as exclusive access for the executing processor in a global monitor • causes the executing processor to indicate an active exclusive access in the local monitor. For more information about support for shared memory see Synchronization and semaphores on page A3-114. For information about memory accesses see Memory accesses on page A8-294. +@id 77 + +@desc { + + Load Register Exclusive Halfword derives an address from a base register value, loads a halfword from memory, zero-extends it to form a 32-bit word, writes it to a register and: • if the address has the Shared Memory attribute, marks the physical address as exclusive access for the executing processor in a global monitor • causes the executing processor to indicate an active exclusive access in the local monitor. For more information about support for shared memory see Synchronization and semaphores on page A3-114. For information about memory accesses see Memory accesses on page A8-294. + +} @encoding (T1) { @word 1 1 1 0 1 0 0 0 1 1 0 1 Rn(4) Rt(4) 1 1 1 1 0 1 0 1 1 1 1 1 - @syntax <reg_T> <mem_access> + @syntax { + + @conv { - @conv { + reg_T = Register(Rt) + reg_N = Register(Rn) + maccess = MemAccessOffset(reg_N, NULL) - reg_T = Register(Rt) - reg_N = Register(Rn) - mem_access = MakeMemoryAccess(reg_N, NULL, NULL, true, false, false) + } + + @asm ldrexh reg_T maccess } @@ -45,19 +55,23 @@ @word cond(4) 0 0 0 1 1 1 1 1 Rn(4) Rt(4) 1 1 1 1 1 0 0 1 1 1 1 1 - @syntax <reg_T> <mem_access> + @syntax { - @conv { + @conv { - reg_T = Register(Rt) - reg_N = Register(Rn) - mem_access = MakeMemoryAccess(reg_N, NULL, NULL, true, false, false) + reg_T = Register(Rt) + reg_N = Register(Rn) + maccess = MemAccessOffset(reg_N, NULL) - } + } + + @asm ldrexh reg_T maccess + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/ldrh_A8879.d b/plugins/arm/v7/opdefs/ldrh_A8879.d index 3b57bf8..4c21348 100644 --- a/plugins/arm/v7/opdefs/ldrh_A8879.d +++ b/plugins/arm/v7/opdefs/ldrh_A8879.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title LDRH (immediate, Thumb) -@desc Load Register Halfword (immediate) calculates an address from a base register value and an immediate offset, loads a halfword from memory, zero-extends it to form a 32-bit word, and writes it to a register. It can use offset, post-indexed, or pre-indexed addressing. For information about memory accesses see Memory accesses on page A8-294. +@id 78 + +@desc { + + Load Register Halfword (immediate) calculates an address from a base register value and an immediate offset, loads a halfword from memory, zero-extends it to form a 32-bit word, and writes it to a register. It can use offset, post-indexed, or pre-indexed addressing. For information about memory accesses see Memory accesses on page A8-294. + +} @encoding (t1) { @half 1 0 0 0 1 imm5(5) Rn(3) Rt(3) - @syntax <reg_T> <mem_access> + @syntax { + + @conv { - @conv { + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm5:'0', 32) + maccess = MemAccessOffset(reg_N, imm32) - reg_T = Register(Rt) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm5:'0', 32) - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, true, true, false) + } + + @asm ldrh reg_T maccess } @@ -46,14 +56,18 @@ @word 1 1 1 1 1 0 0 0 1 0 1 1 Rn(4) Rt(4) imm12(12) - @syntax ".W" <reg_T> <mem_access> + @syntax { + + @conv { - @conv { + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm12, 32) + maccess = MemAccessOffset(reg_N, imm32) - reg_T = Register(Rt) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm12, 32) - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, true, true, false) + } + + @asm ldrh.w reg_T maccess } @@ -63,17 +77,69 @@ @word 1 1 1 1 1 0 0 0 0 0 1 1 Rn(4) Rt(4) 1 P(1) U(1) W(1) imm8(8) - @syntax <reg_T> <mem_access> + @syntax { + + @assert { + + P == 1 + W == 0 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8, 32) + maccess = MemAccessOffset(reg_N, imm32) + + } + + @asm ldrh reg_T maccess + + } + + @syntax { + + @assert { + + P == 1 + W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8, 32) + maccess = MemAccessPreIndexed(reg_N, imm32) + + } + + @asm ldrh reg_T maccess + + } + + @syntax { + + @assert { + + P == 0 + W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8, 32) + maccess = MemAccessPostIndexed(reg_N, imm32) - @conv { + } - reg_T = Register(Rt) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm8, 32) - index = (P == '1') - add = (U == '1') - wback = (W == '1') - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, index, add, wback) + @asm ldrh reg_T maccess } diff --git a/plugins/arm/v7/opdefs/ldrh_A8880.d b/plugins/arm/v7/opdefs/ldrh_A8880.d index f5f7ab0..17c2bee 100644 --- a/plugins/arm/v7/opdefs/ldrh_A8880.d +++ b/plugins/arm/v7/opdefs/ldrh_A8880.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,29 +23,99 @@ @title LDRH (immediate, ARM) -@desc Load Register Halfword (immediate) calculates an address from a base register value and an immediate offset, loads a halfword from memory, zero-extends it to form a 32-bit word, and writes it to a register. It can use offset, post-indexed, or pre-indexed addressing. For information about memory accesses see Memory accesses on page A8-294. +@id 79 + +@desc { + + Load Register Halfword (immediate) calculates an address from a base register value and an immediate offset, loads a halfword from memory, zero-extends it to form a 32-bit word, and writes it to a register. It can use offset, post-indexed, or pre-indexed addressing. For information about memory accesses see Memory accesses on page A8-294. + +} @encoding (A1) { @word cond(4) 0 0 0 P(1) U(1) 1 W(1) 1 Rn(4) Rt(4) imm4H(4) 1 0 1 1 imm4L(4) - @syntax <reg_T> <mem_access> + @syntax { + + @assert { + + P == 1 + P == 1 && W == 0 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm4H:imm4L, 32) + maccess = MemAccessOffset(reg_N, imm32) + + } + + @asm ldrh reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) + + } + + } + + @syntax { - @conv { + @assert { - reg_T = Register(Rt) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm4H:imm4L, 32) - index = (P == '1') - add = (U == '1') - wback = (P == '0') || (W == '1') - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, index, add, wback) + P == 1 + P == 0 || W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm4H:imm4L, 32) + maccess = MemAccessPreIndexed(reg_N, imm32) + + } + + @asm ldrh reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + P == 0 + P == 0 || W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm4H:imm4L, 32) + maccess = MemAccessPostIndexed(reg_N, imm32) + + } + + @asm ldrh reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/ldrh_A8881.d b/plugins/arm/v7/opdefs/ldrh_A8881.d index 59005e4..3828d51 100644 --- a/plugins/arm/v7/opdefs/ldrh_A8881.d +++ b/plugins/arm/v7/opdefs/ldrh_A8881.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,18 +23,28 @@ @title LDRH (literal) -@desc Load Register Halfword (literal) calculates an address from the PC value and an immediate offset, loads a halfword from memory, zero-extends it to form a 32-bit word, and writes it to a register. For information about memory accesses see Memory accesses on page A8-294. +@id 80 + +@desc { + + Load Register Halfword (literal) calculates an address from the PC value and an immediate offset, loads a halfword from memory, zero-extends it to form a 32-bit word, and writes it to a register. For information about memory accesses see Memory accesses on page A8-294. + +} @encoding (T1) { @word 1 1 1 1 1 0 0 0 U(1) 0 1 1 1 1 1 1 Rt(4) imm12(12) - @syntax <reg_T> <imm32> + @syntax { + + @conv { - @conv { + reg_T = Register(Rt) + imm32 = ZeroExtend(imm12, 32) - reg_T = Register(Rt) - imm32 = ZeroExtend(imm12, 32) + } + + @asm ldrh reg_T imm32 } @@ -44,18 +54,22 @@ @word cond(4) 0 0 0 P(1) U(1) 1 W(1) 1 1 1 1 1 Rt(4) imm4H(4) 1 0 1 1 imm4L(4) - @syntax <reg_T> <imm32> + @syntax { - @conv { + @conv { - reg_T = Register(Rt) - imm32 = ZeroExtend(imm4H:imm4L, 32) + reg_T = Register(Rt) + imm32 = ZeroExtend(imm4H:imm4L, 32) - } + } + + @asm ldrh reg_T imm32 + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/ldrh_A8882.d b/plugins/arm/v7/opdefs/ldrh_A8882.d index 823bf24..3994a53 100644 --- a/plugins/arm/v7/opdefs/ldrh_A8882.d +++ b/plugins/arm/v7/opdefs/ldrh_A8882.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title LDRH (register) -@desc Load Register Halfword (register) calculates an address from a base register value and an offset register value, loads a halfword from memory, zero-extends it to form a 32-bit word, and writes it to a register. The offset register value can be shifted left by 0, 1, 2, or 3 bits. For information about memory accesses see Memory accesses on page A8-294. +@id 81 + +@desc { + + Load Register Halfword (register) calculates an address from a base register value and an offset register value, loads a halfword from memory, zero-extends it to form a 32-bit word, and writes it to a register. The offset register value can be shifted left by 0, 1, 2, or 3 bits. For information about memory accesses see Memory accesses on page A8-294. + +} @encoding (t1) { @half 0 1 0 1 1 0 1 Rm(3) Rn(3) Rt(3) - @syntax <reg_T> <mem_access> + @syntax { + + @conv { - @conv { + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + maccess = MemAccessOffset(reg_N, reg_M) - reg_T = Register(Rt) - reg_N = Register(Rn) - reg_M = Register(Rm) - mem_access = MakeMemoryAccess(reg_N, reg_M, NULL, true, true, false) + } + + @asm ldrh reg_T maccess } @@ -46,15 +56,19 @@ @word 1 1 1 1 1 0 0 0 0 0 1 1 Rn(4) Rt(4) 0 0 0 0 0 0 imm2(2) Rm(4) - @syntax ".W" <reg_T> <mem_access> + @syntax { + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = FixedShift(SRType_LSL, imm2) + maccess = MemAccessOffsetExtended(reg_N, reg_M, shift) - @conv { + } - reg_T = Register(Rt) - reg_N = Register(Rn) - reg_M = Register(Rm) - shift = DecodeImmShift(0, imm2) - mem_access = MakeMemoryAccess(reg_N, reg_M, shift, true, true, false) + @asm ldrh.w reg_T maccess } @@ -64,23 +78,87 @@ @word cond(4) 0 0 0 P(1) U(1) 0 W(1) 1 Rn(4) Rt(4) 0 0 0 0 1 0 1 1 Rm(4) - @syntax <reg_T> <mem_access> + @syntax { + + @assert { + + P == 1 + P == 1 && W == 0 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + maccess = MemAccessOffset(reg_N, reg_M) + + } + + @asm ldrh reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) + + } + + } + + @syntax { + + @assert { + + P == 1 + P == 0 || W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + maccess = MemAccessPreIndexed(reg_N, reg_M) + + } + + @asm ldrh reg_T maccess + + @rules { - @conv { + check g_arm_instruction_set_cond(cond) - reg_T = Register(Rt) - reg_N = Register(Rn) - reg_M = Register(Rm) - index = (P == '1') - add = (U == '1') - wback = (P == '0') || (W == '1') - mem_access = MakeMemoryAccess(reg_N, reg_M, NULL, index, add, wback) + } } - @rules { + @syntax { + + @assert { + + P == 0 + P == 0 || W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + maccess = MemAccessPostIndexed(reg_N, reg_M) + + } + + @asm ldrh reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/ldrht_A8883.d b/plugins/arm/v7/opdefs/ldrht_A8883.d index 8f8f015..d096d4e 100644 --- a/plugins/arm/v7/opdefs/ldrht_A8883.d +++ b/plugins/arm/v7/opdefs/ldrht_A8883.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title LDRHT -@desc Load Register Halfword Unprivileged loads a halfword from memory, zero-extends it to form a 32-bit word, and writes it to a register. For information about memory accesses see Memory accesses on page A8-294. The memory access is restricted as if the processor were running in User mode. This makes no difference if the processor is actually running in User mode. LDRHT is UNPREDICTABLE in Hyp mode. The Thumb instruction uses an offset addressing mode, that calculates the address used for the memory access from a base register value and an immediate offset, and leaves the base register unchanged. The ARM instruction uses a post-indexed addressing mode, that uses a base register value as the address for the memory access, and calculates a new address from a base register value and an offset and writes it back to the base register. The offset can be an immediate value or a register value. +@id 82 + +@desc { + + Load Register Halfword Unprivileged loads a halfword from memory, zero-extends it to form a 32-bit word, and writes it to a register. For information about memory accesses see Memory accesses on page A8-294. The memory access is restricted as if the processor were running in User mode. This makes no difference if the processor is actually running in User mode. LDRHT is UNPREDICTABLE in Hyp mode. The Thumb instruction uses an offset addressing mode, that calculates the address used for the memory access from a base register value and an immediate offset, and leaves the base register unchanged. The ARM instruction uses a post-indexed addressing mode, that uses a base register value as the address for the memory access, and calculates a new address from a base register value and an offset and writes it back to the base register. The offset can be an immediate value or a register value. + +} @encoding (T1) { @word 1 1 1 1 1 0 0 0 0 0 1 1 Rn(4) Rt(4) 1 1 1 0 imm8(8) - @syntax <reg_T> <mem_access> + @syntax { + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8, 32) + maccess = MemAccessOffset(reg_N, imm32) - @conv { + } - reg_T = Register(Rt) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm8, 32) - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, true, true, false) + @asm ldrht reg_T maccess } @@ -46,21 +56,24 @@ @word cond(4) 0 0 0 0 U(1) 1 1 1 Rn(4) Rt(4) imm4H(4) 1 0 1 1 imm4L(4) - @syntax <reg_T> <mem_access> + @syntax { - @conv { + @conv { - reg_T = Register(Rt) - reg_N = Register(Rn) - add = (U == '1') - imm32 = ZeroExtend(imm4H:imm4L, 32) - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, false, add, false) + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm4H:imm4L, 32) + maccess = MemAccessPostIndexed(reg_N, imm32) - } + } + + @asm ldrht reg_T maccess + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } @@ -70,21 +83,24 @@ @word cond(4) 0 0 0 0 U(1) 0 1 1 Rn(4) Rt(4) 0 0 0 0 1 0 1 1 Rm(4) - @syntax <reg_T> <mem_access> + @syntax { - @conv { + @conv { - reg_T = Register(Rt) - reg_N = Register(Rn) - reg_M = Register(Rm) - add = (U == '1') - mem_access = MakeMemoryAccess(reg_N, reg_M, NULL, false, add, false) + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + maccess = MemAccessPostIndexed(reg_N, reg_M) - } + } + + @asm ldrht reg_T maccess + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/ldrsb_A8884.d b/plugins/arm/v7/opdefs/ldrsb_A8884.d index fc41134..05a0372 100644 --- a/plugins/arm/v7/opdefs/ldrsb_A8884.d +++ b/plugins/arm/v7/opdefs/ldrsb_A8884.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title LDRSB (immediate) -@desc Load Register Signed Byte (immediate) calculates an address from a base register value and an immediate offset, loads a byte from memory, sign-extends it to form a 32-bit word, and writes it to a register. It can use offset, post-indexed, or pre-indexed addressing. For information about memory accesses see Memory accesses on page A8-294. +@id 83 + +@desc { + + Load Register Signed Byte (immediate) calculates an address from a base register value and an immediate offset, loads a byte from memory, sign-extends it to form a 32-bit word, and writes it to a register. It can use offset, post-indexed, or pre-indexed addressing. For information about memory accesses see Memory accesses on page A8-294. + +} @encoding (T1) { @word 1 1 1 1 1 0 0 1 1 0 0 1 Rn(4) Rt(4) imm12(12) - @syntax <reg_T> <mem_access> + @syntax { - @conv { + @conv { - reg_T = Register(Rt) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm12, 32) - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, true, true, false) + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm12, 32) + maccess = MemAccessOffset(reg_N, imm32) + + } + + @asm ldrsb reg_T maccess } @@ -46,17 +56,69 @@ @word 1 1 1 1 1 0 0 1 0 0 0 1 Rn(4) Rt(4) 1 P(1) U(1) W(1) imm8(8) - @syntax <reg_T> <mem_access> + @syntax { + + @assert { + + P == 1 + W == 0 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8, 32) + maccess = MemAccessOffset(reg_N, imm32) + + } + + @asm ldrsb reg_T maccess + + } + + @syntax { + + @assert { + + P == 1 + W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8, 32) + maccess = MemAccessPreIndexed(reg_N, imm32) + + } + + @asm ldrsb reg_T maccess + + } + + @syntax { + + @assert { + + P == 0 + W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8, 32) + maccess = MemAccessPostIndexed(reg_N, imm32) - @conv { + } - reg_T = Register(Rt) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm8, 32) - index = (P == '1') - add = (U == '1') - wback = (W == '1') - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, index, add, wback) + @asm ldrsb reg_T maccess } @@ -66,23 +128,87 @@ @word cond(4) 0 0 0 P(1) U(1) 1 W(1) 1 Rn(4) Rt(4) imm4H(4) 1 1 0 1 imm4L(4) - @syntax <reg_T> <mem_access> + @syntax { - @conv { + @assert { - reg_T = Register(Rt) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm4H:imm4L, 32) - index = (P == '1') - add = (U == '1') - wback = (P == '0') || (W == '1') - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, index, add, wback) + P == 1 + P == 1 && W == 0 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm4H:imm4L, 32) + maccess = MemAccessOffset(reg_N, imm32) + + } + + @asm ldrsb reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) + + } + + } + + @syntax { + + @assert { + + P == 1 + P == 0 || W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm4H:imm4L, 32) + maccess = MemAccessPreIndexed(reg_N, imm32) + + } + + @asm ldrsb reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + P == 0 + P == 0 || W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm4H:imm4L, 32) + maccess = MemAccessPostIndexed(reg_N, imm32) + + } + + @asm ldrsb reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/ldrsb_A8885.d b/plugins/arm/v7/opdefs/ldrsb_A8885.d index 6cb1d34..46c7b35 100644 --- a/plugins/arm/v7/opdefs/ldrsb_A8885.d +++ b/plugins/arm/v7/opdefs/ldrsb_A8885.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,18 +23,28 @@ @title LDRSB (literal) -@desc Load Register Signed Byte (literal) calculates an address from the PC value and an immediate offset, loads a byte from memory, sign-extends it to form a 32-bit word, and writes it to a register. For information about memory accesses see Memory accesses on page A8-294. +@id 84 + +@desc { + + Load Register Signed Byte (literal) calculates an address from the PC value and an immediate offset, loads a byte from memory, sign-extends it to form a 32-bit word, and writes it to a register. For information about memory accesses see Memory accesses on page A8-294. + +} @encoding (T1) { @word 1 1 1 1 1 0 0 1 U(1) 0 0 1 1 1 1 1 Rt(4) imm12(12) - @syntax <reg_T> <imm32> + @syntax { + + @conv { - @conv { + reg_T = Register(Rt) + imm32 = ZeroExtend(imm12, 32) - reg_T = Register(Rt) - imm32 = ZeroExtend(imm12, 32) + } + + @asm ldrsb reg_T imm32 } @@ -44,18 +54,22 @@ @word cond(4) 0 0 0 1 U(1) 1 0 1 1 1 1 1 Rt(4) imm4H(4) 1 1 0 1 imm4L(4) - @syntax <reg_T> <imm32> + @syntax { - @conv { + @conv { - reg_T = Register(Rt) - imm32 = ZeroExtend(imm4H:imm4L, 32) + reg_T = Register(Rt) + imm32 = ZeroExtend(imm4H:imm4L, 32) - } + } + + @asm ldrsb reg_T imm32 + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/ldrsb_A8886.d b/plugins/arm/v7/opdefs/ldrsb_A8886.d index 4a66278..e7da94f 100644 --- a/plugins/arm/v7/opdefs/ldrsb_A8886.d +++ b/plugins/arm/v7/opdefs/ldrsb_A8886.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title LDRSB (register) -@desc Load Register Signed Byte (register) calculates an address from a base register value and an offset register value, loads a byte from memory, sign-extends it to form a 32-bit word, and writes it to a register. The offset register value can be shifted left by 0, 1, 2, or 3 bits. For information about memory accesses see Memory accesses on page A8-294. +@id 85 + +@desc { + + Load Register Signed Byte (register) calculates an address from a base register value and an offset register value, loads a byte from memory, sign-extends it to form a 32-bit word, and writes it to a register. The offset register value can be shifted left by 0, 1, 2, or 3 bits. For information about memory accesses see Memory accesses on page A8-294. + +} @encoding (t1) { @half 0 1 0 1 0 1 1 Rm(3) Rn(3) Rt(3) - @syntax <reg_T> <mem_access> + @syntax { + + @conv { - @conv { + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + maccess = MemAccessOffset(reg_N, reg_M) - reg_T = Register(Rt) - reg_N = Register(Rn) - reg_M = Register(Rm) - mem_access = MakeMemoryAccess(reg_N, reg_M, NULL, true, true, false) + } + + @asm ldrsb reg_T maccess } @@ -46,15 +56,19 @@ @word 1 1 1 1 1 0 0 1 0 0 0 1 Rn(4) Rt(4) 0 0 0 0 0 0 imm2(2) Rm(4) - @syntax ".W" <reg_T> <mem_access> + @syntax { + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = FixedShift(SRType_LSL, imm2) + maccess = MemAccessOffsetExtended(reg_N, reg_M, shift) - @conv { + } - reg_T = Register(Rt) - reg_N = Register(Rn) - reg_M = Register(Rm) - shift = DecodeImmShift(0, imm2) - mem_access = MakeMemoryAccess(reg_N, reg_M, shift, true, true, false) + @asm ldrsb.w reg_T maccess } @@ -64,23 +78,87 @@ @word cond(4) 0 0 0 P(1) U(1) 0 W(1) 1 Rn(4) Rt(4) 0 0 0 0 1 1 0 1 Rm(4) - @syntax <reg_T> <mem_access> + @syntax { + + @assert { + + P == 1 + P == 1 && W == 0 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + maccess = MemAccessOffset(reg_N, reg_M) + + } + + @asm ldrsb reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) + + } + + } + + @syntax { + + @assert { + + P == 1 + P == 0 || W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + maccess = MemAccessPreIndexed(reg_N, reg_M) + + } + + @asm ldrsb reg_T maccess + + @rules { - @conv { + check g_arm_instruction_set_cond(cond) - reg_T = Register(Rt) - reg_N = Register(Rn) - reg_M = Register(Rm) - index = (P == '1') - add = (U == '1') - wback = (P == '0') || (W == '1') - mem_access = MakeMemoryAccess(reg_N, reg_M, NULL, index, add, wback) + } } - @rules { + @syntax { + + @assert { + + P == 0 + P == 0 || W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + maccess = MemAccessPostIndexed(reg_N, reg_M) + + } + + @asm ldrsb reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/ldrsbt_A8887.d b/plugins/arm/v7/opdefs/ldrsbt_A8887.d index b545f32..3182168 100644 --- a/plugins/arm/v7/opdefs/ldrsbt_A8887.d +++ b/plugins/arm/v7/opdefs/ldrsbt_A8887.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title LDRSBT -@desc Load Register Signed Byte Unprivileged loads a byte from memory, sign-extends it to form a 32-bit word, and writes it to a register. For information about memory accesses see Memory accesses on page A8-294. The memory access is restricted as if the processor were running in User mode. This makes no difference if the processor is actually running in User mode. LDRSBT is UNPREDICTABLE in Hyp mode. The Thumb instruction uses an offset addressing mode, that calculates the address used for the memory access from a base register value and an immediate offset, and leaves the base register unchanged. The ARM instruction uses a post-indexed addressing mode, that uses a base register value as the address for the memory access, and calculates a new address from a base register value and an offset and writes it back to the base register. The offset can be an immediate value or a register value. +@id 86 + +@desc { + + Load Register Signed Byte Unprivileged loads a byte from memory, sign-extends it to form a 32-bit word, and writes it to a register. For information about memory accesses see Memory accesses on page A8-294. The memory access is restricted as if the processor were running in User mode. This makes no difference if the processor is actually running in User mode. LDRSBT is UNPREDICTABLE in Hyp mode. The Thumb instruction uses an offset addressing mode, that calculates the address used for the memory access from a base register value and an immediate offset, and leaves the base register unchanged. The ARM instruction uses a post-indexed addressing mode, that uses a base register value as the address for the memory access, and calculates a new address from a base register value and an offset and writes it back to the base register. The offset can be an immediate value or a register value. + +} @encoding (T1) { @word 1 1 1 1 1 0 0 1 0 0 0 1 Rn(4) Rt(4) 1 1 1 0 imm8(8) - @syntax <reg_T> <mem_access> + @syntax { + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8, 32) + maccess = MemAccessOffset(reg_N, imm32) - @conv { + } - reg_T = Register(Rt) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm8, 32) - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, true, true, false) + @asm ldrsbt reg_T maccess } @@ -46,21 +56,24 @@ @word cond(4) 0 0 0 0 U(1) 1 1 1 Rn(4) Rt(4) imm4H(4) 1 1 0 1 imm4L(4) - @syntax <reg_T> <mem_access> + @syntax { - @conv { + @conv { - reg_T = Register(Rt) - reg_N = Register(Rn) - add = (U == '1') - imm32 = ZeroExtend(imm4H:imm4L, 32) - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, false, add, false) + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm4H:imm4L, 32) + maccess = MemAccessPostIndexed(reg_N, imm32) - } + } + + @asm ldrsbt reg_T maccess + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } @@ -70,21 +83,24 @@ @word cond(4) 0 0 0 0 U(1) 0 1 1 Rn(4) Rt(4) 0 0 0 0 1 1 0 1 Rm(4) - @syntax <reg_T> <mem_access> + @syntax { - @conv { + @conv { - reg_T = Register(Rt) - reg_N = Register(Rn) - reg_M = Register(Rm) - add = (U == '1') - mem_access = MakeMemoryAccess(reg_N, reg_M, NULL, false, add, false) + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + maccess = MemAccessPostIndexed(reg_N, reg_M) - } + } + + @asm ldrsbt reg_T maccess + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/ldrsh_A8888.d b/plugins/arm/v7/opdefs/ldrsh_A8888.d index f01024c..a6f62b6 100644 --- a/plugins/arm/v7/opdefs/ldrsh_A8888.d +++ b/plugins/arm/v7/opdefs/ldrsh_A8888.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title LDRSH (immediate) -@desc Load Register Signed Halfword (immediate) calculates an address from a base register value and an immediate offset, loads a halfword from memory, sign-extends it to form a 32-bit word, and writes it to a register. It can use offset, post-indexed, or pre-indexed addressing. For information about memory accesses see Memory accesses on page A8-294. +@id 87 + +@desc { + + Load Register Signed Halfword (immediate) calculates an address from a base register value and an immediate offset, loads a halfword from memory, sign-extends it to form a 32-bit word, and writes it to a register. It can use offset, post-indexed, or pre-indexed addressing. For information about memory accesses see Memory accesses on page A8-294. + +} @encoding (T1) { @word 1 1 1 1 1 0 0 1 1 0 1 1 Rn(4) Rt(4) imm12(12) - @syntax <reg_T> <mem_access> + @syntax { - @conv { + @conv { - reg_T = Register(Rt) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm12, 32) - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, true, true, false) + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm12, 32) + maccess = MemAccessOffset(reg_N, imm32) + + } + + @asm ldrsh reg_T maccess } @@ -46,17 +56,69 @@ @word 1 1 1 1 1 0 0 1 0 0 1 1 Rn(4) Rt(4) 1 P(1) U(1) W(1) imm8(8) - @syntax <reg_T> <mem_access> + @syntax { + + @assert { + + P == 1 + W == 0 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8, 32) + maccess = MemAccessOffset(reg_N, imm32) + + } + + @asm ldrsh reg_T maccess + + } + + @syntax { + + @assert { + + P == 1 + W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8, 32) + maccess = MemAccessPreIndexed(reg_N, imm32) + + } + + @asm ldrsh reg_T maccess + + } + + @syntax { + + @assert { + + P == 0 + W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8, 32) + maccess = MemAccessPostIndexed(reg_N, imm32) - @conv { + } - reg_T = Register(Rt) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm8, 32) - index = (P == '1') - add = (U == '1') - wback = (W == '1') - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, index, add, wback) + @asm ldrsh reg_T maccess } @@ -66,23 +128,87 @@ @word cond(4) 0 0 0 P(1) U(1) 1 W(1) 1 Rn(4) Rt(4) imm4H(4) 1 1 1 1 imm4L(4) - @syntax <reg_T> <mem_access> + @syntax { - @conv { + @assert { - reg_T = Register(Rt) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm4H:imm4L, 32) - index = (P == '1') - add = (U == '1') - wback = (P == '0') || (W == '1') - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, index, add, wback) + P == 1 + P == 1 && W == 0 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm4H:imm4L, 32) + maccess = MemAccessOffset(reg_N, imm32) + + } + + @asm ldrsh reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) + + } + + } + + @syntax { + + @assert { + + P == 1 + P == 0 || W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm4H:imm4L, 32) + maccess = MemAccessPreIndexed(reg_N, imm32) + + } + + @asm ldrsh reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + P == 0 + P == 0 || W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm4H:imm4L, 32) + maccess = MemAccessPostIndexed(reg_N, imm32) + + } + + @asm ldrsh reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/ldrsh_A8889.d b/plugins/arm/v7/opdefs/ldrsh_A8889.d index 074cd5c..ae8e458 100644 --- a/plugins/arm/v7/opdefs/ldrsh_A8889.d +++ b/plugins/arm/v7/opdefs/ldrsh_A8889.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,18 +23,28 @@ @title LDRSH (literal) -@desc Load Register Signed Halfword (literal) calculates an address from the PC value and an immediate offset, loads a halfword from memory, sign-extends it to form a 32-bit word, and writes it to a register. For information about memory accesses see Memory accesses on page A8-294. +@id 88 + +@desc { + + Load Register Signed Halfword (literal) calculates an address from the PC value and an immediate offset, loads a halfword from memory, sign-extends it to form a 32-bit word, and writes it to a register. For information about memory accesses see Memory accesses on page A8-294. + +} @encoding (T1) { @word 1 1 1 1 1 0 0 1 U(1) 0 1 1 1 1 1 1 Rt(4) imm12(12) - @syntax <reg_T> <imm32> + @syntax { + + @conv { - @conv { + reg_T = Register(Rt) + imm32 = ZeroExtend(imm12, 32) - reg_T = Register(Rt) - imm32 = ZeroExtend(imm12, 32) + } + + @asm ldrsh reg_T imm32 } @@ -44,18 +54,22 @@ @word cond(4) 0 0 0 1 U(1) 1 0 1 1 1 1 1 Rt(4) imm4H(4) 1 1 1 1 imm4L(4) - @syntax <reg_T> <imm32> + @syntax { - @conv { + @conv { - reg_T = Register(Rt) - imm32 = ZeroExtend(imm4H:imm4L, 32) + reg_T = Register(Rt) + imm32 = ZeroExtend(imm4H:imm4L, 32) - } + } + + @asm ldrsh reg_T imm32 + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/ldrsh_A8890.d b/plugins/arm/v7/opdefs/ldrsh_A8890.d index eac6c09..6e4feeb 100644 --- a/plugins/arm/v7/opdefs/ldrsh_A8890.d +++ b/plugins/arm/v7/opdefs/ldrsh_A8890.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title LDRSH (register) -@desc Load Register Signed Halfword (register) calculates an address from a base register value and an offset register value, loads a halfword from memory, sign-extends it to form a 32-bit word, and writes it to a register. The offset register value can be shifted left by 0, 1, 2, or 3 bits. For information about memory accesses see Memory accesses on page A8-294. +@id 89 + +@desc { + + Load Register Signed Halfword (register) calculates an address from a base register value and an offset register value, loads a halfword from memory, sign-extends it to form a 32-bit word, and writes it to a register. The offset register value can be shifted left by 0, 1, 2, or 3 bits. For information about memory accesses see Memory accesses on page A8-294. + +} @encoding (t1) { @half 0 1 0 1 1 1 1 Rm(3) Rn(3) Rt(3) - @syntax <reg_T> <mem_access> + @syntax { + + @conv { - @conv { + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + maccess = MemAccessOffset(reg_N, reg_M) - reg_T = Register(Rt) - reg_N = Register(Rn) - reg_M = Register(Rm) - mem_access = MakeMemoryAccess(reg_N, reg_M, NULL, true, true, false) + } + + @asm ldrsh reg_T maccess } @@ -46,15 +56,19 @@ @word 1 1 1 1 1 0 0 1 0 0 1 1 Rn(4) Rt(4) 0 0 0 0 0 0 imm2(2) Rm(4) - @syntax ".W" <reg_T> <mem_access> + @syntax { + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = FixedShift(SRType_LSL, imm2) + maccess = MemAccessOffsetExtended(reg_N, reg_M, shift) - @conv { + } - reg_T = Register(Rt) - reg_N = Register(Rn) - reg_M = Register(Rm) - shift = DecodeImmShift(0, imm2) - mem_access = MakeMemoryAccess(reg_N, reg_M, shift, true, true, false) + @asm ldrsh.w reg_T maccess } @@ -64,23 +78,87 @@ @word cond(4) 0 0 0 P(1) U(1) 0 W(1) 1 Rn(4) Rt(4) 0 0 0 0 1 1 1 1 Rm(4) - @syntax <reg_T> <mem_access> + @syntax { + + @assert { + + P == 1 + P == 1 && W == 0 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + maccess = MemAccessOffset(reg_N, reg_M) + + } + + @asm ldrsh reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) + + } + + } + + @syntax { + + @assert { + + P == 1 + P == 0 || W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + maccess = MemAccessPreIndexed(reg_N, reg_M) + + } + + @asm ldrsh reg_T maccess + + @rules { - @conv { + check g_arm_instruction_set_cond(cond) - reg_T = Register(Rt) - reg_N = Register(Rn) - reg_M = Register(Rm) - index = (P == '1') - add = (U == '1') - wback = (P == '0') || (W == '1') - mem_access = MakeMemoryAccess(reg_N, reg_M, NULL, index, add, wback) + } } - @rules { + @syntax { + + @assert { + + P == 0 + P == 0 || W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + maccess = MemAccessPostIndexed(reg_N, reg_M) + + } + + @asm ldrsh reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/ldrsht_A8891.d b/plugins/arm/v7/opdefs/ldrsht_A8891.d index 355178b..2a00b3a 100644 --- a/plugins/arm/v7/opdefs/ldrsht_A8891.d +++ b/plugins/arm/v7/opdefs/ldrsht_A8891.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title LDRSHT -@desc Load Register Signed Halfword Unprivileged loads a halfword from memory, sign-extends it to form a 32-bit word, and writes it to a register. For information about memory accesses see Memory accesses on page A8-294. The memory access is restricted as if the processor were running in User mode. This makes no difference if the processor is actually running in User mode. LDRSHT is UNPREDICTABLE in Hyp mode. The Thumb instruction uses an offset addressing mode, that calculates the address used for the memory access from a base register value and an immediate offset, and leaves the base register unchanged. The ARM instruction uses a post-indexed addressing mode, that uses a base register value as the address for the memory access, and calculates a new address from a base register value and an offset and writes it back to the base register. The offset can be an immediate value or a register value. +@id 90 + +@desc { + + Load Register Signed Halfword Unprivileged loads a halfword from memory, sign-extends it to form a 32-bit word, and writes it to a register. For information about memory accesses see Memory accesses on page A8-294. The memory access is restricted as if the processor were running in User mode. This makes no difference if the processor is actually running in User mode. LDRSHT is UNPREDICTABLE in Hyp mode. The Thumb instruction uses an offset addressing mode, that calculates the address used for the memory access from a base register value and an immediate offset, and leaves the base register unchanged. The ARM instruction uses a post-indexed addressing mode, that uses a base register value as the address for the memory access, and calculates a new address from a base register value and an offset and writes it back to the base register. The offset can be an immediate value or a register value. + +} @encoding (T1) { @word 1 1 1 1 1 0 0 1 0 0 1 1 Rn(4) Rt(4) 1 1 1 0 imm8(8) - @syntax <reg_T> <mem_access> + @syntax { + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8, 32) + maccess = MemAccessOffset(reg_N, imm32) - @conv { + } - reg_T = Register(Rt) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm8, 32) - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, true, true, false) + @asm ldrsht reg_T maccess } @@ -46,21 +56,24 @@ @word cond(4) 0 0 0 0 U(1) 1 1 1 Rn(4) Rt(4) imm4H(4) 1 1 1 1 imm4L(4) - @syntax <reg_T> <mem_access> + @syntax { - @conv { + @conv { - reg_T = Register(Rt) - reg_N = Register(Rn) - add = (U == '1') - imm32 = ZeroExtend(imm4H:imm4L, 32) - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, false, add, false) + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm4H:imm4L, 32) + maccess = MemAccessPostIndexed(reg_N, imm32) - } + } + + @asm ldrsht reg_T maccess + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } @@ -70,21 +83,24 @@ @word cond(4) 0 0 0 0 U(1) 0 1 1 Rn(4) Rt(4) 0 0 0 0 1 1 1 1 Rm(4) - @syntax <reg_T> <mem_access> + @syntax { - @conv { + @conv { - reg_T = Register(Rt) - reg_N = Register(Rn) - reg_M = Register(Rm) - add = (U == '1') - mem_access = MakeMemoryAccess(reg_N, reg_M, NULL, false, add, false) + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + maccess = MemAccessPostIndexed(reg_N, reg_M) - } + } + + @asm ldrsht reg_T maccess + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/ldrt_A8892.d b/plugins/arm/v7/opdefs/ldrt_A8892.d index e13f0e7..aa92cad 100644 --- a/plugins/arm/v7/opdefs/ldrt_A8892.d +++ b/plugins/arm/v7/opdefs/ldrt_A8892.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title LDRT -@desc Load Register Unprivileged loads a word from memory, and writes it to a register. For information about memory accesses see Memory accesses on page A8-294. The memory access is restricted as if the processor were running in User mode. This makes no difference if the processor is actually running in User mode. LDRT is UNPREDICTABLE in Hyp mode. The Thumb instruction uses an offset addressing mode, that calculates the address used for the memory access from a base register value and an immediate offset, and leaves the base register unchanged. The ARM instruction uses a post-indexed addressing mode, that uses a base register value as the address for the memory access, and calculates a new address from a base register value and an offset and writes it back to the base register. The offset can be an immediate value or an optionally-shifted register value. +@id 91 + +@desc { + + Load Register Unprivileged loads a word from memory, and writes it to a register. For information about memory accesses see Memory accesses on page A8-294. The memory access is restricted as if the processor were running in User mode. This makes no difference if the processor is actually running in User mode. LDRT is UNPREDICTABLE in Hyp mode. The Thumb instruction uses an offset addressing mode, that calculates the address used for the memory access from a base register value and an immediate offset, and leaves the base register unchanged. The ARM instruction uses a post-indexed addressing mode, that uses a base register value as the address for the memory access, and calculates a new address from a base register value and an offset and writes it back to the base register. The offset can be an immediate value or an optionally-shifted register value. + +} @encoding (T1) { @word 1 1 1 1 1 0 0 0 0 1 0 1 Rn(4) Rt(4) 1 1 1 0 imm8(8) - @syntax <reg_T> <mem_access> + @syntax { + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8, 32) + maccess = MemAccessOffset(reg_N, imm32) - @conv { + } - reg_T = Register(Rt) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm8, 32) - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, true, true, false) + @asm ldrt reg_T maccess } @@ -46,21 +56,24 @@ @word cond(4) 0 1 0 0 U(1) 0 1 1 Rn(4) Rt(4) imm12(12) - @syntax <reg_T> <mem_access> + @syntax { - @conv { + @conv { - reg_T = Register(Rt) - reg_N = Register(Rn) - add = (U == '1') - imm32 = ZeroExtend(imm12, 32) - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, false, add, false) + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm12, 32) + maccess = MemAccessPostIndexed(reg_N, imm32) - } + } + + @asm ldrt reg_T maccess + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } @@ -70,22 +83,25 @@ @word cond(4) 0 1 1 0 U(1) 0 1 1 Rn(4) Rt(4) imm5(5) type(2) 0 Rm(4) - @syntax <reg_T> <mem_access> + @syntax { - @conv { + @conv { - reg_T = Register(Rt) - reg_N = Register(Rn) - reg_M = Register(Rm) - add = (U == '1') - shift = DecodeImmShift(type, imm5) - mem_access = MakeMemoryAccess(reg_N, reg_M, shift, false, add, false) + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) + maccess = MemAccessPostIndexedExtended(reg_N, reg_M, shift) - } + } + + @asm ldrt reg_T maccess + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/lsl_A8894.d b/plugins/arm/v7/opdefs/lsl_A8894.d index 89924c6..e5e8dc8 100644 --- a/plugins/arm/v7/opdefs/lsl_A8894.d +++ b/plugins/arm/v7/opdefs/lsl_A8894.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title LSL (immediate) -@desc Logical Shift Left (immediate) shifts a register value left by an immediate number of bits, shifting in zeros, and writes the result to the destination register. It can optionally update the condition flags based on the result. +@id 93 + +@desc { + + Logical Shift Left (immediate) shifts a register value left by an immediate number of bits, shifting in zeros, and writes the result to the destination register. It can optionally update the condition flags based on the result. + +} @encoding (t1) { @half 0 0 0 0 0 imm5(5) Rm(3) Rd(3) - @syntax "lsls" <reg_D> <reg_M> <shift_imm> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_M = Register(Rm) + shift_n = DecodeImmShiftAmount('00', imm5) - reg_D = Register(Rd) - reg_M = Register(Rm) - shift_imm = DecodeImmShift('00', imm5) + } + + @asm lsl ?reg_D reg_M shift_n } @@ -45,21 +55,43 @@ @word 1 1 1 0 1 0 1 0 0 1 0 S(1) 1 1 1 1 0 imm3(3) Rd(4) imm2(2) 0 0 Rm(4) - @syntax <reg_D> <reg_M> <shift_imm> + @syntax { + + @assert { + + S == 0 + + } - @conv { + @conv { - reg_D = Register(Rd) - reg_M = Register(Rm) - setflags = (S == '1') - shift_imm = DecodeImmShift('00', imm3:imm2) + reg_D = Register(Rd) + reg_M = Register(Rm) + shift_n = DecodeImmShiftAmount('00', imm3:imm2) + + } + + @asm lsl.w ?reg_D reg_M shift_n } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_M = Register(Rm) + shift_n = DecodeImmShiftAmount('00', imm3:imm2) + + } - if (setflags); chk_call ExtendKeyword("s") - chk_call ExtendKeyword(".w") + @asm lsls.w ?reg_D reg_M shift_n } @@ -69,21 +101,55 @@ @word cond(4) 0 0 0 1 1 0 1 S(1) 0 0 0 0 Rd(4) imm5(5) 0 0 0 Rm(4) - @syntax <reg_D> <reg_M> <shift_imm> + @syntax { - @conv { + @assert { - reg_D = Register(Rd) - reg_M = Register(Rm) - setflags = (S == '1') - shift_imm = DecodeImmShift('00', imm5) + S == 0 + + } + + @conv { + + reg_D = Register(Rd) + reg_M = Register(Rm) + shift_n = DecodeImmShiftAmount('00', imm5) + + } + + @asm lsl ?reg_D reg_M shift_n + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_M = Register(Rm) + shift_n = DecodeImmShiftAmount('00', imm5) + + } + + @asm lsls ?reg_D reg_M shift_n + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/lsl_A8895.d b/plugins/arm/v7/opdefs/lsl_A8895.d index 4ac5ab6..8a7da49 100644 --- a/plugins/arm/v7/opdefs/lsl_A8895.d +++ b/plugins/arm/v7/opdefs/lsl_A8895.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,18 +23,29 @@ @title LSL (register) -@desc Logical Shift Left (register) shifts a register value left by a variable number of bits, shifting in zeros, and writes the result to the destination register. The variable number of bits is read from the bottom byte of a register. It can optionally update the condition flags based on the result. +@id 94 + +@desc { + + Logical Shift Left (register) shifts a register value left by a variable number of bits, shifting in zeros, and writes the result to the destination register. The variable number of bits is read from the bottom byte of a register. It can optionally update the condition flags based on the result. + +} @encoding (t1) { @half 0 1 0 0 0 0 0 0 1 0 Rm(3) Rdn(3) - @syntax "lsls" <reg_DN> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rdn) + reg_N = Register(Rdn) + reg_M = Register(Rm) - reg_DN = Register(Rdn) - reg_M = Register(Rm) + } + + @asm lsl ?reg_D reg_N reg_M } @@ -44,21 +55,43 @@ @word 1 1 1 1 1 0 1 0 0 0 0 S(1) Rn(4) 1 1 1 1 Rd(4) 0 0 0 0 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @assert { + + S == 0 + + } - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + + } + + @asm lsl.w ?reg_D reg_N reg_M } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + + } - if (setflags); chk_call ExtendKeyword("s") - chk_call ExtendKeyword(".w") + @asm lsls.w ?reg_D reg_N reg_M } @@ -68,21 +101,55 @@ @word cond(4) 0 0 0 1 1 0 1 S(1) 0 0 0 0 Rd(4) Rm(4) 0 0 0 1 Rn(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @assert { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') + S == 0 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + + } + + @asm lsl ?reg_D reg_N reg_M + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + + } + + @asm lsls ?reg_D reg_N reg_M + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/lsr_A8896.d b/plugins/arm/v7/opdefs/lsr_A8896.d index acb9e25..3ee0473 100644 --- a/plugins/arm/v7/opdefs/lsr_A8896.d +++ b/plugins/arm/v7/opdefs/lsr_A8896.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title LSR (immediate) -@desc Logical Shift Right (immediate) shifts a register value right by an immediate number of bits, shifting in zeros, and writes the result to the destination register. It can optionally update the condition flags based on the result. +@id 95 + +@desc { + + Logical Shift Right (immediate) shifts a register value right by an immediate number of bits, shifting in zeros, and writes the result to the destination register. It can optionally update the condition flags based on the result. + +} @encoding (t1) { @half 0 0 0 0 1 imm5(5) Rm(3) Rd(3) - @syntax "lsrs" <reg_D> <reg_M> <shift_imm> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_M = Register(Rm) + shift_n = DecodeImmShiftAmount('01', imm5) - reg_D = Register(Rd) - reg_M = Register(Rm) - shift_imm = DecodeImmShift('01', imm5) + } + + @asm lsr ?reg_D reg_M shift_n } @@ -45,21 +55,43 @@ @word 1 1 1 0 1 0 1 0 0 1 0 S(1) 1 1 1 1 0 imm3(3) Rd(4) imm2(2) 0 1 Rm(4) - @syntax <reg_D> <reg_M> <shift_imm> + @syntax { + + @assert { + + S == 0 + + } - @conv { + @conv { - reg_D = Register(Rd) - reg_M = Register(Rm) - setflags = (S == '1') - shift_imm = DecodeImmShift('01', imm3:imm2) + reg_D = Register(Rd) + reg_M = Register(Rm) + shift_n = DecodeImmShiftAmount('01', imm3:imm2) + + } + + @asm lsr.w ?reg_D reg_M shift_n } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_M = Register(Rm) + shift_n = DecodeImmShiftAmount('01', imm3:imm2) + + } - if (setflags); chk_call ExtendKeyword("s") - chk_call ExtendKeyword(".w") + @asm lsrs.w ?reg_D reg_M shift_n } @@ -69,21 +101,55 @@ @word cond(4) 0 0 0 1 1 0 1 S(1) 0 0 0 0 Rd(4) imm5(5) 0 1 0 Rm(4) - @syntax <reg_D> <reg_M> <shift_imm> + @syntax { - @conv { + @assert { - reg_D = Register(Rd) - reg_M = Register(Rm) - setflags = (S == '1') - shift_imm = DecodeImmShift('01', imm5) + S == 0 + + } + + @conv { + + reg_D = Register(Rd) + reg_M = Register(Rm) + shift_n = DecodeImmShiftAmount('01', imm5) + + } + + @asm lsr ?reg_D reg_M shift_n + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_M = Register(Rm) + shift_n = DecodeImmShiftAmount('01', imm5) + + } + + @asm lsrs ?reg_D reg_M shift_n + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/lsr_A8897.d b/plugins/arm/v7/opdefs/lsr_A8897.d index 070a152..fa112ec 100644 --- a/plugins/arm/v7/opdefs/lsr_A8897.d +++ b/plugins/arm/v7/opdefs/lsr_A8897.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,18 +23,29 @@ @title LSR (register) -@desc Logical Shift Right (register) shifts a register value right by a variable number of bits, shifting in zeros, and writes the result to the destination register. The variable number of bits is read from the bottom byte of a register. It can optionally update the condition flags based on the result. +@id 96 + +@desc { + + Logical Shift Right (register) shifts a register value right by a variable number of bits, shifting in zeros, and writes the result to the destination register. The variable number of bits is read from the bottom byte of a register. It can optionally update the condition flags based on the result. + +} @encoding (t1) { @half 0 1 0 0 0 0 0 0 1 1 Rm(3) Rdn(3) - @syntax "lsrs" <reg_DN> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rdn) + reg_N = Register(Rdn) + reg_M = Register(Rm) - reg_DN = Register(Rdn) - reg_M = Register(Rm) + } + + @asm lsr ?reg_D reg_N reg_M } @@ -44,21 +55,43 @@ @word 1 1 1 1 1 0 1 0 0 0 1 S(1) Rn(4) 1 1 1 1 Rd(4) 0 0 0 0 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @assert { + + S == 0 + + } - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + + } + + @asm lsr.w ?reg_D reg_N reg_M } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + + } - if (setflags); chk_call ExtendKeyword("s") - chk_call ExtendKeyword(".w") + @asm lsrs.w ?reg_D reg_N reg_M } @@ -68,21 +101,55 @@ @word cond(4) 0 0 0 1 1 0 1 S(1) 0 0 0 0 Rd(4) Rm(4) 0 0 1 1 Rn(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @assert { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') + S == 0 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + + } + + @asm lsr ?reg_D reg_N reg_M + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + + } + + @asm lsrs ?reg_D reg_N reg_M + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/mcr_A8898.d b/plugins/arm/v7/opdefs/mcr_A8898.d index f710d5d..b0ece52 100644 --- a/plugins/arm/v7/opdefs/mcr_A8898.d +++ b/plugins/arm/v7/opdefs/mcr_A8898.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,22 +23,32 @@ @title MCR, MCR2 -@desc Move to Coprocessor from ARM core register passes the value of an ARM core register to a coprocessor. If no coprocessor can execute the instruction, an Undefined Instruction exception is generated. This is a generic coprocessor instruction. Some of the fields have no functionality defined by the architecture and are free for use by the coprocessor instruction set designer. These are the opc1, opc2, CRn, and CRm fields. However, coprocessors CP8-CP15 are reserved for use by ARM, and this manual defines the valid MCR and MCR2 instructions when coproc is in the range p8-p15. For more information see Coprocessor support on page A2-94. In an implementation that includes the Virtualization Extensions, MCR accesses to system control registers can be trapped to Hyp mode, meaning that an attempt to execute an MCR instruction in a Non-secure mode other than Hyp mode, that would be permitted in the absence of the Hyp trap controls, generates a Hyp Trap exception. For more information, see Traps to the hypervisor on page B1-1247. Note Because of the range of possible traps to Hyp mode, the MCR pseudocode does not show these possible traps. +@id 97 + +@desc { + + Move to Coprocessor from ARM core register passes the value of an ARM core register to a coprocessor. If no coprocessor can execute the instruction, an Undefined Instruction exception is generated. This is a generic coprocessor instruction. Some of the fields have no functionality defined by the architecture and are free for use by the coprocessor instruction set designer. These are the opc1, opc2, CRn, and CRm fields. However, coprocessors CP8-CP15 are reserved for use by ARM, and this manual defines the valid MCR and MCR2 instructions when coproc is in the range p8-p15. For more information see Coprocessor support on page A2-94. In an implementation that includes the Virtualization Extensions, MCR accesses to system control registers can be trapped to Hyp mode, meaning that an attempt to execute an MCR instruction in a Non-secure mode other than Hyp mode, that would be permitted in the absence of the Hyp trap controls, generates a Hyp Trap exception. For more information, see Traps to the hypervisor on page B1-1247. Note Because of the range of possible traps to Hyp mode, the MCR pseudocode does not show these possible traps. + +} @encoding (T1) { @word 1 1 1 0 1 1 1 0 opc1(3) 0 CRn(4) Rt(4) coproc(4) opc2(3) 1 CRm(4) - @syntax <cp> <undef_opc1> <reg_T> <creg_N> <creg_M> <?undef_opc2> + @syntax { - @conv { + @conv { - reg_T = Register(Rt) - cp = CoProcessor(coproc) - undef_opc1 = RawValue(opc1) - creg_N = CRegister(CRn) - creg_M = CRegister(CRm) - undef_opc2 = RawValue(opc2) + cp = CoProcessor(coproc) + direct_opc1 = UInt(opc1) + reg_T = Register(Rt) + direct_CRn = UInt(CRn) + direct_CRm = UInt(CRm) + direct_opc2 = UInt(opc2) + + } + + @asm mcr cp direct_opc1 reg_T direct_CRn direct_CRm ?direct_opc2 } @@ -46,24 +56,22 @@ @encoding (A1) { - @word cond(4) 1 1 1 0 opc1(3) 0 CRn(4) Rt(4) coproc(4) opc2(3) 1 CRm(4) - - @syntax <cp> <undef_opc1> <reg_T> <creg_N> <creg_M> <?undef_opc2> + @word 1 1 1 0 1 1 1 0 opc1(3) 0 CRn(4) Rt(4) coproc(4) opc2(3) 1 CRm(4) - @conv { + @syntax { - reg_T = Register(Rt) - cp = CoProcessor(coproc) - undef_opc1 = RawValue(opc1) - creg_N = CRegister(CRn) - creg_M = CRegister(CRm) - undef_opc2 = RawValue(opc2) + @conv { - } + cp = CoProcessor(coproc) + direct_opc1 = UInt(opc1) + reg_T = Register(Rt) + direct_CRn = UInt(CRn) + direct_CRm = UInt(CRm) + direct_opc2 = UInt(opc2) - @rules { + } - chk_call StoreCondition(cond) + @asm mcr cp direct_opc1 reg_T direct_CRn direct_CRm ?direct_opc2 } @@ -73,16 +81,20 @@ @word 1 1 1 1 1 1 1 0 opc1(3) 0 CRn(4) Rt(4) coproc(4) opc2(3) 1 CRm(4) - @syntax "mcr2" <cp> <undef_opc1> <reg_T> <creg_N> <creg_M> <?undef_opc2> + @syntax { + + @conv { - @conv { + cp = CoProcessor(coproc) + direct_opc1 = UInt(opc1) + reg_T = Register(Rt) + direct_CRn = UInt(CRn) + direct_CRm = UInt(CRm) + direct_opc2 = UInt(opc2) - reg_T = Register(Rt) - cp = CoProcessor(coproc) - undef_opc1 = RawValue(opc1) - creg_N = CRegister(CRn) - creg_M = CRegister(CRm) - undef_opc2 = RawValue(opc2) + } + + @asm mcr cp direct_opc1 reg_T direct_CRn direct_CRm ?direct_opc2 } @@ -92,16 +104,20 @@ @word 1 1 1 1 1 1 1 0 opc1(3) 0 CRn(4) Rt(4) coproc(4) opc2(3) 1 CRm(4) - @syntax "mcr2" <cp> <undef_opc1> <reg_T> <creg_N> <creg_M> <?undef_opc2> + @syntax { + + @conv { + + cp = CoProcessor(coproc) + direct_opc1 = UInt(opc1) + reg_T = Register(Rt) + direct_CRn = UInt(CRn) + direct_CRm = UInt(CRm) + direct_opc2 = UInt(opc2) - @conv { + } - reg_T = Register(Rt) - cp = CoProcessor(coproc) - undef_opc1 = RawValue(opc1) - creg_N = CRegister(CRn) - creg_M = CRegister(CRm) - undef_opc2 = RawValue(opc2) + @asm mcr cp direct_opc1 reg_T direct_CRn direct_CRm ?direct_opc2 } diff --git a/plugins/arm/v7/opdefs/mcrr_A8899.d b/plugins/arm/v7/opdefs/mcrr_A8899.d index f643826..31e0f34 100644 --- a/plugins/arm/v7/opdefs/mcrr_A8899.d +++ b/plugins/arm/v7/opdefs/mcrr_A8899.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,21 +23,31 @@ @title MCRR, MCRR2 -@desc Move to Coprocessor from two ARM core registers passes the values of two ARM core registers to a coprocessor. If no coprocessor can execute the instruction, an Undefined Instruction exception is generated. This is a generic coprocessor instruction. Some of the fields have no functionality defined by the architecture and are free for use by the coprocessor instruction set designer. These are the opc1 and CRm fields. However, coprocessors CP8-CP15 are reserved for use by ARM, and this manual defines the valid MCRR and MCRR2 instructions when coproc is in the range p8-p15. For more information see Coprocessor support on page A2-94. In an implementation that includes the Virtualization Extensions, MCRR accesses to system control registers can be trapped to Hyp mode, meaning that an attempt to execute an MCRR instruction in a Non-secure mode other than Hyp mode, that would be permitted in the absence of the Hyp trap controls, generates a Hyp Trap exception. For more information, see Traps to the hypervisor on page B1-1247. Note Because of the range of possible traps to Hyp mode, the MCRR pseudocode does not show these possible traps. +@id 98 + +@desc { + + Move to Coprocessor from two ARM core registers passes the values of two ARM core registers to a coprocessor. If no coprocessor can execute the instruction, an Undefined Instruction exception is generated. This is a generic coprocessor instruction. Some of the fields have no functionality defined by the architecture and are free for use by the coprocessor instruction set designer. These are the opc1 and CRm fields. However, coprocessors CP8-CP15 are reserved for use by ARM, and this manual defines the valid MCRR and MCRR2 instructions when coproc is in the range p8-p15. For more information see Coprocessor support on page A2-94. In an implementation that includes the Virtualization Extensions, MCRR accesses to system control registers can be trapped to Hyp mode, meaning that an attempt to execute an MCRR instruction in a Non-secure mode other than Hyp mode, that would be permitted in the absence of the Hyp trap controls, generates a Hyp Trap exception. For more information, see Traps to the hypervisor on page B1-1247. Note Because of the range of possible traps to Hyp mode, the MCRR pseudocode does not show these possible traps. + +} @encoding (T1) { @word 1 1 1 0 1 1 0 0 0 1 0 0 Rt2(4) Rt(4) coproc(4) opc1(4) CRm(4) - @syntax <cp> <undef_opc1> <reg_T> <reg_T2> <creg_M> + @syntax { - @conv { + @conv { - reg_T = Register(Rt) - reg_T2 = Register(Rt2) - cp = CoProcessor(coproc) - undef_opc1 = RawValue(opc1) - creg_M = CRegister(CRm) + cp = CoProcessor(coproc) + direct_opc1 = UInt(opc1) + reg_T = Register(Rt) + reg_T2 = Register(Rt2) + direct_CRm = UInt(CRm) + + } + + @asm mcrr cp direct_opc1 reg_T reg_T2 direct_CRm } @@ -45,23 +55,21 @@ @encoding (A1) { - @word cond(4) 1 1 0 0 0 1 0 0 Rt2(4) Rt(4) coproc(4) opc1(4) CRm(4) - - @syntax <cp> <undef_opc1> <reg_T> <reg_T2> <creg_M> + @word 1 1 1 0 1 1 0 0 0 1 0 0 Rt2(4) Rt(4) coproc(4) opc1(4) CRm(4) - @conv { + @syntax { - reg_T = Register(Rt) - reg_T2 = Register(Rt2) - cp = CoProcessor(coproc) - undef_opc1 = RawValue(opc1) - creg_M = CRegister(CRm) + @conv { - } + cp = CoProcessor(coproc) + direct_opc1 = UInt(opc1) + reg_T = Register(Rt) + reg_T2 = Register(Rt2) + direct_CRm = UInt(CRm) - @rules { + } - chk_call StoreCondition(cond) + @asm mcrr cp direct_opc1 reg_T reg_T2 direct_CRm } @@ -71,15 +79,19 @@ @word 1 1 1 1 1 1 0 0 0 1 0 0 Rt2(4) Rt(4) coproc(4) opc1(4) CRm(4) - @syntax "mcrr2" <cp> <undef_opc1> <reg_T> <reg_T2> <creg_M> + @syntax { + + @conv { - @conv { + cp = CoProcessor(coproc) + direct_opc1 = UInt(opc1) + reg_T = Register(Rt) + reg_T2 = Register(Rt2) + direct_CRm = UInt(CRm) - reg_T = Register(Rt) - reg_T2 = Register(Rt2) - cp = CoProcessor(coproc) - undef_opc1 = RawValue(opc1) - creg_M = CRegister(CRm) + } + + @asm mcrr cp direct_opc1 reg_T reg_T2 direct_CRm } @@ -89,15 +101,19 @@ @word 1 1 1 1 1 1 0 0 0 1 0 0 Rt2(4) Rt(4) coproc(4) opc1(4) CRm(4) - @syntax "mcrr2" <cp> <undef_opc1> <reg_T> <reg_T2> <creg_M> + @syntax { + + @conv { + + cp = CoProcessor(coproc) + direct_opc1 = UInt(opc1) + reg_T = Register(Rt) + reg_T2 = Register(Rt2) + direct_CRm = UInt(CRm) - @conv { + } - reg_T = Register(Rt) - reg_T2 = Register(Rt2) - cp = CoProcessor(coproc) - undef_opc1 = RawValue(opc1) - creg_M = CRegister(CRm) + @asm mcrr cp direct_opc1 reg_T reg_T2 direct_CRm } diff --git a/plugins/arm/v7/opdefs/mla_A88100.d b/plugins/arm/v7/opdefs/mla_A88100.d index 5d4b4e4..654ae37 100644 --- a/plugins/arm/v7/opdefs/mla_A88100.d +++ b/plugins/arm/v7/opdefs/mla_A88100.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title MLA -@desc Multiply Accumulate multiplies two register values, and adds a third register value. The least significant 32 bits of the result are written to the destination register. These 32 bits do not depend on whether the source register values are considered to be signed values or unsigned values. In an ARM instruction, the condition flags can optionally be updated based on the result. Use of this option adversely affects performance on many processor implementations. +@id 99 + +@desc { + + Multiply Accumulate multiplies two register values, and adds a third register value. The least significant 32 bits of the result are written to the destination register. These 32 bits do not depend on whether the source register values are considered to be signed values or unsigned values. In an ARM instruction, the condition flags can optionally be updated based on the result. Use of this option adversely affects performance on many processor implementations. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 1 0 0 0 0 Rn(4) Ra(4) Rd(4) 0 0 0 0 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <reg_A> + @syntax { + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + reg_A = Register(Ra) - @conv { + } - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - reg_A = Register(Ra) + @asm mla reg_D reg_N reg_M reg_A } @@ -46,22 +56,57 @@ @word cond(4) 0 0 0 0 0 0 1 S(1) Rd(4) Ra(4) Rm(4) 1 0 0 1 Rn(4) - @syntax <reg_D> <reg_N> <reg_M> <reg_A> + @syntax { + + @assert { + + S == 0 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + reg_A = Register(Ra) + + } - @conv { + @asm mla reg_D reg_N reg_M reg_A - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - reg_A = Register(Ra) - setflags = (S == '1') + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + reg_A = Register(Ra) + + } + + @asm mlas reg_D reg_N reg_M reg_A + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/mls_A88101.d b/plugins/arm/v7/opdefs/mls_A88101.d index 4d10be8..bdb9073 100644 --- a/plugins/arm/v7/opdefs/mls_A88101.d +++ b/plugins/arm/v7/opdefs/mls_A88101.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title MLS -@desc Multiply and Subtract multiplies two register values, and subtracts the product from a third register value. The least significant 32 bits of the result are written to the destination register. These 32 bits do not depend on whether the source register values are considered to be signed values or unsigned values. +@id 100 + +@desc { + + Multiply and Subtract multiplies two register values, and subtracts the product from a third register value. The least significant 32 bits of the result are written to the destination register. These 32 bits do not depend on whether the source register values are considered to be signed values or unsigned values. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 1 0 0 0 0 Rn(4) Ra(4) Rd(4) 0 0 0 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <reg_A> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + reg_A = Register(Ra) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - reg_A = Register(Ra) + } + + @asm mls reg_D reg_N reg_M reg_A } @@ -46,20 +56,24 @@ @word cond(4) 0 0 0 0 0 1 1 0 Rd(4) Ra(4) Rm(4) 1 0 0 1 Rn(4) - @syntax <reg_D> <reg_N> <reg_M> <reg_A> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - reg_A = Register(Ra) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + reg_A = Register(Ra) - } + } + + @asm mls reg_D reg_N reg_M reg_A + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/mov_A88102.d b/plugins/arm/v7/opdefs/mov_A88102.d index d96baab..e38442b 100644 --- a/plugins/arm/v7/opdefs/mov_A88102.d +++ b/plugins/arm/v7/opdefs/mov_A88102.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,18 +23,28 @@ @title MOV (immediate) -@desc Move (immediate) writes an immediate value to the destination register. It can optionally update the condition flags based on the value. +@id 101 + +@desc { + + Move (immediate) writes an immediate value to the destination register. It can optionally update the condition flags based on the value. + +} @encoding (t1) { @half 0 0 1 0 0 Rd(3) imm8(8) - @syntax "movs" <reg_D> <imm32> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + imm32 = ZeroExtend(imm8, 32) - reg_D = Register(Rd) - imm32 = ZeroExtend(imm8, 32) + } + + @asm mov reg_D imm32 } @@ -44,20 +54,41 @@ @word 1 1 1 1 0 i(1) 0 0 0 1 0 S(1) 1 1 1 1 0 imm3(3) Rd(4) imm8(8) - @syntax <reg_D> <imm32> + @syntax { + + @assert { + + S == 0 + + } + + @conv { - @conv { + reg_D = Register(Rd) + const = ThumbExpandImm_C(i:imm3:imm8, APSR_C) - reg_D = Register(Rd) - setflags = (S == '1') - imm32 = ThumbExpandImm_C(i:imm3:imm8, 0) + } + + @asm mov.w reg_D const } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { - if (setflags); chk_call ExtendKeyword("s") - chk_call ExtendKeyword(".w") + reg_D = Register(Rd) + const = ThumbExpandImm_C(i:imm3:imm8, APSR_C) + + } + + @asm movs.w reg_D const } @@ -67,12 +98,16 @@ @word 1 1 1 1 0 i(1) 1 0 0 1 0 0 imm4(4) 0 imm3(3) Rd(4) imm8(8) - @syntax "movw" <reg_D> <imm32> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + imm32 = ZeroExtend(imm4:i:imm3:imm8, 32) - reg_D = Register(Rd) - imm32 = ZeroExtend(imm4:i:imm3:imm8, 32) + } + + @asm movw reg_D imm32 } @@ -82,20 +117,53 @@ @word cond(4) 0 0 1 1 1 0 1 S(1) 0 0 0 0 Rd(4) imm12(12) - @syntax <reg_D> <imm32> + @syntax { + + @assert { - @conv { + S == 0 - reg_D = Register(Rd) - setflags = (S == '1') - imm32 = ARMExpandImm_C(imm12, 0) + } + + @conv { + + reg_D = Register(Rd) + const = ARMExpandImm_C(imm12, APSR_C) + + } + + @asm mov reg_D const + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + @conv { + + reg_D = Register(Rd) + const = ARMExpandImm_C(imm12, APSR_C) + + } + + @asm movs reg_D const + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } @@ -105,18 +173,22 @@ @word cond(4) 0 0 1 1 0 0 0 0 imm4(4) Rd(4) imm12(12) - @syntax "movw" <reg_D> <imm32> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - imm32 = ZeroExtend(imm4:imm12, 32) + reg_D = Register(Rd) + imm32 = ZeroExtend(imm4:imm12, 32) - } + } + + @asm movw reg_D imm32 + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/mov_A88103.d b/plugins/arm/v7/opdefs/mov_A88103.d index cd3d75a..8a25367 100644 --- a/plugins/arm/v7/opdefs/mov_A88103.d +++ b/plugins/arm/v7/opdefs/mov_A88103.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,18 +23,28 @@ @title MOV (register, Thumb) -@desc Move (register) copies a value from a register to the destination register. It can optionally update the condition flags based on the value. +@id 102 + +@desc { + + Move (register) copies a value from a register to the destination register. It can optionally update the condition flags based on the value. + +} @encoding (t1) { @half 0 1 0 0 0 1 1 0 D(1) Rm(4) Rd(3) - @syntax <reg_D> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(D:Rd) + reg_M = Register(Rm) - reg_D = Register(D:Rd) - reg_M = Register(Rm) + } + + @asm mov reg_D reg_M } @@ -44,12 +54,16 @@ @half 0 0 0 0 0 0 0 0 0 0 Rm(3) Rd(3) - @syntax "movs" <reg_D> <reg_M> + @syntax { + + @conv { + + reg_D = Register(Rd) + reg_M = Register(Rm) - @conv { + } - reg_D = Register(Rd) - reg_M = Register(Rm) + @asm movs reg_D reg_M } @@ -59,20 +73,41 @@ @word 1 1 1 0 1 0 1 0 0 1 0 S(1) 1 1 1 1 0 0 0 0 Rd(4) 0 0 0 0 Rm(4) - @syntax <reg_D> <reg_M> + @syntax { + + @assert { + + S == 0 - @conv { + } - reg_D = Register(Rd) - reg_M = Register(Rm) - setflags = (S == '1') + @conv { + + reg_D = Register(Rd) + reg_M = Register(Rm) + + } + + @asm mov.w reg_D reg_M } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_M = Register(Rm) + + } - if (setflags); chk_call ExtendKeyword("s") - chk_call ExtendKeyword(".w") + @asm movs.w reg_D reg_M } diff --git a/plugins/arm/v7/opdefs/mov_A88104.d b/plugins/arm/v7/opdefs/mov_A88104.d index d164983..9335076 100644 --- a/plugins/arm/v7/opdefs/mov_A88104.d +++ b/plugins/arm/v7/opdefs/mov_A88104.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,26 +23,65 @@ @title MOV (register, ARM) -@desc Move (register) copies a value from a register to the destination register. It can optionally update the condition flags based on the value. +@id 103 + +@desc { + + Move (register) copies a value from a register to the destination register. It can optionally update the condition flags based on the value. + +} @encoding (A1) { @word cond(4) 0 0 0 1 1 0 1 S(1) 0 0 0 0 Rd(4) 0 0 0 0 0 0 0 0 Rm(4) - @syntax <reg_D> <reg_M> + @syntax { + + @assert { + + S == 0 + + } + + @conv { + + reg_D = Register(Rd) + reg_M = Register(Rm) + + } + + @asm mov reg_D reg_M - @conv { + @rules { - reg_D = Register(Rd) - reg_M = Register(Rm) - setflags = (S == '1') + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_M = Register(Rm) + + } + + @asm movs reg_D reg_M + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/movt_A88106.d b/plugins/arm/v7/opdefs/movt_A88106.d index 265d008..58ba83c 100644 --- a/plugins/arm/v7/opdefs/movt_A88106.d +++ b/plugins/arm/v7/opdefs/movt_A88106.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,18 +23,28 @@ @title MOVT -@desc Move Top writes an immediate value to the top halfword of the destination register. It does not affect the contents of the bottom halfword. +@id 105 + +@desc { + + Move Top writes an immediate value to the top halfword of the destination register. It does not affect the contents of the bottom halfword. + +} @encoding (T1) { @word 1 1 1 1 0 i(1) 1 0 1 1 0 0 imm4(4) 0 imm3(3) Rd(4) imm8(8) - @syntax <reg_D> <imm16> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + imm16 = UInt(imm4:i:imm3:imm8) - reg_D = Register(Rd) - imm16 = BuildImm16(imm4:i:imm3:imm8) + } + + @asm movt reg_D imm16 } @@ -44,18 +54,22 @@ @word cond(4) 0 0 1 1 0 1 0 0 imm4(4) Rd(4) imm12(12) - @syntax <reg_D> <imm16> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - imm16 = BuildImm16(imm4:imm12) + reg_D = Register(Rd) + imm16 = UInt(imm4:imm12) - } + } + + @asm movt reg_D imm16 + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/mrc_A88107.d b/plugins/arm/v7/opdefs/mrc_A88107.d index fb9714c..9faecaa 100644 --- a/plugins/arm/v7/opdefs/mrc_A88107.d +++ b/plugins/arm/v7/opdefs/mrc_A88107.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,22 +23,32 @@ @title MRC, MRC2 -@desc Move to ARM core register from Coprocessor causes a coprocessor to transfer a value to an ARM core register or to the condition flags. If no coprocessor can execute the instruction, an Undefined Instruction exception is generated. This is a generic coprocessor instruction. Some of the fields have no functionality defined by the architecture and are free for use by the coprocessor instruction set designer. These are the opc1, opc2, CRn, and CRm fields. However, coprocessors CP8-CP15 are reserved for use by ARM, and this manual defines the valid MRC and MRC2 instructions when coproc is in the range p8-p15. For more information see Coprocessor support on page A2-94. In an implementation that includes the Virtualization Extensions, MRC accesses to system control registers can be trapped to Hyp mode, meaning that an attempt to execute an MRC instruction in a Non-secure mode other than Hyp mode, that would be permitted in the absence of the Hyp trap controls, generates a Hyp Trap exception. For more information, see Traps to the hypervisor on page B1-1247. Note Because of the range of possible traps to Hyp mode, the MRC pseudocode does not show these possible traps. +@id 106 + +@desc { + + Move to ARM core register from Coprocessor causes a coprocessor to transfer a value to an ARM core register or to the condition flags. If no coprocessor can execute the instruction, an Undefined Instruction exception is generated. This is a generic coprocessor instruction. Some of the fields have no functionality defined by the architecture and are free for use by the coprocessor instruction set designer. These are the opc1, opc2, CRn, and CRm fields. However, coprocessors CP8-CP15 are reserved for use by ARM, and this manual defines the valid MRC and MRC2 instructions when coproc is in the range p8-p15. For more information see Coprocessor support on page A2-94. In an implementation that includes the Virtualization Extensions, MRC accesses to system control registers can be trapped to Hyp mode, meaning that an attempt to execute an MRC instruction in a Non-secure mode other than Hyp mode, that would be permitted in the absence of the Hyp trap controls, generates a Hyp Trap exception. For more information, see Traps to the hypervisor on page B1-1247. Note Because of the range of possible traps to Hyp mode, the MRC pseudocode does not show these possible traps. + +} @encoding (T1) { @word 1 1 1 0 1 1 1 0 opc1(3) 1 CRn(4) Rt(4) coproc(4) opc2(3) 1 CRm(4) - @syntax <cp> <undef_opc1> <reg_T> <creg_N> <creg_M> <?undef_opc2> + @syntax { - @conv { + @conv { - reg_T = Register(Rt) - cp = CoProcessor(coproc) - undef_opc1 = RawValue(opc1) - creg_N = CRegister(CRn) - creg_M = CRegister(CRm) - undef_opc2 = RawValue(opc2) + cp = CoProcessor(coproc) + direct_opc1 = UInt(opc1) + reg_T = Register(Rt) + direct_CRn = UInt(CRn) + direct_CRm = UInt(CRm) + direct_opc2 = UInt(opc2) + + } + + @asm mrc cp direct_opc1 reg_T direct_CRn direct_CRm ?direct_opc2 } @@ -46,24 +56,22 @@ @encoding (A1) { - @word cond(4) 1 1 1 0 opc1(3) 1 CRn(4) Rt(4) coproc(4) opc2(3) 1 CRm(4) - - @syntax <cp> <undef_opc1> <reg_T> <creg_N> <creg_M> <?undef_opc2> + @word 1 1 1 0 1 1 1 0 opc1(3) 1 CRn(4) Rt(4) coproc(4) opc2(3) 1 CRm(4) - @conv { + @syntax { - reg_T = Register(Rt) - cp = CoProcessor(coproc) - undef_opc1 = RawValue(opc1) - creg_N = CRegister(CRn) - creg_M = CRegister(CRm) - undef_opc2 = RawValue(opc2) + @conv { - } + cp = CoProcessor(coproc) + direct_opc1 = UInt(opc1) + reg_T = Register(Rt) + direct_CRn = UInt(CRn) + direct_CRm = UInt(CRm) + direct_opc2 = UInt(opc2) - @rules { + } - chk_call StoreCondition(cond) + @asm mrc cp direct_opc1 reg_T direct_CRn direct_CRm ?direct_opc2 } @@ -73,16 +81,20 @@ @word 1 1 1 1 1 1 1 0 opc1(3) 1 CRn(4) Rt(4) coproc(4) opc2(3) 1 CRm(4) - @syntax "mrc2" <cp> <undef_opc1> <reg_T> <creg_N> <creg_M> <?undef_opc2> + @syntax { + + @conv { - @conv { + cp = CoProcessor(coproc) + direct_opc1 = UInt(opc1) + reg_T = Register(Rt) + direct_CRn = UInt(CRn) + direct_CRm = UInt(CRm) + direct_opc2 = UInt(opc2) - reg_T = Register(Rt) - cp = CoProcessor(coproc) - undef_opc1 = RawValue(opc1) - creg_N = CRegister(CRn) - creg_M = CRegister(CRm) - undef_opc2 = RawValue(opc2) + } + + @asm mrc cp direct_opc1 reg_T direct_CRn direct_CRm ?direct_opc2 } @@ -92,16 +104,20 @@ @word 1 1 1 1 1 1 1 0 opc1(3) 1 CRn(4) Rt(4) coproc(4) opc2(3) 1 CRm(4) - @syntax "mrc2" <cp> <undef_opc1> <reg_T> <creg_N> <creg_M> <?undef_opc2> + @syntax { + + @conv { + + cp = CoProcessor(coproc) + direct_opc1 = UInt(opc1) + reg_T = Register(Rt) + direct_CRn = UInt(CRn) + direct_CRm = UInt(CRm) + direct_opc2 = UInt(opc2) - @conv { + } - reg_T = Register(Rt) - cp = CoProcessor(coproc) - undef_opc1 = RawValue(opc1) - creg_N = CRegister(CRn) - creg_M = CRegister(CRm) - undef_opc2 = RawValue(opc2) + @asm mrc cp direct_opc1 reg_T direct_CRn direct_CRm ?direct_opc2 } diff --git a/plugins/arm/v7/opdefs/mrrc_A88108.d b/plugins/arm/v7/opdefs/mrrc_A88108.d index 026c0ef..d981e93 100644 --- a/plugins/arm/v7/opdefs/mrrc_A88108.d +++ b/plugins/arm/v7/opdefs/mrrc_A88108.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,21 +23,31 @@ @title MRRC, MRRC2 -@desc Move to two ARM core registers from Coprocessor causes a coprocessor to transfer values to two ARM core registers. If no coprocessor can execute the instruction, an Undefined Instruction exception is generated. This is a generic coprocessor instruction. Some of the fields have no functionality defined by the architecture and are free for use by the coprocessor instruction set designer. These are the opc1 and CRm fields. However, coprocessors CP8-CP15 are reserved for use by ARM, and this manual defines the valid MRRC and MRRC2 instructions when coproc is in the range p8-p15. For more information see Coprocessor support on page A2-94. In an implementation that includes the Virtualization Extensions, MRRC accesses to system control registers can be trapped to Hyp mode, meaning that an attempt to execute an MRRC instruction in a Non-secure mode other than Hyp mode, that would be permitted in the absence of the Hyp trap controls, generates a Hyp Trap exception. For more information, see Traps to the hypervisor on page B1-1247. Note Because of the range of possible traps to Hyp mode, the MRRC pseudocode does not show these possible traps. +@id 107 + +@desc { + + Move to two ARM core registers from Coprocessor causes a coprocessor to transfer values to two ARM core registers. If no coprocessor can execute the instruction, an Undefined Instruction exception is generated. This is a generic coprocessor instruction. Some of the fields have no functionality defined by the architecture and are free for use by the coprocessor instruction set designer. These are the opc1 and CRm fields. However, coprocessors CP8-CP15 are reserved for use by ARM, and this manual defines the valid MRRC and MRRC2 instructions when coproc is in the range p8-p15. For more information see Coprocessor support on page A2-94. In an implementation that includes the Virtualization Extensions, MRRC accesses to system control registers can be trapped to Hyp mode, meaning that an attempt to execute an MRRC instruction in a Non-secure mode other than Hyp mode, that would be permitted in the absence of the Hyp trap controls, generates a Hyp Trap exception. For more information, see Traps to the hypervisor on page B1-1247. Note Because of the range of possible traps to Hyp mode, the MRRC pseudocode does not show these possible traps. + +} @encoding (T1) { @word 1 1 1 0 1 1 0 0 0 1 0 1 Rt2(4) Rt(4) coproc(4) opc1(4) CRm(4) - @syntax <cp> <opc> <reg_T> <reg_T2> <creg_M> + @syntax { - @conv { + @conv { - reg_T = Register(Rt) - reg_T2 = Register(Rt2) - cp = CoProcessor(coproc) - opc = RawValue(opc1) - creg_M = CRegister(CRm) + cp = CoProcessor(coproc) + direct_opc1 = UInt(opc1) + reg_T = Register(Rt) + reg_T2 = Register(Rt2) + direct_CRm = UInt(CRm) + + } + + @asm mrrc cp direct_opc1 reg_T reg_T2 direct_CRm } @@ -45,23 +55,21 @@ @encoding (A1) { - @word cond(4) 1 1 0 0 0 1 0 1 Rt2(4) Rt(4) coproc(4) opc1(4) CRm(4) - - @syntax <cp> <opc> <reg_T> <reg_T2> <creg_M> + @word 1 1 1 0 1 1 0 0 0 1 0 1 Rt2(4) Rt(4) coproc(4) opc1(4) CRm(4) - @conv { + @syntax { - reg_T = Register(Rt) - reg_T2 = Register(Rt2) - cp = CoProcessor(coproc) - opc = RawValue(opc1) - creg_M = CRegister(CRm) + @conv { - } + cp = CoProcessor(coproc) + direct_opc1 = UInt(opc1) + reg_T = Register(Rt) + reg_T2 = Register(Rt2) + direct_CRm = UInt(CRm) - @rules { + } - chk_call StoreCondition(cond) + @asm mrrc cp direct_opc1 reg_T reg_T2 direct_CRm } @@ -71,15 +79,19 @@ @word 1 1 1 1 1 1 0 0 0 1 0 1 Rt2(4) Rt(4) coproc(4) opc1(4) CRm(4) - @syntax "mrrc2" <cp> <opc> <reg_T> <reg_T2> <creg_M> + @syntax { + + @conv { - @conv { + cp = CoProcessor(coproc) + direct_opc1 = UInt(opc1) + reg_T = Register(Rt) + reg_T2 = Register(Rt2) + direct_CRm = UInt(CRm) - reg_T = Register(Rt) - reg_T2 = Register(Rt2) - cp = CoProcessor(coproc) - opc = RawValue(opc1) - creg_M = CRegister(CRm) + } + + @asm mrrc cp direct_opc1 reg_T reg_T2 direct_CRm } @@ -89,15 +101,19 @@ @word 1 1 1 1 1 1 0 0 0 1 0 1 Rt2(4) Rt(4) coproc(4) opc1(4) CRm(4) - @syntax "mrrc2" <cp> <opc> <reg_T> <reg_T2> <creg_M> + @syntax { + + @conv { + + cp = CoProcessor(coproc) + direct_opc1 = UInt(opc1) + reg_T = Register(Rt) + reg_T2 = Register(Rt2) + direct_CRm = UInt(CRm) - @conv { + } - reg_T = Register(Rt) - reg_T2 = Register(Rt2) - cp = CoProcessor(coproc) - opc = RawValue(opc1) - creg_M = CRegister(CRm) + @asm mrrc cp direct_opc1 reg_T reg_T2 direct_CRm } diff --git a/plugins/arm/v7/opdefs/mul_A88114.d b/plugins/arm/v7/opdefs/mul_A88114.d index fa250b7..25e6736 100644 --- a/plugins/arm/v7/opdefs/mul_A88114.d +++ b/plugins/arm/v7/opdefs/mul_A88114.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title MUL -@desc Multiply multiplies two register values. The least significant 32 bits of the result are written to the destination register. These 32 bits do not depend on whether the source register values are considered to be signed values or unsigned values. Optionally, it can update the condition flags based on the result. In the Thumb instruction set, this option is limited to only a few forms of the instruction. Use of this option adversely affects performance on many processor implementations. +@id 113 + +@desc { + + Multiply multiplies two register values. The least significant 32 bits of the result are written to the destination register. These 32 bits do not depend on whether the source register values are considered to be signed values or unsigned values. Optionally, it can update the condition flags based on the result. In the Thumb instruction set, this option is limited to only a few forms of the instruction. Use of this option adversely affects performance on many processor implementations. + +} @encoding (t1) { @half 0 1 0 0 0 0 1 1 0 1 Rn(3) Rdm(3) - @syntax "muls" <reg_DM_1> <reg_N> <reg_DM_2> + @syntax { - @conv { + @conv { - reg_N = Register(Rn) - reg_DM_1 = Register(Rdm) - reg_DM_2 = Register(Rdm) + reg_D = Register(Rdm) + reg_N = Register(Rn) + reg_M = Register(Rdm) + + } + + @asm mul reg_D reg_N ?reg_M } @@ -45,13 +55,17 @@ @word 1 1 1 1 1 0 1 1 0 0 0 0 Rn(4) 1 1 1 1 Rd(4) 0 0 0 0 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm mul reg_D reg_N ?reg_M } @@ -61,21 +75,55 @@ @word cond(4) 0 0 0 0 0 0 0 S(1) Rd(4) 0 0 0 0 Rm(4) 1 0 0 1 Rn(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @assert { + + S == 0 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - @conv { + } - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') + @asm mul reg_D reg_N ?reg_M + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + + } + + @asm muls reg_D reg_N ?reg_M + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/mvn_A88115.d b/plugins/arm/v7/opdefs/mvn_A88115.d index 2955439..c27b3a5 100644 --- a/plugins/arm/v7/opdefs/mvn_A88115.d +++ b/plugins/arm/v7/opdefs/mvn_A88115.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,25 +23,53 @@ @title MVN (immediate) -@desc Bitwise NOT (immediate) writes the bitwise inverse of an immediate value to the destination register. It can optionally update the condition flags based on the value. +@id 114 + +@desc { + + Bitwise NOT (immediate) writes the bitwise inverse of an immediate value to the destination register. It can optionally update the condition flags based on the value. + +} @encoding (T1) { @word 1 1 1 1 0 i(1) 0 0 0 1 1 S(1) 1 1 1 1 0 imm3(3) Rd(4) imm8(8) - @syntax <reg_D> <imm32> + @syntax { + + @assert { + + S == 0 + + } + + @conv { - @conv { + reg_D = Register(Rd) + const = ThumbExpandImm_C(i:imm3:imm8, APSR_C) - reg_D = Register(Rd) - setflags = (S == '1') - imm32 = ThumbExpandImm_C(i:imm3:imm8, 0) + } + + @asm mvn reg_D const } - @rules { + @syntax { + + @assert { + + S == 1 + + } - if (setflags); chk_call ExtendKeyword("s") + @conv { + + reg_D = Register(Rd) + const = ThumbExpandImm_C(i:imm3:imm8, APSR_C) + + } + + @asm mvns reg_D const } @@ -51,20 +79,53 @@ @word cond(4) 0 0 1 1 1 1 1 S(1) 0 0 0 0 Rd(4) imm12(12) - @syntax <reg_D> <imm32> + @syntax { + + @assert { - @conv { + S == 0 - reg_D = Register(Rd) - setflags = (S == '1') - imm32 = ARMExpandImm_C(imm12, 0) + } + + @conv { + + reg_D = Register(Rd) + const = ARMExpandImm_C(imm12, APSR_C) + + } + + @asm mvn reg_D const + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + const = ARMExpandImm_C(imm12, APSR_C) + + } + + @asm mvns reg_D const + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/mvn_A88116.d b/plugins/arm/v7/opdefs/mvn_A88116.d index 1f3f390..38ef06e 100644 --- a/plugins/arm/v7/opdefs/mvn_A88116.d +++ b/plugins/arm/v7/opdefs/mvn_A88116.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,18 +23,28 @@ @title MVN (register) -@desc Bitwise NOT (register) writes the bitwise inverse of a register value to the destination register. It can optionally update the condition flags based on the result. +@id 115 + +@desc { + + Bitwise NOT (register) writes the bitwise inverse of a register value to the destination register. It can optionally update the condition flags based on the result. + +} @encoding (t1) { @half 0 1 0 0 0 0 1 1 1 1 Rm(3) Rd(3) - @syntax "mvns" <reg_D> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_M = Register(Rm) + } + + @asm mvn reg_D reg_M } @@ -44,21 +54,43 @@ @word 1 1 1 0 1 0 1 0 0 1 1 S(1) 1 1 1 1 0 imm3(3) Rd(4) imm2(2) type(2) Rm(4) - @syntax <reg_D> <reg_M> <?shift> + @syntax { + + @assert { + + S == 0 + + } - @conv { + @conv { - reg_D = Register(Rd) - reg_M = Register(Rm) - setflags = (S == '1') - shift = DecodeImmShift(type, imm3:imm2) + reg_D = Register(Rd) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm3:imm2) + + } + + @asm mvn.w reg_D reg_M ?shift } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm3:imm2) + + } - if (setflags); chk_call ExtendKeyword("s") - chk_call ExtendKeyword(".w") + @asm mvns.w reg_D reg_M ?shift } @@ -68,21 +100,55 @@ @word cond(4) 0 0 0 1 1 1 1 S(1) 0 0 0 0 Rd(4) imm5(5) type(2) 0 Rm(4) - @syntax <reg_D> <reg_M> <?shift> + @syntax { - @conv { + @assert { - reg_D = Register(Rd) - reg_M = Register(Rm) - setflags = (S == '1') - shift = DecodeImmShift(type, imm5) + S == 0 + + } + + @conv { + + reg_D = Register(Rd) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) + + } + + @asm mvn reg_D reg_M ?shift + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) + + } + + @asm mvns reg_D reg_M ?shift + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/mvn_A88117.d b/plugins/arm/v7/opdefs/mvn_A88117.d index cc6ef16..6556020 100644 --- a/plugins/arm/v7/opdefs/mvn_A88117.d +++ b/plugins/arm/v7/opdefs/mvn_A88117.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,27 +23,71 @@ @title MVN (register-shifted register) -@desc Bitwise NOT (register-shifted register) writes the bitwise inverse of a register-shifted register value to the destination register. It can optionally update the condition flags based on the result. +@id 116 + +@desc { + + Bitwise NOT (register-shifted register) writes the bitwise inverse of a register-shifted register value to the destination register. It can optionally update the condition flags based on the result. + +} @encoding (A1) { @word cond(4) 0 0 0 1 1 1 1 S(1) 0 0 0 0 Rd(4) Rs(4) 0 type(2) 1 Rm(4) - @syntax <reg_D> <reg_M> <reg_shift> + @syntax { + + @assert { + + S == 0 + + } + + @conv { + + reg_D = Register(Rd) + reg_M = Register(Rm) + shift_t = UInt(type) + reg_S = Register(Rs) + shift = BuildRegShift(shift_t, reg_S) + + } + + @asm mvn reg_D reg_M shift - @conv { + @rules { - reg_shift = RegisterShift(type, Rs) - reg_D = Register(Rd) - reg_M = Register(Rm) - setflags = (S == '1') + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_M = Register(Rm) + shift_t = UInt(type) + reg_S = Register(Rs) + shift = BuildRegShift(shift_t, reg_S) + + } + + @asm mvns reg_D reg_M shift + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/nop_A88119.d b/plugins/arm/v7/opdefs/nop_A88119.d index 84c495a..1f9b82f 100644 --- a/plugins/arm/v7/opdefs/nop_A88119.d +++ b/plugins/arm/v7/opdefs/nop_A88119.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,35 @@ @title NOP -@desc No Operation does nothing. This instruction can be used for instruction alignment purposes. See Pre-UAL pseudo-instruction NOP on page AppxH-2472 for details of NOP before the introduction of UAL and the ARMv6K and ARMv6T2 architecture variants. Note The timing effects of including a NOP instruction in a program are not guaranteed. It can increase execution time, leave it unchanged, or even reduce it. Therefore, NOP instructions are not suitable for timing loops. +@id 118 + +@desc { + + No Operation does nothing. This instruction can be used for instruction alignment purposes. See Pre-UAL pseudo-instruction NOP on page AppxH-2472 for details of NOP before the introduction of UAL and the ARMv6K and ARMv6T2 architecture variants. Note The timing effects of including a NOP instruction in a program are not guaranteed. It can increase execution time, leave it unchanged, or even reduce it. Therefore, NOP instructions are not suitable for timing loops. + +} @encoding (t1) { @half 1 0 1 1 1 1 1 1 0 0 0 0 0 0 0 0 + @syntax { + + @asm nop + + } + } @encoding (T2) { @word 1 1 1 1 0 0 1 1 1 0 1 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - @syntax ".W" + @syntax { + + @asm nop.w + + } } @@ -43,9 +59,15 @@ @word cond(4) 0 0 1 1 0 0 1 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 - @rules { + @syntax { + + @asm nop + + @rules { + + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/orn_A88120.d b/plugins/arm/v7/opdefs/orn_A88120.d index b823b6c..339dd5d 100644 --- a/plugins/arm/v7/opdefs/orn_A88120.d +++ b/plugins/arm/v7/opdefs/orn_A88120.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,26 +23,55 @@ @title ORN (immediate) -@desc Bitwise OR NOT (immediate) performs a bitwise (inclusive) OR of a register value and the complement of an immediate value, and writes the result to the destination register. It can optionally update the condition flags based on the result. +@id 119 + +@desc { + + Bitwise OR NOT (immediate) performs a bitwise (inclusive) OR of a register value and the complement of an immediate value, and writes the result to the destination register. It can optionally update the condition flags based on the result. + +} @encoding (T1) { @word 1 1 1 1 0 i(1) 0 0 0 1 1 S(1) Rn(4) 0 imm3(3) Rd(4) imm8(8) - @syntax <reg_D> <reg_N> <imm32> + @syntax { + + @assert { + + S == 0 + + } + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + const = ThumbExpandImm_C(i:imm3:imm8, APSR_C) - reg_D = Register(Rd) - reg_N = Register(Rn) - setflags = (S == '1') - imm32 = ThumbExpandImm_C(i:imm3:imm8, 0) + } + + @asm orn ?reg_D reg_N const } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + const = ThumbExpandImm_C(i:imm3:imm8, APSR_C) + + } - if (setflags); chk_call ExtendKeyword("s") + @asm orns ?reg_D reg_N const } diff --git a/plugins/arm/v7/opdefs/orn_A88121.d b/plugins/arm/v7/opdefs/orn_A88121.d index f1523ec..5b32f94 100644 --- a/plugins/arm/v7/opdefs/orn_A88121.d +++ b/plugins/arm/v7/opdefs/orn_A88121.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,27 +23,57 @@ @title ORN (register) -@desc Bitwise OR NOT (register) performs a bitwise (inclusive) OR of a register value and the complement of an optionally-shifted register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. +@id 120 + +@desc { + + Bitwise OR NOT (register) performs a bitwise (inclusive) OR of a register value and the complement of an optionally-shifted register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. + +} @encoding (T1) { @word 1 1 1 0 1 0 1 0 0 1 1 S(1) Rn(4) 0 imm3(3) Rd(4) imm2(2) type(2) Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <?shift> + @syntax { + + @assert { + + S == 0 + + } + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm3:imm2) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') - shift = DecodeImmShift(type, imm3:imm2) + } + + @asm orn ?reg_D reg_N reg_M ?shift } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm3:imm2) + + } - if (setflags); chk_call ExtendKeyword("s") + @asm orns ?reg_D reg_N reg_M ?shift } diff --git a/plugins/arm/v7/opdefs/orr_A88122.d b/plugins/arm/v7/opdefs/orr_A88122.d index 766b5ee..8b159ad 100644 --- a/plugins/arm/v7/opdefs/orr_A88122.d +++ b/plugins/arm/v7/opdefs/orr_A88122.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,26 +23,55 @@ @title ORR (immediate) -@desc Bitwise OR (immediate) performs a bitwise (inclusive) OR of a register value and an immediate value, and writes the result to the destination register. It can optionally update the condition flags based on the result. +@id 121 + +@desc { + + Bitwise OR (immediate) performs a bitwise (inclusive) OR of a register value and an immediate value, and writes the result to the destination register. It can optionally update the condition flags based on the result. + +} @encoding (T1) { @word 1 1 1 1 0 i(1) 0 0 0 1 0 S(1) Rn(4) 0 imm3(3) Rd(4) imm8(8) - @syntax <reg_D> <reg_N> <imm32> + @syntax { + + @assert { + + S == 0 + + } + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + const = ThumbExpandImm_C(i:imm3:imm8, APSR_C) - reg_D = Register(Rd) - reg_N = Register(Rn) - setflags = (S == '1') - imm32 = ThumbExpandImm_C(i:imm3:imm8, 0) + } + + @asm orr ?reg_D reg_N const } - @rules { + @syntax { + + @assert { + + S == 1 + + } - if (setflags); chk_call ExtendKeyword("s") + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + const = ThumbExpandImm_C(i:imm3:imm8, APSR_C) + + } + + @asm orrs ?reg_D reg_N const } @@ -52,21 +81,55 @@ @word cond(4) 0 0 1 1 1 0 0 S(1) Rn(4) Rd(4) imm12(12) - @syntax <reg_D> <reg_N> <imm32> + @syntax { + + @assert { - @conv { + S == 0 - reg_D = Register(Rd) - reg_N = Register(Rn) - setflags = (S == '1') - imm32 = ARMExpandImm_C(imm12, 0) + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + const = ARMExpandImm_C(imm12, APSR_C) + + } + + @asm orr ?reg_D reg_N const + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + const = ARMExpandImm_C(imm12, APSR_C) + + } + + @asm orrs ?reg_D reg_N const + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/orr_A88123.d b/plugins/arm/v7/opdefs/orr_A88123.d index 2395c89..1549d28 100644 --- a/plugins/arm/v7/opdefs/orr_A88123.d +++ b/plugins/arm/v7/opdefs/orr_A88123.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,18 +23,29 @@ @title ORR (register) -@desc Bitwise OR (register) performs a bitwise (inclusive) OR of a register value and an optionally-shifted register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. +@id 122 + +@desc { + + Bitwise OR (register) performs a bitwise (inclusive) OR of a register value and an optionally-shifted register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. + +} @encoding (t1) { @half 0 1 0 0 0 0 1 1 0 0 Rm(3) Rdn(3) - @syntax "orrs" <reg_DN> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rdn) + reg_N = Register(Rdn) + reg_M = Register(Rm) - reg_DN = Register(Rdn) - reg_M = Register(Rm) + } + + @asm orr ?reg_D reg_N reg_M } @@ -44,22 +55,45 @@ @word 1 1 1 0 1 0 1 0 0 1 0 S(1) Rn(4) 0 imm3(3) Rd(4) imm2(2) type(2) Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <?shift> + @syntax { + + @assert { + + S == 0 + + } - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') - shift = DecodeImmShift(type, imm3:imm2) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm3:imm2) + + } + + @asm orr.w ?reg_D reg_N reg_M ?shift } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm3:imm2) + + } - if (setflags); chk_call ExtendKeyword("s") - chk_call ExtendKeyword(".w") + @asm orrs.w ?reg_D reg_N reg_M ?shift } @@ -69,22 +103,57 @@ @word cond(4) 0 0 0 1 1 0 0 S(1) Rn(4) Rd(4) imm5(5) type(2) 0 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <?shift> + @syntax { - @conv { + @assert { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') - shift = DecodeImmShift(type, imm5) + S == 0 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) + + } + + @asm orr ?reg_D reg_N reg_M ?shift + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) + + } + + @asm orrs ?reg_D reg_N reg_M ?shift + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/orr_A88124.d b/plugins/arm/v7/opdefs/orr_A88124.d index f4d78b9..85648ed 100644 --- a/plugins/arm/v7/opdefs/orr_A88124.d +++ b/plugins/arm/v7/opdefs/orr_A88124.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,28 +23,73 @@ @title ORR (register-shifted register) -@desc Bitwise OR (register-shifted register) performs a bitwise (inclusive) OR of a register value and a register-shifted register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. +@id 123 + +@desc { + + Bitwise OR (register-shifted register) performs a bitwise (inclusive) OR of a register value and a register-shifted register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. + +} @encoding (A1) { @word cond(4) 0 0 0 1 1 0 0 S(1) Rn(4) Rd(4) Rs(4) 0 type(2) 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <reg_shift> + @syntax { + + @assert { + + S == 0 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift_t = UInt(type) + reg_S = Register(Rs) + shift = BuildRegShift(shift_t, reg_S) + + } + + @asm orr ?reg_D reg_N reg_M shift - @conv { + @rules { - reg_shift = RegisterShift(type, Rs) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift_t = UInt(type) + reg_S = Register(Rs) + shift = BuildRegShift(shift_t, reg_S) + + } + + @asm orrs ?reg_D reg_N reg_M shift + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/pop_A88131.d b/plugins/arm/v7/opdefs/pop_A88131.d index 2dee09a..1169729 100644 --- a/plugins/arm/v7/opdefs/pop_A88131.d +++ b/plugins/arm/v7/opdefs/pop_A88131.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,17 +23,27 @@ @title POP (Thumb) -@desc Pop Multiple Registers loads multiple registers from the stack, loading from consecutive memory locations starting at the address in SP, and updates SP to point just above the loaded data. +@id 130 + +@desc { + + Pop Multiple Registers loads multiple registers from the stack, loading from consecutive memory locations starting at the address in SP, and updates SP to point just above the loaded data. + +} @encoding (t1) { @half 1 0 1 1 1 1 0 P(1) register_list(8) - @syntax <registers> + @syntax { + + @conv { - @conv { + registers = RegList(P:'0000000':register_list) - registers = RegistersList(P:'0000000':register_list) + } + + @asm pop registers } @@ -49,11 +59,15 @@ @word 1 1 1 0 1 0 0 0 1 0 1 1 1 1 0 1 P(1) M(1) 0 register_list(13) - @syntax ".W" <registers> + @syntax { + + @conv { + + registers = RegList(P:M:'0':register_list) - @conv { + } - registers = RegistersList(P:M:'0':register_list) + @asm pop.w registers } @@ -69,11 +83,15 @@ @word 1 1 1 1 1 0 0 0 0 1 0 1 1 1 0 1 Rt(4) 1 0 1 1 0 0 0 0 0 1 0 0 - @syntax ".W" <registers> + @syntax { + + @conv { + + registers = SingleRegList(Rt) - @conv { + } - registers = RegistersList(1 << Rt) + @asm pop.w registers } diff --git a/plugins/arm/v7/opdefs/pop_A88132.d b/plugins/arm/v7/opdefs/pop_A88132.d index 27bbf3b..276bad4 100644 --- a/plugins/arm/v7/opdefs/pop_A88132.d +++ b/plugins/arm/v7/opdefs/pop_A88132.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,23 +23,33 @@ @title POP (ARM) -@desc Pop Multiple Registers loads multiple registers from the stack, loading from consecutive memory locations starting at the address in SP, and updates SP to point just above the loaded data. +@id 131 + +@desc { + + Pop Multiple Registers loads multiple registers from the stack, loading from consecutive memory locations starting at the address in SP, and updates SP to point just above the loaded data. + +} @encoding (A1) { @word cond(4) 1 0 0 0 1 0 1 1 1 1 0 1 register_list(16) - @syntax <registers> + @syntax { - @conv { + @conv { - registers = RegistersList(register_list) + registers = RegList(register_list) - } + } - @rules { + @asm pop registers - chk_call StoreCondition(cond) + @rules { + + check g_arm_instruction_set_cond(cond) + + } } @@ -55,17 +65,21 @@ @word cond(4) 0 1 0 0 1 0 0 1 1 1 0 1 Rt(4) 0 0 0 0 0 0 0 0 0 1 0 0 - @syntax <registers> + @syntax { - @conv { + @conv { - registers = RegistersList(1 << Rt) + registers = SingleRegList(Rt) - } + } + + @asm pop registers + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/push_A88133.d b/plugins/arm/v7/opdefs/push_A88133.d index 14fc3e9..aa7fe56 100644 --- a/plugins/arm/v7/opdefs/push_A88133.d +++ b/plugins/arm/v7/opdefs/push_A88133.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,17 +23,27 @@ @title PUSH -@desc Push Multiple Registers stores multiple registers to the stack, storing to consecutive memory locations ending just below the address in SP, and updates SP to point to the start of the stored data. +@id 132 + +@desc { + + Push Multiple Registers stores multiple registers to the stack, storing to consecutive memory locations ending just below the address in SP, and updates SP to point to the start of the stored data. + +} @encoding (t1) { @half 1 0 1 1 0 1 0 M(1) register_list(8) - @syntax <registers> + @syntax { - @conv { + @conv { - registers = RegistersList('0':M:'000000':register_list) + registers = RegList('0':M:'000000':register_list) + + } + + @asm push registers } @@ -43,11 +53,15 @@ @word 1 1 1 0 1 0 0 1 0 0 1 0 1 1 0 1 0 M(1) 0 register_list(13) - @syntax ".W" <registers> + @syntax { + + @conv { + + registers = RegList('0':M:'0':register_list) - @conv { + } - registers = RegistersList('0':M:'0':register_list) + @asm push.w registers } @@ -57,11 +71,15 @@ @word 1 1 1 1 1 0 0 0 0 1 0 0 1 1 0 1 Rt(4) 1 1 0 1 0 0 0 0 0 1 0 0 - @syntax ".W" <registers> + @syntax { - @conv { + @conv { - registers = Zeros(16) + registers = SingleRegList(Rt) + + } + + @asm push.w registers } @@ -71,17 +89,21 @@ @word cond(4) 1 0 0 1 0 0 1 0 1 1 0 1 register_list(16) - @syntax <registers> + @syntax { - @conv { + @conv { - registers = RegistersList(register_list) + registers = RegList(register_list) - } + } + + @asm push registers - @rules { + @rules { - chk_call StoreCondition(cond) + check g_arm_instruction_set_cond(cond) + + } } @@ -91,17 +113,21 @@ @word cond(4) 0 1 0 1 0 0 1 0 1 1 0 1 Rt(4) 0 0 0 0 0 0 0 0 0 1 0 0 - @syntax <registers> + @syntax { - @conv { + @conv { - registers = Zeros(16) + registers = SingleRegList(Rt) - } + } + + @asm push registers + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/qadd16_A88135.d b/plugins/arm/v7/opdefs/qadd16_A88135.d index 15af29d..bc7366e 100644 --- a/plugins/arm/v7/opdefs/qadd16_A88135.d +++ b/plugins/arm/v7/opdefs/qadd16_A88135.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title QADD16 -@desc Saturating Add 16 performs two 16-bit integer additions, saturates the results to the 16-bit signed integer range –215 ≤ x ≤ 215 – 1, and writes the results to the destination register. +@id 134 + +@desc { + + Saturating Add 16 performs two 16-bit integer additions, saturates the results to the 16-bit signed integer range –215 ≤ x ≤ 215 – 1, and writes the results to the destination register. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 1 0 0 1 Rn(4) 1 1 1 1 Rd(4) 0 0 0 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm qadd16 ?reg_D reg_N reg_M } @@ -45,19 +55,23 @@ @word cond(4) 0 1 1 0 0 0 1 0 Rn(4) Rd(4) 1 1 1 1 0 0 0 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - } + } + + @asm qadd16 ?reg_D reg_N reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/qadd8_A88136.d b/plugins/arm/v7/opdefs/qadd8_A88136.d index a71b251..2128a39 100644 --- a/plugins/arm/v7/opdefs/qadd8_A88136.d +++ b/plugins/arm/v7/opdefs/qadd8_A88136.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title QADD8 -@desc Saturating Add 8 performs four 8-bit integer additions, saturates the results to the 8-bit signed integer range –27 ≤ x ≤ 27 – 1, and writes the results to the destination register. +@id 135 + +@desc { + + Saturating Add 8 performs four 8-bit integer additions, saturates the results to the 8-bit signed integer range –27 ≤ x ≤ 27 – 1, and writes the results to the destination register. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 1 0 0 0 Rn(4) 1 1 1 1 Rd(4) 0 0 0 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm qadd8 ?reg_D reg_N reg_M } @@ -45,19 +55,23 @@ @word cond(4) 0 1 1 0 0 0 1 0 Rn(4) Rd(4) 1 1 1 1 1 0 0 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - } + } + + @asm qadd8 ?reg_D reg_N reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/qadd_A88134.d b/plugins/arm/v7/opdefs/qadd_A88134.d index f932983..37a22ba 100644 --- a/plugins/arm/v7/opdefs/qadd_A88134.d +++ b/plugins/arm/v7/opdefs/qadd_A88134.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title QADD -@desc Saturating Add adds two register values, saturates the result to the 32-bit signed integer range –231 to (231 – 1), and writes the result to the destination register. If saturation occurs, it sets the Q flag in the APSR. +@id 133 + +@desc { + + Saturating Add adds two register values, saturates the result to the 32-bit signed integer range –231 to (231 – 1), and writes the result to the destination register. If saturation occurs, it sets the Q flag in the APSR. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 1 0 0 0 Rn(4) 1 1 1 1 Rd(4) 1 0 0 0 Rm(4) - @syntax <reg_D> <reg_M> <reg_N> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_M = Register(Rm) + reg_N = Register(Rn) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm qadd ?reg_D reg_M reg_N } @@ -45,19 +55,23 @@ @word cond(4) 0 0 0 1 0 0 0 0 Rn(4) Rd(4) 0 0 0 0 0 1 0 1 Rm(4) - @syntax <reg_D> <reg_M> <reg_N> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_M = Register(Rm) + reg_N = Register(Rn) - } + } + + @asm qadd ?reg_D reg_M reg_N + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/qasx_A88137.d b/plugins/arm/v7/opdefs/qasx_A88137.d index 68251ca..5063f8e 100644 --- a/plugins/arm/v7/opdefs/qasx_A88137.d +++ b/plugins/arm/v7/opdefs/qasx_A88137.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title QASX -@desc Saturating Add and Subtract with Exchange exchanges the two halfwords of the second operand, performs one 16-bit integer addition and one 16-bit subtraction, saturates the results to the 16-bit signed integer range –215 ≤ x ≤ 215 – 1, and writes the results to the destination register. +@id 136 + +@desc { + + Saturating Add and Subtract with Exchange exchanges the two halfwords of the second operand, performs one 16-bit integer addition and one 16-bit subtraction, saturates the results to the 16-bit signed integer range –215 ≤ x ≤ 215 – 1, and writes the results to the destination register. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 1 0 1 0 Rn(4) 1 1 1 1 Rd(4) 0 0 0 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm qasx ?reg_D reg_N reg_M } @@ -45,19 +55,23 @@ @word cond(4) 0 1 1 0 0 0 1 0 Rn(4) Rd(4) 1 1 1 1 0 0 1 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - } + } + + @asm qasx ?reg_D reg_N reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/qdadd_A88138.d b/plugins/arm/v7/opdefs/qdadd_A88138.d index c40cdcd..1f915b8 100644 --- a/plugins/arm/v7/opdefs/qdadd_A88138.d +++ b/plugins/arm/v7/opdefs/qdadd_A88138.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title QDADD -@desc Saturating Double and Add adds a doubled register value to another register value, and writes the result to the destination register. Both the doubling and the addition have their results saturated to the 32-bit signed integer range –231 ≤ x ≤ 231 – 1. If saturation occurs in either operation, it sets the Q flag in the APSR. +@id 137 + +@desc { + + Saturating Double and Add adds a doubled register value to another register value, and writes the result to the destination register. Both the doubling and the addition have their results saturated to the 32-bit signed integer range –231 ≤ x ≤ 231 – 1. If saturation occurs in either operation, it sets the Q flag in the APSR. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 1 0 0 0 Rn(4) 1 1 1 1 Rd(4) 1 0 0 1 Rm(4) - @syntax <reg_D> <reg_M> <reg_N> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_M = Register(Rm) + reg_N = Register(Rn) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm qdadd ?reg_D reg_M reg_N } @@ -45,19 +55,23 @@ @word cond(4) 0 0 0 1 0 1 0 0 Rn(4) Rd(4) 0 0 0 0 0 1 0 1 Rm(4) - @syntax <reg_D> <reg_M> <reg_N> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_M = Register(Rm) + reg_N = Register(Rn) - } + } + + @asm qdadd ?reg_D reg_M reg_N + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/qdsub_A88139.d b/plugins/arm/v7/opdefs/qdsub_A88139.d index 87bd083..b726b6d 100644 --- a/plugins/arm/v7/opdefs/qdsub_A88139.d +++ b/plugins/arm/v7/opdefs/qdsub_A88139.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title QDSUB -@desc Saturating Double and Subtract subtracts a doubled register value from another register value, and writes the result to the destination register. Both the doubling and the subtraction have their results saturated to the 32-bit signed integer range –231 ≤ x ≤ 231 – 1. If saturation occurs in either operation, it sets the Q flag in the APSR. +@id 138 + +@desc { + + Saturating Double and Subtract subtracts a doubled register value from another register value, and writes the result to the destination register. Both the doubling and the subtraction have their results saturated to the 32-bit signed integer range –231 ≤ x ≤ 231 – 1. If saturation occurs in either operation, it sets the Q flag in the APSR. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 1 0 0 0 Rn(4) 1 1 1 1 Rd(4) 1 0 1 1 Rm(4) - @syntax <reg_D> <reg_M> <reg_N> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_M = Register(Rm) + reg_N = Register(Rn) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm qdsub ?reg_D reg_M reg_N } @@ -45,19 +55,23 @@ @word cond(4) 0 0 0 1 0 1 1 0 Rn(4) Rd(4) 0 0 0 0 0 1 0 1 Rm(4) - @syntax <reg_D> <reg_M> <reg_N> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_M = Register(Rm) + reg_N = Register(Rn) - } + } + + @asm qdsub ?reg_D reg_M reg_N + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/qsax_A88140.d b/plugins/arm/v7/opdefs/qsax_A88140.d index df24cf8..1a9d204 100644 --- a/plugins/arm/v7/opdefs/qsax_A88140.d +++ b/plugins/arm/v7/opdefs/qsax_A88140.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title QSAX -@desc Saturating Subtract and Add with Exchange exchanges the two halfwords of the second operand, performs one 16-bit integer subtraction and one 16-bit addition, saturates the results to the 16-bit signed integer range –215 ≤ x ≤ 215 – 1, and writes the results to the destination register. +@id 139 + +@desc { + + Saturating Subtract and Add with Exchange exchanges the two halfwords of the second operand, performs one 16-bit integer subtraction and one 16-bit addition, saturates the results to the 16-bit signed integer range –215 ≤ x ≤ 215 – 1, and writes the results to the destination register. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 1 1 1 0 Rn(4) 1 1 1 1 Rd(4) 0 0 0 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm qsax ?reg_D reg_N reg_M } @@ -45,19 +55,23 @@ @word cond(4) 0 1 1 0 0 0 1 0 Rn(4) Rd(4) 1 1 1 1 0 1 0 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - } + } + + @asm qsax ?reg_D reg_N reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/qsub16_A88142.d b/plugins/arm/v7/opdefs/qsub16_A88142.d index 5b2c96b..ca28003 100644 --- a/plugins/arm/v7/opdefs/qsub16_A88142.d +++ b/plugins/arm/v7/opdefs/qsub16_A88142.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title QSUB16 -@desc Saturating Subtract 16 performs two 16-bit integer subtractions, saturates the results to the 16-bit signed integer range –215 ≤ x ≤ 215 – 1, and writes the results to the destination register. +@id 141 + +@desc { + + Saturating Subtract 16 performs two 16-bit integer subtractions, saturates the results to the 16-bit signed integer range –215 ≤ x ≤ 215 – 1, and writes the results to the destination register. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 1 1 0 1 Rn(4) 1 1 1 1 Rd(4) 0 0 0 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm qsub16 ?reg_D reg_N reg_M } @@ -45,19 +55,23 @@ @word cond(4) 0 1 1 0 0 0 1 0 Rn(4) Rd(4) 1 1 1 1 0 1 1 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - } + } + + @asm qsub16 ?reg_D reg_N reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/qsub8_A88143.d b/plugins/arm/v7/opdefs/qsub8_A88143.d index 270a99d..8ec9a11 100644 --- a/plugins/arm/v7/opdefs/qsub8_A88143.d +++ b/plugins/arm/v7/opdefs/qsub8_A88143.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title QSUB8 -@desc Saturating Subtract 8 performs four 8-bit integer subtractions, saturates the results to the 8-bit signed integer range –27 ≤ x ≤ 27 – 1, and writes the results to the destination register. +@id 142 + +@desc { + + Saturating Subtract 8 performs four 8-bit integer subtractions, saturates the results to the 8-bit signed integer range –27 ≤ x ≤ 27 – 1, and writes the results to the destination register. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 1 1 0 0 Rn(4) 1 1 1 1 Rd(4) 0 0 0 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm qsub8 ?reg_D reg_N reg_M } @@ -45,19 +55,23 @@ @word cond(4) 0 1 1 0 0 0 1 0 Rn(4) Rd(4) 1 1 1 1 1 1 1 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - } + } + + @asm qsub8 ?reg_D reg_N reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/qsub_A88141.d b/plugins/arm/v7/opdefs/qsub_A88141.d index c60ec57..6a3b19f 100644 --- a/plugins/arm/v7/opdefs/qsub_A88141.d +++ b/plugins/arm/v7/opdefs/qsub_A88141.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title QSUB -@desc Saturating Subtract subtracts one register value from another register value, saturates the result to the 32-bit signed integer range –231 ≤ x ≤ 231 – 1, and writes the result to the destination register. If saturation occurs, it sets the Q flag in the APSR. +@id 140 + +@desc { + + Saturating Subtract subtracts one register value from another register value, saturates the result to the 32-bit signed integer range –231 ≤ x ≤ 231 – 1, and writes the result to the destination register. If saturation occurs, it sets the Q flag in the APSR. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 1 0 0 0 Rn(4) 1 1 1 1 Rd(4) 1 0 1 0 Rm(4) - @syntax <reg_D> <reg_M> <reg_N> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_M = Register(Rm) + reg_N = Register(Rn) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm qsub ?reg_D reg_M reg_N } @@ -45,19 +55,23 @@ @word cond(4) 0 0 0 1 0 0 1 0 Rn(4) Rd(4) 0 0 0 0 0 1 0 1 Rm(4) - @syntax <reg_D> <reg_M> <reg_N> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_M = Register(Rm) + reg_N = Register(Rn) - } + } + + @asm qsub ?reg_D reg_M reg_N + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/rbit_A88144.d b/plugins/arm/v7/opdefs/rbit_A88144.d index 7f2bdb6..9d1c149 100644 --- a/plugins/arm/v7/opdefs/rbit_A88144.d +++ b/plugins/arm/v7/opdefs/rbit_A88144.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,18 +23,28 @@ @title RBIT -@desc Reverse Bits reverses the bit order in a 32-bit register. +@id 143 + +@desc { + + Reverse Bits reverses the bit order in a 32-bit register. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 1 0 0 1 Rm(4) 1 1 1 1 Rd(4) 1 0 1 0 Rm(4) - @syntax <reg_D> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_M = Register(Rm) + } + + @asm rbit reg_D reg_M } @@ -44,18 +54,22 @@ @word cond(4) 0 1 1 0 1 1 1 1 1 1 1 1 Rd(4) 1 1 1 1 0 0 1 1 Rm(4) - @syntax <reg_D> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_M = Register(Rm) - } + } + + @asm rbit reg_D reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/rev16_A88146.d b/plugins/arm/v7/opdefs/rev16_A88146.d index 53b9a82..3bf8266 100644 --- a/plugins/arm/v7/opdefs/rev16_A88146.d +++ b/plugins/arm/v7/opdefs/rev16_A88146.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,18 +23,28 @@ @title REV16 -@desc Byte-Reverse Packed Halfword reverses the byte order in each16-bit halfword of a 32-bit register. +@id 145 + +@desc { + + Byte-Reverse Packed Halfword reverses the byte order in each16-bit halfword of a 32-bit register. + +} @encoding (t1) { @half 1 0 1 1 1 0 1 0 0 1 Rm(3) Rd(3) - @syntax <reg_D> <reg_M> + @syntax { + + @conv { + + reg_D = Register(Rd) + reg_M = Register(Rm) - @conv { + } - reg_D = Register(Rd) - reg_M = Register(Rm) + @asm rev16 reg_D reg_M } @@ -44,12 +54,16 @@ @word 1 1 1 1 1 0 1 0 1 0 0 1 Rm(4) 1 1 1 1 Rd(4) 1 0 0 1 Rm(4) - @syntax ".W" <reg_D> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_M = Register(Rm) + + } + + @asm rev16.w reg_D reg_M } @@ -59,18 +73,22 @@ @word cond(4) 0 1 1 0 1 0 1 1 1 1 1 1 Rd(4) 1 1 1 1 1 0 1 1 Rm(4) - @syntax <reg_D> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_M = Register(Rm) - } + } + + @asm rev16 reg_D reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/rev_A88145.d b/plugins/arm/v7/opdefs/rev_A88145.d index 2fe305d..0a96df9 100644 --- a/plugins/arm/v7/opdefs/rev_A88145.d +++ b/plugins/arm/v7/opdefs/rev_A88145.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,18 +23,28 @@ @title REV -@desc Byte-Reverse Word reverses the byte order in a 32-bit register. +@id 144 + +@desc { + + Byte-Reverse Word reverses the byte order in a 32-bit register. + +} @encoding (t1) { @half 1 0 1 1 1 0 1 0 0 0 Rm(3) Rd(3) - @syntax <reg_D> <reg_M> + @syntax { + + @conv { + + reg_D = Register(Rd) + reg_M = Register(Rm) - @conv { + } - reg_D = Register(Rd) - reg_M = Register(Rm) + @asm rev reg_D reg_M } @@ -44,12 +54,16 @@ @word 1 1 1 1 1 0 1 0 1 0 0 1 Rm(4) 1 1 1 1 Rd(4) 1 0 0 0 Rm(4) - @syntax ".W" <reg_D> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_M = Register(Rm) + + } + + @asm rev.w reg_D reg_M } @@ -59,18 +73,22 @@ @word cond(4) 0 1 1 0 1 0 1 1 1 1 1 1 Rd(4) 1 1 1 1 0 0 1 1 Rm(4) - @syntax <reg_D> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_M = Register(Rm) - } + } + + @asm rev reg_D reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/revsh_A88147.d b/plugins/arm/v7/opdefs/revsh_A88147.d index 551582c..bd290cc 100644 --- a/plugins/arm/v7/opdefs/revsh_A88147.d +++ b/plugins/arm/v7/opdefs/revsh_A88147.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,18 +23,28 @@ @title REVSH -@desc Byte-Reverse Signed Halfword reverses the byte order in the lower 16-bit halfword of a 32-bit register, and sign-extends the result to 32 bits. +@id 146 + +@desc { + + Byte-Reverse Signed Halfword reverses the byte order in the lower 16-bit halfword of a 32-bit register, and sign-extends the result to 32 bits. + +} @encoding (t1) { @half 1 0 1 1 1 0 1 0 1 1 Rm(3) Rd(3) - @syntax <reg_D> <reg_M> + @syntax { + + @conv { + + reg_D = Register(Rd) + reg_M = Register(Rm) - @conv { + } - reg_D = Register(Rd) - reg_M = Register(Rm) + @asm revsh reg_D reg_M } @@ -44,12 +54,16 @@ @word 1 1 1 1 1 0 1 0 1 0 0 1 Rm(4) 1 1 1 1 Rd(4) 1 0 1 1 Rm(4) - @syntax ".W" <reg_D> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_M = Register(Rm) + + } + + @asm revsh.w reg_D reg_M } @@ -59,18 +73,22 @@ @word cond(4) 0 1 1 0 1 1 1 1 1 1 1 1 Rd(4) 1 1 1 1 1 0 1 1 Rm(4) - @syntax <reg_D> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_M = Register(Rm) - } + } + + @asm revsh reg_D reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/ror_A88149.d b/plugins/arm/v7/opdefs/ror_A88149.d index 7e061c6..0717a95 100644 --- a/plugins/arm/v7/opdefs/ror_A88149.d +++ b/plugins/arm/v7/opdefs/ror_A88149.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,26 +23,55 @@ @title ROR (immediate) -@desc Rotate Right (immediate) provides the value of the contents of a register rotated by a constant value. The bits that are rotated off the right end are inserted into the vacated bit positions on the left. It can optionally update the condition flags based on the result. +@id 148 + +@desc { + + Rotate Right (immediate) provides the value of the contents of a register rotated by a constant value. The bits that are rotated off the right end are inserted into the vacated bit positions on the left. It can optionally update the condition flags based on the result. + +} @encoding (T1) { @word 1 1 1 0 1 0 1 0 0 1 0 S(1) 1 1 1 1 0 imm3(3) Rd(4) imm2(2) 1 1 Rm(4) - @syntax <reg_D> <reg_M> <shift_imm> + @syntax { + + @assert { + + S == 0 + + } + + @conv { - @conv { + reg_D = Register(Rd) + reg_M = Register(Rm) + shift_n = DecodeImmShiftAmount('11', imm3:imm2) - reg_D = Register(Rd) - reg_M = Register(Rm) - setflags = (S == '1') - shift_imm = DecodeImmShift('11', imm3:imm2) + } + + @asm ror ?reg_D reg_M shift_n } - @rules { + @syntax { + + @assert { + + S == 1 + + } - if (setflags); chk_call ExtendKeyword("s") + @conv { + + reg_D = Register(Rd) + reg_M = Register(Rm) + shift_n = DecodeImmShiftAmount('11', imm3:imm2) + + } + + @asm rors ?reg_D reg_M shift_n } @@ -52,21 +81,55 @@ @word cond(4) 0 0 0 1 1 0 1 S(1) 0 0 0 0 Rd(4) imm5(5) 1 1 0 Rm(4) - @syntax <reg_D> <reg_M> <shift_imm> + @syntax { + + @assert { - @conv { + S == 0 - reg_D = Register(Rd) - reg_M = Register(Rm) - setflags = (S == '1') - shift_imm = DecodeImmShift('11', imm5) + } + + @conv { + + reg_D = Register(Rd) + reg_M = Register(Rm) + shift_n = DecodeImmShiftAmount('11', imm5) + + } + + @asm ror ?reg_D reg_M shift_n + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_M = Register(Rm) + shift_n = DecodeImmShiftAmount('11', imm5) + + } + + @asm rors ?reg_D reg_M shift_n + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/ror_A88150.d b/plugins/arm/v7/opdefs/ror_A88150.d index c046bf7..57bbbb7 100644 --- a/plugins/arm/v7/opdefs/ror_A88150.d +++ b/plugins/arm/v7/opdefs/ror_A88150.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,18 +23,29 @@ @title ROR (register) -@desc Rotate Right (register) provides the value of the contents of a register rotated by a variable number of bits. The bits that are rotated off the right end are inserted into the vacated bit positions on the left. The variable number of bits is read from the bottom byte of a register. It can optionally update the condition flags based on the result. +@id 149 + +@desc { + + Rotate Right (register) provides the value of the contents of a register rotated by a variable number of bits. The bits that are rotated off the right end are inserted into the vacated bit positions on the left. The variable number of bits is read from the bottom byte of a register. It can optionally update the condition flags based on the result. + +} @encoding (t1) { @half 0 1 0 0 0 0 0 1 1 1 Rm(3) Rdn(3) - @syntax "rors" <reg_DN> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rdn) + reg_N = Register(Rdn) + reg_M = Register(Rm) - reg_DN = Register(Rdn) - reg_M = Register(Rm) + } + + @asm ror ?reg_D reg_N reg_M } @@ -44,21 +55,43 @@ @word 1 1 1 1 1 0 1 0 0 1 1 S(1) Rn(4) 1 1 1 1 Rd(4) 0 0 0 0 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @assert { + + S == 0 + + } - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + + } + + @asm ror.w ?reg_D reg_N reg_M } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + + } - if (setflags); chk_call ExtendKeyword("s") - chk_call ExtendKeyword(".w") + @asm rors.w ?reg_D reg_N reg_M } @@ -68,21 +101,55 @@ @word cond(4) 0 0 0 1 1 0 1 S(1) 0 0 0 0 Rd(4) Rm(4) 0 1 1 1 Rn(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @assert { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') + S == 0 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + + } + + @asm ror ?reg_D reg_N reg_M + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + + } + + @asm rors ?reg_D reg_N reg_M + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/rrx_A88151.d b/plugins/arm/v7/opdefs/rrx_A88151.d index 4debd42..d73570b 100644 --- a/plugins/arm/v7/opdefs/rrx_A88151.d +++ b/plugins/arm/v7/opdefs/rrx_A88151.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,25 +23,53 @@ @title RRX -@desc Rotate Right with Extend provides the value of the contents of a register shifted right by one place, with the Carry flag shifted into bit[31]. RRX can optionally update the condition flags based on the result. In that case, bit[0] is shifted into the Carry flag. +@id 150 + +@desc { + + Rotate Right with Extend provides the value of the contents of a register shifted right by one place, with the Carry flag shifted into bit[31]. RRX can optionally update the condition flags based on the result. In that case, bit[0] is shifted into the Carry flag. + +} @encoding (T1) { @word 1 1 1 0 1 0 1 0 0 1 0 S(1) 1 1 1 1 0 0 0 0 Rd(4) 0 0 1 1 Rm(4) - @syntax <reg_D> <reg_M> + @syntax { + + @assert { + + S == 0 + + } + + @conv { - @conv { + reg_D = Register(Rd) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_M = Register(Rm) - setflags = (S == '1') + } + + @asm rrx ?reg_D reg_M } - @rules { + @syntax { + + @assert { + + S == 1 + + } - if (setflags); chk_call ExtendKeyword("s") + @conv { + + reg_D = Register(Rd) + reg_M = Register(Rm) + + } + + @asm rrxs ?reg_D reg_M } @@ -51,20 +79,53 @@ @word cond(4) 0 0 0 1 1 0 1 S(1) 0 0 0 0 Rd(4) 0 0 0 0 0 1 1 0 Rm(4) - @syntax <reg_D> <reg_M> + @syntax { + + @assert { - @conv { + S == 0 - reg_D = Register(Rd) - reg_M = Register(Rm) - setflags = (S == '1') + } + + @conv { + + reg_D = Register(Rd) + reg_M = Register(Rm) + + } + + @asm rrx ?reg_D reg_M + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_M = Register(Rm) + + } + + @asm rrxs ?reg_D reg_M + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/rsb_A88152.d b/plugins/arm/v7/opdefs/rsb_A88152.d index ea53373..0bf4eee 100644 --- a/plugins/arm/v7/opdefs/rsb_A88152.d +++ b/plugins/arm/v7/opdefs/rsb_A88152.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title RSB (immediate) -@desc Reverse Subtract (immediate) subtracts a register value from an immediate value, and writes the result to the destination register. It can optionally update the condition flags based on the result. +@id 151 + +@desc { + + Reverse Subtract (immediate) subtracts a register value from an immediate value, and writes the result to the destination register. It can optionally update the condition flags based on the result. + +} @encoding (t1) { @half 0 1 0 0 0 0 1 0 0 1 Rn(3) Rd(3) - @syntax "rsbs" <reg_D> <reg_N> <imm32> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + imm32 = Zeros(32) - reg_D = Register(Rd) - reg_N = Register(Rn) - imm32 = Zeros(32) + } + + @asm rsb ?reg_D reg_N imm32 } @@ -45,21 +55,43 @@ @word 1 1 1 1 0 i(1) 0 1 1 1 0 S(1) Rn(4) 0 imm3(3) Rd(4) imm8(8) - @syntax <reg_D> <reg_N> <imm32> + @syntax { + + @assert { + + S == 0 + + } - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - setflags = (S == '1') - imm32 = ThumbExpandImm(i:imm3:imm8) + reg_D = Register(Rd) + reg_N = Register(Rn) + imm32 = ThumbExpandImm(i:imm3:imm8) + + } + + @asm rsb.w ?reg_D reg_N imm32 } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + imm32 = ThumbExpandImm(i:imm3:imm8) + + } - if (setflags); chk_call ExtendKeyword("s") - chk_call ExtendKeyword(".w") + @asm rsbs.w ?reg_D reg_N imm32 } @@ -69,21 +101,55 @@ @word cond(4) 0 0 1 0 0 1 1 S(1) Rn(4) Rd(4) imm12(12) - @syntax <reg_D> <reg_N> <imm32> + @syntax { - @conv { + @assert { - reg_D = Register(Rd) - reg_N = Register(Rn) - setflags = (S == '1') - imm32 = ARMExpandImm(imm12) + S == 0 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + imm32 = ARMExpandImm(imm12) + + } + + @asm rsb ?reg_D reg_N imm32 + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + imm32 = ARMExpandImm(imm12) + + } + + @asm rsbs ?reg_D reg_N imm32 + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/rsb_A88153.d b/plugins/arm/v7/opdefs/rsb_A88153.d index f4a6d61..3f13bfa 100644 --- a/plugins/arm/v7/opdefs/rsb_A88153.d +++ b/plugins/arm/v7/opdefs/rsb_A88153.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,27 +23,57 @@ @title RSB (register) -@desc Reverse Subtract (register) subtracts a register value from an optionally-shifted register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. +@id 152 + +@desc { + + Reverse Subtract (register) subtracts a register value from an optionally-shifted register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. + +} @encoding (T1) { @word 1 1 1 0 1 0 1 1 1 1 0 S(1) Rn(4) 0 imm3(3) Rd(4) imm2(2) type(2) Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <?shift> + @syntax { + + @assert { + + S == 0 + + } + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm3:imm2) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') - shift = DecodeImmShift(type, imm3:imm2) + } + + @asm rsb ?reg_D reg_N reg_M ?shift } - @rules { + @syntax { + + @assert { + + S == 1 + + } - if (setflags); chk_call ExtendKeyword("s") + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm3:imm2) + + } + + @asm rsbs ?reg_D reg_N reg_M ?shift } @@ -53,22 +83,57 @@ @word cond(4) 0 0 0 0 0 1 1 S(1) Rn(4) Rd(4) imm5(5) type(2) 0 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <?shift> + @syntax { + + @assert { - @conv { + S == 0 - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') - shift = DecodeImmShift(type, imm5) + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) + + } + + @asm rsb ?reg_D reg_N reg_M ?shift + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) + + } + + @asm rsbs ?reg_D reg_N reg_M ?shift + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/rsb_A88154.d b/plugins/arm/v7/opdefs/rsb_A88154.d index 9ccf559..74f084e 100644 --- a/plugins/arm/v7/opdefs/rsb_A88154.d +++ b/plugins/arm/v7/opdefs/rsb_A88154.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,28 +23,73 @@ @title RSB (register-shifted register) -@desc Reverse Subtract (register-shifted register) subtracts a register value from a register-shifted register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. +@id 153 + +@desc { + + Reverse Subtract (register-shifted register) subtracts a register value from a register-shifted register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. + +} @encoding (A1) { @word cond(4) 0 0 0 0 0 1 1 S(1) Rn(4) Rd(4) Rs(4) 0 type(2) 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <reg_shift> + @syntax { + + @assert { + + S == 0 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift_t = UInt(type) + reg_S = Register(Rs) + shift = BuildRegShift(shift_t, reg_S) + + } + + @asm rsb ?reg_D reg_N reg_M shift - @conv { + @rules { - reg_shift = RegisterShift(type, Rs) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift_t = UInt(type) + reg_S = Register(Rs) + shift = BuildRegShift(shift_t, reg_S) + + } + + @asm rsbs ?reg_D reg_N reg_M shift + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/rsc_A88155.d b/plugins/arm/v7/opdefs/rsc_A88155.d index fc5f8b6..dd8954c 100644 --- a/plugins/arm/v7/opdefs/rsc_A88155.d +++ b/plugins/arm/v7/opdefs/rsc_A88155.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,27 +23,67 @@ @title RSC (immediate) -@desc Reverse Subtract with Carry (immediate) subtracts a register value and the value of NOT (Carry flag) from an immediate value, and writes the result to the destination register. It can optionally update the condition flags based on the result. +@id 154 + +@desc { + + Reverse Subtract with Carry (immediate) subtracts a register value and the value of NOT (Carry flag) from an immediate value, and writes the result to the destination register. It can optionally update the condition flags based on the result. + +} @encoding (A1) { @word cond(4) 0 0 1 0 1 1 1 S(1) Rn(4) Rd(4) imm12(12) - @syntax <reg_D> <reg_N> <imm32> + @syntax { + + @assert { + + S == 0 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + imm32 = ARMExpandImm(imm12) + + } + + @asm rsc ?reg_D reg_N imm32 - @conv { + @rules { - reg_D = Register(Rd) - reg_N = Register(Rn) - setflags = (S == '1') - imm32 = ARMExpandImm(imm12) + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + imm32 = ARMExpandImm(imm12) + + } + + @asm rscs ?reg_D reg_N imm32 + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/rsc_A88156.d b/plugins/arm/v7/opdefs/rsc_A88156.d index 70829cd..615aa99 100644 --- a/plugins/arm/v7/opdefs/rsc_A88156.d +++ b/plugins/arm/v7/opdefs/rsc_A88156.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,28 +23,69 @@ @title RSC (register) -@desc Reverse Subtract with Carry (register) subtracts a register value and the value of NOT (Carry flag) from an optionally-shifted register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. +@id 155 + +@desc { + + Reverse Subtract with Carry (register) subtracts a register value and the value of NOT (Carry flag) from an optionally-shifted register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. + +} @encoding (A1) { @word cond(4) 0 0 0 0 1 1 1 S(1) Rn(4) Rd(4) imm5(5) type(2) 0 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <?shift> + @syntax { + + @assert { + + S == 0 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) + + } + + @asm rsc ?reg_D reg_N reg_M ?shift - @conv { + @rules { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') - shift = DecodeImmShift(type, imm5) + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) + + } + + @asm rscs ?reg_D reg_N reg_M ?shift + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/rsc_A88157.d b/plugins/arm/v7/opdefs/rsc_A88157.d index 4fa276d..d95992b 100644 --- a/plugins/arm/v7/opdefs/rsc_A88157.d +++ b/plugins/arm/v7/opdefs/rsc_A88157.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,28 +23,73 @@ @title RSC (register-shifted register) -@desc Reverse Subtract (register-shifted register) subtracts a register value and the value of NOT (Carry flag) from a register-shifted register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. +@id 156 + +@desc { + + Reverse Subtract (register-shifted register) subtracts a register value and the value of NOT (Carry flag) from a register-shifted register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. + +} @encoding (A1) { @word cond(4) 0 0 0 0 1 1 1 S(1) Rn(4) Rd(4) Rs(4) 0 type(2) 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <reg_shift> + @syntax { + + @assert { + + S == 0 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift_t = UInt(type) + reg_S = Register(Rs) + shift = BuildRegShift(shift_t, reg_S) + + } + + @asm rsc ?reg_D reg_N reg_M shift - @conv { + @rules { - reg_shift = RegisterShift(type, Rs) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift_t = UInt(type) + reg_S = Register(Rs) + shift = BuildRegShift(shift_t, reg_S) + + } + + @asm rscs ?reg_D reg_N reg_M shift + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/sadd16_A88158.d b/plugins/arm/v7/opdefs/sadd16_A88158.d index 51ad948..ee8d6d3 100644 --- a/plugins/arm/v7/opdefs/sadd16_A88158.d +++ b/plugins/arm/v7/opdefs/sadd16_A88158.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title SADD16 -@desc Signed Add 16 performs two 16-bit signed integer additions, and writes the results to the destination register. It sets the APSR.GE bits according to the results of the additions. +@id 157 + +@desc { + + Signed Add 16 performs two 16-bit signed integer additions, and writes the results to the destination register. It sets the APSR.GE bits according to the results of the additions. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 1 0 0 1 Rn(4) 1 1 1 1 Rd(4) 0 0 0 0 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm sadd16 ?reg_D reg_N reg_M } @@ -45,19 +55,23 @@ @word cond(4) 0 1 1 0 0 0 0 1 Rn(4) Rd(4) 1 1 1 1 0 0 0 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - } + } + + @asm sadd16 ?reg_D reg_N reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/sadd8_A88159.d b/plugins/arm/v7/opdefs/sadd8_A88159.d index 463c968..6c6c4a6 100644 --- a/plugins/arm/v7/opdefs/sadd8_A88159.d +++ b/plugins/arm/v7/opdefs/sadd8_A88159.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title SADD8 -@desc Signed Add 8 performs four 8-bit signed integer additions, and writes the results to the destination register. It sets the APSR.GE bits according to the results of the additions. +@id 158 + +@desc { + + Signed Add 8 performs four 8-bit signed integer additions, and writes the results to the destination register. It sets the APSR.GE bits according to the results of the additions. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 1 0 0 0 Rn(4) 1 1 1 1 Rd(4) 0 0 0 0 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm sadd8 ?reg_D reg_N reg_M } @@ -45,19 +55,23 @@ @word cond(4) 0 1 1 0 0 0 0 1 Rn(4) Rd(4) 1 1 1 1 1 0 0 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - } + } + + @asm sadd8 ?reg_D reg_N reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/sasx_A88160.d b/plugins/arm/v7/opdefs/sasx_A88160.d index a0529cb..d655002 100644 --- a/plugins/arm/v7/opdefs/sasx_A88160.d +++ b/plugins/arm/v7/opdefs/sasx_A88160.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title SASX -@desc Signed Add and Subtract with Exchange exchanges the two halfwords of the second operand, performs one 16-bit integer addition and one 16-bit subtraction, and writes the results to the destination register. It sets the APSR.GE bits according to the results. +@id 159 + +@desc { + + Signed Add and Subtract with Exchange exchanges the two halfwords of the second operand, performs one 16-bit integer addition and one 16-bit subtraction, and writes the results to the destination register. It sets the APSR.GE bits according to the results. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 1 0 1 0 Rn(4) 1 1 1 1 Rd(4) 0 0 0 0 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm sasx ?reg_D reg_N reg_M } @@ -45,19 +55,23 @@ @word cond(4) 0 1 1 0 0 0 0 1 Rn(4) Rd(4) 1 1 1 1 0 0 1 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - } + } + + @asm sasx ?reg_D reg_N reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/sbc_A88161.d b/plugins/arm/v7/opdefs/sbc_A88161.d index 4ea776a..d085e28 100644 --- a/plugins/arm/v7/opdefs/sbc_A88161.d +++ b/plugins/arm/v7/opdefs/sbc_A88161.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,26 +23,55 @@ @title SBC (immediate) -@desc Subtract with Carry (immediate) subtracts an immediate value and the value of NOT (Carry flag) from a register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. +@id 160 + +@desc { + + Subtract with Carry (immediate) subtracts an immediate value and the value of NOT (Carry flag) from a register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. + +} @encoding (T1) { @word 1 1 1 1 0 i(1) 0 1 0 1 1 S(1) Rn(4) 0 imm3(3) Rd(4) imm8(8) - @syntax <reg_D> <reg_N> <imm32> + @syntax { + + @assert { + + S == 0 + + } + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + imm32 = ThumbExpandImm(i:imm3:imm8) - reg_D = Register(Rd) - reg_N = Register(Rn) - setflags = (S == '1') - imm32 = ThumbExpandImm(i:imm3:imm8) + } + + @asm sbc ?reg_D reg_N imm32 } - @rules { + @syntax { + + @assert { + + S == 1 + + } - if (setflags); chk_call ExtendKeyword("s") + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + imm32 = ThumbExpandImm(i:imm3:imm8) + + } + + @asm sbcs ?reg_D reg_N imm32 } @@ -52,21 +81,55 @@ @word cond(4) 0 0 1 0 1 1 0 S(1) Rn(4) Rd(4) imm12(12) - @syntax <reg_D> <reg_N> <imm32> + @syntax { + + @assert { - @conv { + S == 0 - reg_D = Register(Rd) - reg_N = Register(Rn) - setflags = (S == '1') - imm32 = ARMExpandImm(imm12) + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + imm32 = ARMExpandImm(imm12) + + } + + @asm sbc ?reg_D reg_N imm32 + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + imm32 = ARMExpandImm(imm12) + + } + + @asm sbcs ?reg_D reg_N imm32 + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/sbc_A88162.d b/plugins/arm/v7/opdefs/sbc_A88162.d index b6e660a..1ba7592 100644 --- a/plugins/arm/v7/opdefs/sbc_A88162.d +++ b/plugins/arm/v7/opdefs/sbc_A88162.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,18 +23,29 @@ @title SBC (register) -@desc Subtract with Carry (register) subtracts an optionally-shifted register value and the value of NOT (Carry flag) from a register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. +@id 161 + +@desc { + + Subtract with Carry (register) subtracts an optionally-shifted register value and the value of NOT (Carry flag) from a register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. + +} @encoding (t1) { @half 0 1 0 0 0 0 0 1 1 0 Rm(3) Rdn(3) - @syntax "sbcs" <reg_DN> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rdn) + reg_N = Register(Rdn) + reg_M = Register(Rm) - reg_DN = Register(Rdn) - reg_M = Register(Rm) + } + + @asm sbc ?reg_D reg_N reg_M } @@ -44,22 +55,45 @@ @word 1 1 1 0 1 0 1 1 0 1 1 S(1) Rn(4) 0 imm3(3) Rd(4) imm2(2) type(2) Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <?shift> + @syntax { + + @assert { + + S == 0 + + } - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') - shift = DecodeImmShift(type, imm3:imm2) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm3:imm2) + + } + + @asm sbc.w ?reg_D reg_N reg_M ?shift } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm3:imm2) + + } - if (setflags); chk_call ExtendKeyword("s") - chk_call ExtendKeyword(".w") + @asm sbcs.w ?reg_D reg_N reg_M ?shift } @@ -69,22 +103,57 @@ @word cond(4) 0 0 0 0 1 1 0 S(1) Rn(4) Rd(4) imm5(5) type(2) 0 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <?shift> + @syntax { - @conv { + @assert { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') - shift = DecodeImmShift(type, imm5) + S == 0 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) + + } + + @asm sbc ?reg_D reg_N reg_M ?shift + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) + + } + + @asm sbcs ?reg_D reg_N reg_M ?shift + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/sbc_A88163.d b/plugins/arm/v7/opdefs/sbc_A88163.d index 0500edc..d534ed5 100644 --- a/plugins/arm/v7/opdefs/sbc_A88163.d +++ b/plugins/arm/v7/opdefs/sbc_A88163.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,28 +23,73 @@ @title SBC (register-shifted register) -@desc Subtract with Carry (register-shifted register) subtracts a register-shifted register value and the value of NOT (Carry flag) from a register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. +@id 162 + +@desc { + + Subtract with Carry (register-shifted register) subtracts a register-shifted register value and the value of NOT (Carry flag) from a register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. + +} @encoding (A1) { @word cond(4) 0 0 0 0 1 1 0 S(1) Rn(4) Rd(4) Rs(4) 0 type(2) 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <reg_shift> + @syntax { + + @assert { + + S == 0 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift_t = UInt(type) + reg_S = Register(Rs) + shift = BuildRegShift(shift_t, reg_S) + + } + + @asm sbc ?reg_D reg_N reg_M shift - @conv { + @rules { - reg_shift = RegisterShift(type, Rs) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift_t = UInt(type) + reg_S = Register(Rs) + shift = BuildRegShift(shift_t, reg_S) + + } + + @asm sbcs ?reg_D reg_N reg_M shift + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/sbfx_A88164.d b/plugins/arm/v7/opdefs/sbfx_A88164.d index 486db3c..d834bca 100644 --- a/plugins/arm/v7/opdefs/sbfx_A88164.d +++ b/plugins/arm/v7/opdefs/sbfx_A88164.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,31 @@ @title SBFX -@desc Signed Bit Field Extract extracts any number of adjacent bits at any position from a register, sign-extends them to 32 bits, and writes the result to the destination register. +@id 163 + +@desc { + + Signed Bit Field Extract extracts any number of adjacent bits at any position from a register, sign-extends them to 32 bits, and writes the result to the destination register. + +} @encoding (T1) { @word 1 1 1 1 0 0 1 1 0 1 0 0 Rn(4) 0 imm3(3) Rd(4) imm2(2) 0 widthm1(5) - @syntax <reg_D> <reg_N> <lsbit> <width> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + lsbit = UInt(imm3:imm2) + widthminus1 = UInt(widthm1) + width = MinusBitDiff(widthminus1, lsbit) - reg_D = Register(Rd) - reg_N = Register(Rn) - lsbit = UInt(imm3:imm2) - width = IncWidth(widthm1) + } + + @asm sbfx reg_D reg_N lsbit width } @@ -46,20 +57,25 @@ @word cond(4) 0 1 1 1 1 0 1 widthm1(5) Rd(4) lsb(5) 1 0 1 Rn(4) - @syntax <reg_D> <reg_N> <lsbit> <width> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - lsbit = UInt(lsb) - width = IncWidth(widthm1) + reg_D = Register(Rd) + reg_N = Register(Rn) + lsbit = UInt(lsb) + widthminus1 = UInt(widthm1) + width = MinusBitDiff(widthminus1, lsbit) - } + } + + @asm sbfx reg_D reg_N lsbit width + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/sdiv_A88165.d b/plugins/arm/v7/opdefs/sdiv_A88165.d index 19ebfa9..762b49a 100644 --- a/plugins/arm/v7/opdefs/sdiv_A88165.d +++ b/plugins/arm/v7/opdefs/sdiv_A88165.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title SDIV -@desc Signed Divide divides a 32-bit signed integer register value by a 32-bit signed integer register value, and writes the result to the destination register. The condition flags are not affected. See ARMv7 implementation requirements and options for the divide instructions on page A4-172 for more information about this instruction. +@id 164 + +@desc { + + Signed Divide divides a 32-bit signed integer register value by a 32-bit signed integer register value, and writes the result to the destination register. The condition flags are not affected. See ARMv7 implementation requirements and options for the divide instructions on page A4-172 for more information about this instruction. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 1 1 0 0 1 Rn(4) 1 1 1 1 Rd(4) 1 1 1 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm sdiv ?reg_D reg_N reg_M } @@ -45,19 +55,23 @@ @word cond(4) 0 1 1 1 0 0 0 1 Rd(4) 1 1 1 1 Rm(4) 0 0 0 1 Rn(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - } + } + + @asm sdiv ?reg_D reg_N reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/sel_A88166.d b/plugins/arm/v7/opdefs/sel_A88166.d index cb32ed6..0239ee6 100644 --- a/plugins/arm/v7/opdefs/sel_A88166.d +++ b/plugins/arm/v7/opdefs/sel_A88166.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title SEL -@desc Select Bytes selects each byte of its result from either its first operand or its second operand, according to the values of the GE flags. +@id 165 + +@desc { + + Select Bytes selects each byte of its result from either its first operand or its second operand, according to the values of the GE flags. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 1 0 1 0 Rn(4) 1 1 1 1 Rd(4) 1 0 0 0 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm sel ?reg_D reg_N reg_M } @@ -45,19 +55,23 @@ @word cond(4) 0 1 1 0 1 0 0 0 Rn(4) Rd(4) 1 1 1 1 1 0 1 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - } + } + + @asm sel ?reg_D reg_N reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/setend_A88167.d b/plugins/arm/v7/opdefs/setend_A88167.d index e549c50..ee07bd9 100644 --- a/plugins/arm/v7/opdefs/setend_A88167.d +++ b/plugins/arm/v7/opdefs/setend_A88167.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,17 +23,27 @@ @title SETEND -@desc Set Endianness writes a new value to ENDIANSTATE. +@id 166 + +@desc { + + Set Endianness writes a new value to ENDIANSTATE. + +} @encoding (t1) { @half 1 0 1 1 0 1 1 0 0 1 0 1 E(1) 0 0 0 - @syntax <set_bigend> + @syntax { - @conv { + @conv { - set_bigend = EndianState(E == '1') + endian_specifier = Endian(E) + + } + + @asm setend endian_specifier } @@ -43,11 +53,15 @@ @word 1 1 1 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 E(1) 0 0 0 0 0 0 0 0 0 - @syntax <set_bigend> + @syntax { + + @conv { + + endian_specifier = Endian(E) - @conv { + } - set_bigend = EndianState(E == '1') + @asm setend endian_specifier } diff --git a/plugins/arm/v7/opdefs/sev_A88168.d b/plugins/arm/v7/opdefs/sev_A88168.d index 2bd9af4..cfbebe0 100644 --- a/plugins/arm/v7/opdefs/sev_A88168.d +++ b/plugins/arm/v7/opdefs/sev_A88168.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,35 @@ @title SEV -@desc Send Event is a hint instruction. It causes an event to be signaled to all processors in the multiprocessor system. For more information, see Wait For Event and Send Event on page B1-1199. +@id 167 + +@desc { + + Send Event is a hint instruction. It causes an event to be signaled to all processors in the multiprocessor system. For more information, see Wait For Event and Send Event on page B1-1199. + +} @encoding (t1) { @half 1 0 1 1 1 1 1 1 0 1 0 0 0 0 0 0 + @syntax { + + @asm sev + + } + } @encoding (T2) { @word 1 1 1 1 0 0 1 1 1 0 1 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 - @syntax ".W" + @syntax { + + @asm sev.w + + } } @@ -43,9 +59,15 @@ @word cond(4) 0 0 1 1 0 0 1 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 1 0 0 - @rules { + @syntax { + + @asm sev + + @rules { + + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/shadd16_A88169.d b/plugins/arm/v7/opdefs/shadd16_A88169.d index 22baa05..8453f4b 100644 --- a/plugins/arm/v7/opdefs/shadd16_A88169.d +++ b/plugins/arm/v7/opdefs/shadd16_A88169.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title SHADD16 -@desc Signed Halving Add 16 performs two signed 16-bit integer additions, halves the results, and writes the results to the destination register. +@id 168 + +@desc { + + Signed Halving Add 16 performs two signed 16-bit integer additions, halves the results, and writes the results to the destination register. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 1 0 0 1 Rn(4) 1 1 1 1 Rd(4) 0 0 1 0 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm shadd16 ?reg_D reg_N reg_M } @@ -45,19 +55,23 @@ @word cond(4) 0 1 1 0 0 0 1 1 Rn(4) Rd(4) 1 1 1 1 0 0 0 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - } + } + + @asm shadd16 ?reg_D reg_N reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/shadd8_A88170.d b/plugins/arm/v7/opdefs/shadd8_A88170.d index bfc3031..8623ac9 100644 --- a/plugins/arm/v7/opdefs/shadd8_A88170.d +++ b/plugins/arm/v7/opdefs/shadd8_A88170.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title SHADD8 -@desc Signed Halving Add 8 performs four signed 8-bit integer additions, halves the results, and writes the results to the destination register. +@id 169 + +@desc { + + Signed Halving Add 8 performs four signed 8-bit integer additions, halves the results, and writes the results to the destination register. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 1 0 0 0 Rn(4) 1 1 1 1 Rd(4) 0 0 1 0 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm shadd8 ?reg_D reg_N reg_M } @@ -45,19 +55,23 @@ @word cond(4) 0 1 1 0 0 0 1 1 Rn(4) Rd(4) 1 1 1 1 1 0 0 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - } + } + + @asm shadd8 ?reg_D reg_N reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/shasx_A88171.d b/plugins/arm/v7/opdefs/shasx_A88171.d index 71d241b..9a931cb 100644 --- a/plugins/arm/v7/opdefs/shasx_A88171.d +++ b/plugins/arm/v7/opdefs/shasx_A88171.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title SHASX -@desc Signed Halving Add and Subtract with Exchange exchanges the two halfwords of the second operand, performs one signed 16-bit integer addition and one signed 16-bit subtraction, halves the results, and writes the results to the destination register. +@id 170 + +@desc { + + Signed Halving Add and Subtract with Exchange exchanges the two halfwords of the second operand, performs one signed 16-bit integer addition and one signed 16-bit subtraction, halves the results, and writes the results to the destination register. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 1 0 1 0 Rn(4) 1 1 1 1 Rd(4) 0 0 1 0 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm shasx ?reg_D reg_N reg_M } @@ -45,19 +55,23 @@ @word cond(4) 0 1 1 0 0 0 1 1 Rn(4) Rd(4) 1 1 1 1 0 0 1 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - } + } + + @asm shasx ?reg_D reg_N reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/shsax_A88172.d b/plugins/arm/v7/opdefs/shsax_A88172.d index 8794738..69369d5 100644 --- a/plugins/arm/v7/opdefs/shsax_A88172.d +++ b/plugins/arm/v7/opdefs/shsax_A88172.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title SHSAX -@desc Signed Halving Subtract and Add with Exchange exchanges the two halfwords of the second operand, performs one signed 16-bit integer subtraction and one signed 16-bit addition, halves the results, and writes the results to the destination register. +@id 171 + +@desc { + + Signed Halving Subtract and Add with Exchange exchanges the two halfwords of the second operand, performs one signed 16-bit integer subtraction and one signed 16-bit addition, halves the results, and writes the results to the destination register. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 1 1 1 0 Rn(4) 1 1 1 1 Rd(4) 0 0 1 0 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm shsax ?reg_D reg_N reg_M } @@ -45,19 +55,23 @@ @word cond(4) 0 1 1 0 0 0 1 1 Rn(4) Rd(4) 1 1 1 1 0 1 0 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - } + } + + @asm shsax ?reg_D reg_N reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/shsub16_A88173.d b/plugins/arm/v7/opdefs/shsub16_A88173.d index f7099f2..db35320 100644 --- a/plugins/arm/v7/opdefs/shsub16_A88173.d +++ b/plugins/arm/v7/opdefs/shsub16_A88173.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title SHSUB16 -@desc Signed Halving Subtract 16 performs two signed 16-bit integer subtractions, halves the results, and writes the results to the destination register. +@id 172 + +@desc { + + Signed Halving Subtract 16 performs two signed 16-bit integer subtractions, halves the results, and writes the results to the destination register. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 1 1 0 1 Rn(4) 1 1 1 1 Rd(4) 0 0 1 0 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm shsub16 ?reg_D reg_N reg_M } @@ -45,19 +55,23 @@ @word cond(4) 0 1 1 0 0 0 1 1 Rn(4) Rd(4) 1 1 1 1 0 1 1 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - } + } + + @asm shsub16 ?reg_D reg_N reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/shsub8_A88174.d b/plugins/arm/v7/opdefs/shsub8_A88174.d index 99af65d..0d1b93c 100644 --- a/plugins/arm/v7/opdefs/shsub8_A88174.d +++ b/plugins/arm/v7/opdefs/shsub8_A88174.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title SHSUB8 -@desc Signed Halving Subtract 8 performs four signed 8-bit integer subtractions, halves the results, and writes the results to the destination register. +@id 173 + +@desc { + + Signed Halving Subtract 8 performs four signed 8-bit integer subtractions, halves the results, and writes the results to the destination register. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 1 1 0 0 Rn(4) 1 1 1 1 Rd(4) 0 0 1 0 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm shsub8 ?reg_D reg_N reg_M } @@ -45,19 +55,23 @@ @word cond(4) 0 1 1 0 0 0 1 1 Rn(4) Rd(4) 1 1 1 1 1 1 1 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - } + } + + @asm shsub8 ?reg_D reg_N reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/smlad_A88177.d b/plugins/arm/v7/opdefs/smlad_A88177.d index 3eabaa9..da02029 100644 --- a/plugins/arm/v7/opdefs/smlad_A88177.d +++ b/plugins/arm/v7/opdefs/smlad_A88177.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,27 +23,57 @@ @title SMLAD -@desc Signed Multiply Accumulate Dual performs two signed 16 × 16-bit multiplications. It adds the products to a 32-bit accumulate operand. Optionally, the instruction can exchange the halfwords of the second operand before performing the arithmetic. This produces top × bottom and bottom × top multiplication. This instruction sets the Q flag if the accumulate operation overflows. Overflow cannot occur during the multiplications. +@id 176 + +@desc { + + Signed Multiply Accumulate Dual performs two signed 16 × 16-bit multiplications. It adds the products to a 32-bit accumulate operand. Optionally, the instruction can exchange the halfwords of the second operand before performing the arithmetic. This produces top × bottom and bottom × top multiplication. This instruction sets the Q flag if the accumulate operation overflows. Overflow cannot occur during the multiplications. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 1 0 0 1 0 Rn(4) Ra(4) Rd(4) 0 0 0 M(1) Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <reg_A> + @syntax { + + @assert { + + M == 0 + + } + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + reg_A = Register(Ra) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - reg_A = Register(Ra) - m_swap = (M == '1') + } + + @asm smlad reg_D reg_N reg_M reg_A } - @rules { + @syntax { + + @assert { + + M == 1 + + } - if (m_swap); chk_call ExtendKeyword("x") + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + reg_A = Register(Ra) + + } + + @asm smladx reg_D reg_N reg_M reg_A } @@ -53,22 +83,57 @@ @word cond(4) 0 1 1 1 0 0 0 0 Rd(4) Ra(4) Rm(4) 0 0 M(1) 1 Rn(4) - @syntax <reg_D> <reg_N> <reg_M> <reg_A> + @syntax { + + @assert { - @conv { + M == 0 - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - reg_A = Register(Ra) - m_swap = (M == '1') + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + reg_A = Register(Ra) + + } + + @asm smlad reg_D reg_N reg_M reg_A + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + M == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + reg_A = Register(Ra) + + } + + @asm smladx reg_D reg_N reg_M reg_A + + @rules { + + check g_arm_instruction_set_cond(cond) - if (m_swap); chk_call ExtendKeyword("x") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/smlal_A88178.d b/plugins/arm/v7/opdefs/smlal_A88178.d index 03da53c..0b79de9 100644 --- a/plugins/arm/v7/opdefs/smlal_A88178.d +++ b/plugins/arm/v7/opdefs/smlal_A88178.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title SMLAL -@desc Signed Multiply Accumulate Long multiplies two signed 32-bit values to produce a 64-bit value, and accumulates this with a 64-bit value. In ARM instructions, the condition flags can optionally be updated based on the result. Use of this option adversely affects performance on many processor implementations. +@id 177 + +@desc { + + Signed Multiply Accumulate Long multiplies two signed 32-bit values to produce a 64-bit value, and accumulates this with a 64-bit value. In ARM instructions, the condition flags can optionally be updated based on the result. Use of this option adversely affects performance on many processor implementations. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 1 1 1 0 0 Rn(4) RdLo(4) RdHi(4) 0 0 0 0 Rm(4) - @syntax <reg_DLO> <reg_DHI> <reg_N> <reg_M> + @syntax { + + @conv { + + reg_DLO = Register(RdLo) + reg_DHI = Register(RdHi) + reg_N = Register(Rn) + reg_M = Register(Rm) - @conv { + } - reg_DLO = Register(RdLo) - reg_DHI = Register(RdHi) - reg_N = Register(Rn) - reg_M = Register(Rm) + @asm smlal reg_DLO reg_DHI reg_N reg_M } @@ -46,22 +56,57 @@ @word cond(4) 0 0 0 0 1 1 1 S(1) RdHi(4) RdLo(4) Rm(4) 1 0 0 1 Rn(4) - @syntax <reg_DLO> <reg_DHI> <reg_N> <reg_M> + @syntax { + + @assert { + + S == 0 + + } + + @conv { + + reg_DLO = Register(RdLo) + reg_DHI = Register(RdHi) + reg_N = Register(Rn) + reg_M = Register(Rm) + + } - @conv { + @asm smlal reg_DLO reg_DHI reg_N reg_M - reg_DLO = Register(RdLo) - reg_DHI = Register(RdHi) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_DLO = Register(RdLo) + reg_DHI = Register(RdHi) + reg_N = Register(Rn) + reg_M = Register(Rm) + + } + + @asm smlals reg_DLO reg_DHI reg_N reg_M + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/smlald_A88180.d b/plugins/arm/v7/opdefs/smlald_A88180.d index fa6a473..16353d2 100644 --- a/plugins/arm/v7/opdefs/smlald_A88180.d +++ b/plugins/arm/v7/opdefs/smlald_A88180.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,27 +23,57 @@ @title SMLALD -@desc Signed Multiply Accumulate Long Dual performs two signed 16 × 16-bit multiplications. It adds the products to a 64-bit accumulate operand. Optionally, the instruction can exchange the halfwords of the second operand before performing the arithmetic. This produces top × bottom and bottom × top multiplication. Overflow is possible during this instruction, but only as a result of the 64-bit addition. This overflow is not detected if it occurs. Instead, the result wraps around modulo 264. +@id 179 + +@desc { + + Signed Multiply Accumulate Long Dual performs two signed 16 × 16-bit multiplications. It adds the products to a 64-bit accumulate operand. Optionally, the instruction can exchange the halfwords of the second operand before performing the arithmetic. This produces top × bottom and bottom × top multiplication. Overflow is possible during this instruction, but only as a result of the 64-bit addition. This overflow is not detected if it occurs. Instead, the result wraps around modulo 264. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 1 1 1 0 0 Rn(4) RdLo(4) RdHi(4) 1 1 0 M(1) Rm(4) - @syntax <reg_DLO> <reg_DHI> <reg_N> <reg_M> + @syntax { + + @assert { + + M == 0 + + } + + @conv { - @conv { + reg_DLO = Register(RdLo) + reg_DHI = Register(RdHi) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_DLO = Register(RdLo) - reg_DHI = Register(RdHi) - reg_N = Register(Rn) - reg_M = Register(Rm) - m_swap = (M == '1') + } + + @asm smlald reg_DLO reg_DHI reg_N reg_M } - @rules { + @syntax { + + @assert { + + M == 1 + + } - if (m_swap); chk_call ExtendKeyword("x") + @conv { + + reg_DLO = Register(RdLo) + reg_DHI = Register(RdHi) + reg_N = Register(Rn) + reg_M = Register(Rm) + + } + + @asm smlaldx reg_DLO reg_DHI reg_N reg_M } @@ -53,22 +83,57 @@ @word cond(4) 0 1 1 1 0 1 0 0 RdHi(4) RdLo(4) Rm(4) 0 0 M(1) 1 Rn(4) - @syntax <reg_DLO> <reg_DHI> <reg_N> <reg_M> + @syntax { + + @assert { - @conv { + M == 0 - reg_DLO = Register(RdLo) - reg_DHI = Register(RdHi) - reg_N = Register(Rn) - reg_M = Register(Rm) - m_swap = (M == '1') + } + + @conv { + + reg_DLO = Register(RdLo) + reg_DHI = Register(RdHi) + reg_N = Register(Rn) + reg_M = Register(Rm) + + } + + @asm smlald reg_DLO reg_DHI reg_N reg_M + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + M == 1 + + } + + @conv { + + reg_DLO = Register(RdLo) + reg_DHI = Register(RdHi) + reg_N = Register(Rn) + reg_M = Register(Rm) + + } + + @asm smlaldx reg_DLO reg_DHI reg_N reg_M + + @rules { + + check g_arm_instruction_set_cond(cond) - if (m_swap); chk_call ExtendKeyword("x") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/smlsd_A88182.d b/plugins/arm/v7/opdefs/smlsd_A88182.d index d458fa8..5808518 100644 --- a/plugins/arm/v7/opdefs/smlsd_A88182.d +++ b/plugins/arm/v7/opdefs/smlsd_A88182.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,27 +23,57 @@ @title SMLSD -@desc Signed Multiply Subtract Dual performs two signed 16 × 16-bit multiplications. It adds the difference of the products to a 32-bit accumulate operand. Optionally, the instruction can exchange the halfwords of the second operand before performing the arithmetic. This produces top × bottom and bottom × top multiplication. This instruction sets the Q flag if the accumulate operation overflows. Overflow cannot occur during the multiplications or subtraction. +@id 181 + +@desc { + + Signed Multiply Subtract Dual performs two signed 16 × 16-bit multiplications. It adds the difference of the products to a 32-bit accumulate operand. Optionally, the instruction can exchange the halfwords of the second operand before performing the arithmetic. This produces top × bottom and bottom × top multiplication. This instruction sets the Q flag if the accumulate operation overflows. Overflow cannot occur during the multiplications or subtraction. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 1 0 1 0 0 Rn(4) Ra(4) Rd(4) 0 0 0 M(1) Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <reg_A> + @syntax { + + @assert { + + M == 0 + + } + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + reg_A = Register(Ra) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - reg_A = Register(Ra) - m_swap = (M == '1') + } + + @asm smlsd reg_D reg_N reg_M reg_A } - @rules { + @syntax { + + @assert { + + M == 1 + + } - if (m_swap); chk_call ExtendKeyword("x") + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + reg_A = Register(Ra) + + } + + @asm smlsdx reg_D reg_N reg_M reg_A } @@ -53,22 +83,57 @@ @word cond(4) 0 1 1 1 0 0 0 0 Rd(4) Ra(4) Rm(4) 0 1 M(1) 1 Rn(4) - @syntax <reg_D> <reg_N> <reg_M> <reg_A> + @syntax { + + @assert { - @conv { + M == 0 - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - reg_A = Register(Ra) - m_swap = (M == '1') + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + reg_A = Register(Ra) + + } + + @asm smlsd reg_D reg_N reg_M reg_A + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + M == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + reg_A = Register(Ra) + + } + + @asm smlsdx reg_D reg_N reg_M reg_A + + @rules { + + check g_arm_instruction_set_cond(cond) - if (m_swap); chk_call ExtendKeyword("x") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/smlsld_A88183.d b/plugins/arm/v7/opdefs/smlsld_A88183.d index 9f64eed..995fb6f 100644 --- a/plugins/arm/v7/opdefs/smlsld_A88183.d +++ b/plugins/arm/v7/opdefs/smlsld_A88183.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,27 +23,57 @@ @title SMLSLD -@desc Signed Multiply Subtract Long Dual performs two signed 16 × 16-bit multiplications. It adds the difference of the products to a 64-bit accumulate operand. Optionally, the instruction can exchange the halfwords of the second operand before performing the arithmetic. This produces top × bottom and bottom × top multiplication. Overflow is possible during this instruction, but only as a result of the 64-bit addition. This overflow is not detected if it occurs. Instead, the result wraps around modulo 264. +@id 182 + +@desc { + + Signed Multiply Subtract Long Dual performs two signed 16 × 16-bit multiplications. It adds the difference of the products to a 64-bit accumulate operand. Optionally, the instruction can exchange the halfwords of the second operand before performing the arithmetic. This produces top × bottom and bottom × top multiplication. Overflow is possible during this instruction, but only as a result of the 64-bit addition. This overflow is not detected if it occurs. Instead, the result wraps around modulo 264. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 1 1 1 0 1 Rn(4) RdLo(4) RdHi(4) 1 1 0 M(1) Rm(4) - @syntax <reg_DLO> <reg_DHI> <reg_N> <reg_M> + @syntax { + + @assert { + + M == 0 + + } + + @conv { - @conv { + reg_DLO = Register(RdLo) + reg_DHI = Register(RdHi) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_DLO = Register(RdLo) - reg_DHI = Register(RdHi) - reg_N = Register(Rn) - reg_M = Register(Rm) - m_swap = (M == '1') + } + + @asm smlsld reg_DLO reg_DHI reg_N reg_M } - @rules { + @syntax { + + @assert { + + M == 1 + + } - if (m_swap); chk_call ExtendKeyword("x") + @conv { + + reg_DLO = Register(RdLo) + reg_DHI = Register(RdHi) + reg_N = Register(Rn) + reg_M = Register(Rm) + + } + + @asm smlsldx reg_DLO reg_DHI reg_N reg_M } @@ -53,22 +83,57 @@ @word cond(4) 0 1 1 1 0 1 0 0 RdHi(4) RdLo(4) Rm(4) 0 1 M(1) 1 Rn(4) - @syntax <reg_DLO> <reg_DHI> <reg_N> <reg_M> + @syntax { + + @assert { - @conv { + M == 0 - reg_DLO = Register(RdLo) - reg_DHI = Register(RdHi) - reg_N = Register(Rn) - reg_M = Register(Rm) - m_swap = (M == '1') + } + + @conv { + + reg_DLO = Register(RdLo) + reg_DHI = Register(RdHi) + reg_N = Register(Rn) + reg_M = Register(Rm) + + } + + @asm smlsld reg_DLO reg_DHI reg_N reg_M + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + M == 1 + + } + + @conv { + + reg_DLO = Register(RdLo) + reg_DHI = Register(RdHi) + reg_N = Register(Rn) + reg_M = Register(Rm) + + } + + @asm smlsldx reg_DLO reg_DHI reg_N reg_M + + @rules { + + check g_arm_instruction_set_cond(cond) - if (m_swap); chk_call ExtendKeyword("x") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/smmla_A88184.d b/plugins/arm/v7/opdefs/smmla_A88184.d index a4d29b8..40bd005 100644 --- a/plugins/arm/v7/opdefs/smmla_A88184.d +++ b/plugins/arm/v7/opdefs/smmla_A88184.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,27 +23,57 @@ @title SMMLA -@desc Signed Most Significant Word Multiply Accumulate multiplies two signed 32-bit values, extracts the most significant 32 bits of the result, and adds an accumulate value. Optionally, the instruction can specify that the result is rounded instead of being truncated. In this case, the constant 0x80000000 is added to the product before the high word is extracted. +@id 183 + +@desc { + + Signed Most Significant Word Multiply Accumulate multiplies two signed 32-bit values, extracts the most significant 32 bits of the result, and adds an accumulate value. Optionally, the instruction can specify that the result is rounded instead of being truncated. In this case, the constant 0x80000000 is added to the product before the high word is extracted. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 1 0 1 0 1 Rn(4) Ra(4) Rd(4) 0 0 0 R(1) Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <reg_A> + @syntax { + + @assert { + + R == 0 + + } + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + reg_A = Register(Ra) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - reg_A = Register(Ra) - round = (R == '1') + } + + @asm smmla reg_D reg_N reg_M reg_A } - @rules { + @syntax { + + @assert { + + R == 1 + + } - if (round); chk_call ExtendKeyword("r") + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + reg_A = Register(Ra) + + } + + @asm smmlar reg_D reg_N reg_M reg_A } @@ -53,22 +83,57 @@ @word cond(4) 0 1 1 1 0 1 0 1 Rd(4) Ra(4) Rm(4) 0 0 R(1) 1 Rn(4) - @syntax <reg_D> <reg_N> <reg_M> <reg_A> + @syntax { + + @assert { - @conv { + R == 0 - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - reg_A = Register(Ra) - round = (R == '1') + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + reg_A = Register(Ra) + + } + + @asm smmla reg_D reg_N reg_M reg_A + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + R == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + reg_A = Register(Ra) + + } + + @asm smmlar reg_D reg_N reg_M reg_A + + @rules { + + check g_arm_instruction_set_cond(cond) - if (round); chk_call ExtendKeyword("r") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/smmls_A88185.d b/plugins/arm/v7/opdefs/smmls_A88185.d index d59617b..9bc5396 100644 --- a/plugins/arm/v7/opdefs/smmls_A88185.d +++ b/plugins/arm/v7/opdefs/smmls_A88185.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,27 +23,57 @@ @title SMMLS -@desc Signed Most Significant Word Multiply Subtract multiplies two signed 32-bit values, subtracts the result from a 32-bit accumulate value that is shifted left by 32 bits, and extracts the most significant 32 bits of the result of that subtraction. Optionally, the instruction can specify that the result of the instruction is rounded instead of being truncated. In this case, the constant 0x80000000 is added to the result of the subtraction before the high word is extracted. +@id 184 + +@desc { + + Signed Most Significant Word Multiply Subtract multiplies two signed 32-bit values, subtracts the result from a 32-bit accumulate value that is shifted left by 32 bits, and extracts the most significant 32 bits of the result of that subtraction. Optionally, the instruction can specify that the result of the instruction is rounded instead of being truncated. In this case, the constant 0x80000000 is added to the result of the subtraction before the high word is extracted. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 1 0 1 1 0 Rn(4) Ra(4) Rd(4) 0 0 0 R(1) Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <reg_A> + @syntax { + + @assert { + + R == 0 + + } + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + reg_A = Register(Ra) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - reg_A = Register(Ra) - round = (R == '1') + } + + @asm smmls reg_D reg_N reg_M reg_A } - @rules { + @syntax { + + @assert { + + R == 1 + + } - if (round); chk_call ExtendKeyword("r") + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + reg_A = Register(Ra) + + } + + @asm smmlsr reg_D reg_N reg_M reg_A } @@ -53,22 +83,57 @@ @word cond(4) 0 1 1 1 0 1 0 1 Rd(4) Ra(4) Rm(4) 1 1 R(1) 1 Rn(4) - @syntax <reg_D> <reg_N> <reg_M> <reg_A> + @syntax { + + @assert { - @conv { + R == 0 - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - reg_A = Register(Ra) - round = (R == '1') + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + reg_A = Register(Ra) + + } + + @asm smmls reg_D reg_N reg_M reg_A + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + R == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + reg_A = Register(Ra) + + } + + @asm smmlsr reg_D reg_N reg_M reg_A + + @rules { + + check g_arm_instruction_set_cond(cond) - if (round); chk_call ExtendKeyword("r") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/smmul_A88186.d b/plugins/arm/v7/opdefs/smmul_A88186.d index e02ca52..44a8b9b 100644 --- a/plugins/arm/v7/opdefs/smmul_A88186.d +++ b/plugins/arm/v7/opdefs/smmul_A88186.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,26 +23,55 @@ @title SMMUL -@desc Signed Most Significant Word Multiply multiplies two signed 32-bit values, extracts the most significant 32 bits of the result, and writes those bits to the destination register. Optionally, the instruction can specify that the result is rounded instead of being truncated. In this case, the constant 0x80000000 is added to the product before the high word is extracted. +@id 185 + +@desc { + + Signed Most Significant Word Multiply multiplies two signed 32-bit values, extracts the most significant 32 bits of the result, and writes those bits to the destination register. Optionally, the instruction can specify that the result is rounded instead of being truncated. In this case, the constant 0x80000000 is added to the product before the high word is extracted. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 1 0 1 0 1 Rn(4) 1 1 1 1 Rd(4) 0 0 0 R(1) Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @assert { + + R == 0 + + } + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - round = (R == '1') + } + + @asm smmul ?reg_D reg_N reg_M } - @rules { + @syntax { + + @assert { + + R == 1 + + } - if (round); chk_call ExtendKeyword("r") + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + + } + + @asm smmulr ?reg_D reg_N reg_M } @@ -52,21 +81,55 @@ @word cond(4) 0 1 1 1 0 1 0 1 Rd(4) 1 1 1 1 Rm(4) 0 0 R(1) 1 Rn(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @assert { - @conv { + R == 0 - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - round = (R == '1') + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + + } + + @asm smmul ?reg_D reg_N reg_M + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + R == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + + } + + @asm smmulr ?reg_D reg_N reg_M + + @rules { + + check g_arm_instruction_set_cond(cond) - if (round); chk_call ExtendKeyword("r") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/smuad_A88187.d b/plugins/arm/v7/opdefs/smuad_A88187.d index 324e257..a10c279 100644 --- a/plugins/arm/v7/opdefs/smuad_A88187.d +++ b/plugins/arm/v7/opdefs/smuad_A88187.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,26 +23,55 @@ @title SMUAD -@desc Signed Dual Multiply Add performs two signed 16 × 16-bit multiplications. It adds the products together, and writes the result to the destination register. Optionally, the instruction can exchange the halfwords of the second operand before performing the arithmetic. This produces top × bottom and bottom × top multiplication. This instruction sets the Q flag if the addition overflows. The multiplications cannot overflow. +@id 186 + +@desc { + + Signed Dual Multiply Add performs two signed 16 × 16-bit multiplications. It adds the products together, and writes the result to the destination register. Optionally, the instruction can exchange the halfwords of the second operand before performing the arithmetic. This produces top × bottom and bottom × top multiplication. This instruction sets the Q flag if the addition overflows. The multiplications cannot overflow. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 1 0 0 1 0 Rn(4) 1 1 1 1 Rd(4) 0 0 0 M(1) Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @assert { + + M == 0 + + } + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - m_swap = (M == '1') + } + + @asm smuad ?reg_D reg_N reg_M } - @rules { + @syntax { + + @assert { + + M == 1 + + } - if (m_swap); chk_call ExtendKeyword("x") + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + + } + + @asm smuadx ?reg_D reg_N reg_M } @@ -52,21 +81,55 @@ @word cond(4) 0 1 1 1 0 0 0 0 Rd(4) 1 1 1 1 Rm(4) 0 0 M(1) 1 Rn(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @assert { - @conv { + M == 0 - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - m_swap = (M == '1') + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + + } + + @asm smuad ?reg_D reg_N reg_M + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + M == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + + } + + @asm smuadx ?reg_D reg_N reg_M + + @rules { + + check g_arm_instruction_set_cond(cond) - if (m_swap); chk_call ExtendKeyword("x") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/smull_A88189.d b/plugins/arm/v7/opdefs/smull_A88189.d index 5ab1c54..c0a186e 100644 --- a/plugins/arm/v7/opdefs/smull_A88189.d +++ b/plugins/arm/v7/opdefs/smull_A88189.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title SMULL -@desc Signed Multiply Long multiplies two 32-bit signed values to produce a 64-bit result. In ARM instructions, the condition flags can optionally be updated based on the result. Use of this option adversely affects performance on many processor implementations. +@id 188 + +@desc { + + Signed Multiply Long multiplies two 32-bit signed values to produce a 64-bit result. In ARM instructions, the condition flags can optionally be updated based on the result. Use of this option adversely affects performance on many processor implementations. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 1 1 0 0 0 Rn(4) RdLo(4) RdHi(4) 0 0 0 0 Rm(4) - @syntax <reg_DLO> <reg_DHI> <reg_N> <reg_M> + @syntax { + + @conv { + + reg_DLO = Register(RdLo) + reg_DHI = Register(RdHi) + reg_N = Register(Rn) + reg_M = Register(Rm) - @conv { + } - reg_DLO = Register(RdLo) - reg_DHI = Register(RdHi) - reg_N = Register(Rn) - reg_M = Register(Rm) + @asm smull reg_DLO reg_DHI reg_N reg_M } @@ -46,22 +56,57 @@ @word cond(4) 0 0 0 0 1 1 0 S(1) RdHi(4) RdLo(4) Rm(4) 1 0 0 1 Rn(4) - @syntax <reg_DLO> <reg_DHI> <reg_N> <reg_M> + @syntax { + + @assert { + + S == 0 + + } + + @conv { + + reg_DLO = Register(RdLo) + reg_DHI = Register(RdHi) + reg_N = Register(Rn) + reg_M = Register(Rm) + + } - @conv { + @asm smull reg_DLO reg_DHI reg_N reg_M - reg_DLO = Register(RdLo) - reg_DHI = Register(RdHi) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_DLO = Register(RdLo) + reg_DHI = Register(RdHi) + reg_N = Register(Rn) + reg_M = Register(Rm) + + } + + @asm smulls reg_DLO reg_DHI reg_N reg_M + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/str_A88203.d b/plugins/arm/v7/opdefs/str_A88203.d index e3feaf7..f8b4958 100644 --- a/plugins/arm/v7/opdefs/str_A88203.d +++ b/plugins/arm/v7/opdefs/str_A88203.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title STR (immediate, Thumb) -@desc Store Register (immediate) calculates an address from a base register value and an immediate offset, and stores a word from a register to memory. It can use offset, post-indexed, or pre-indexed addressing. For information about memory accesses see Memory accesses on page A8-294. +@id 202 + +@desc { + + Store Register (immediate) calculates an address from a base register value and an immediate offset, and stores a word from a register to memory. It can use offset, post-indexed, or pre-indexed addressing. For information about memory accesses see Memory accesses on page A8-294. + +} @encoding (t1) { @half 0 1 1 0 0 imm5(5) Rn(3) Rt(3) - @syntax <reg_T> <mem_access> + @syntax { + + @conv { - @conv { + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm5:'00', 32) + maccess = MemAccessOffset(reg_N, imm32) - reg_T = Register(Rt) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm5:'00', 32) - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, true, true, false) + } + + @asm str reg_T maccess } @@ -46,14 +56,18 @@ @half 1 0 0 1 0 Rt(3) imm8(8) - @syntax <reg_T> <mem_access> + @syntax { + + @conv { - @conv { + reg_T = Register(Rt) + reg_N = Register(13) + imm32 = ZeroExtend(imm8:'00', 32) + maccess = MemAccessOffset(reg_N, imm32) - reg_T = Register(Rt) - imm32 = ZeroExtend(imm8:'00', 32) - SP = Register(13) - mem_access = MakeMemoryAccess(SP, imm32, NULL, true, true, false) + } + + @asm str reg_T maccess } @@ -63,14 +77,18 @@ @word 1 1 1 1 1 0 0 0 1 1 0 0 Rn(4) Rt(4) imm12(12) - @syntax ".W" <reg_T> <mem_access> + @syntax { + + @conv { - @conv { + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm12, 32) + maccess = MemAccessOffset(reg_N, imm32) - reg_T = Register(Rt) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm12, 32) - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, true, true, false) + } + + @asm str.w reg_T maccess } @@ -80,17 +98,69 @@ @word 1 1 1 1 1 0 0 0 0 1 0 0 Rn(4) Rt(4) 1 P(1) U(1) W(1) imm8(8) - @syntax <reg_T> <mem_access> + @syntax { + + @assert { + + P == 1 + W == 0 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8, 32) + maccess = MemAccessOffset(reg_N, imm32) + + } + + @asm str reg_T maccess + + } + + @syntax { + + @assert { + + P == 1 + W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8, 32) + maccess = MemAccessPreIndexed(reg_N, imm32) + + } + + @asm str reg_T maccess + + } + + @syntax { + + @assert { + + P == 0 + W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8, 32) + maccess = MemAccessPostIndexed(reg_N, imm32) - @conv { + } - reg_T = Register(Rt) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm8, 32) - index = (P == '1') - add = (U == '1') - wback = (W == '1') - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, index, add, wback) + @asm str reg_T maccess } diff --git a/plugins/arm/v7/opdefs/str_A88204.d b/plugins/arm/v7/opdefs/str_A88204.d index d780ae3..0818631 100644 --- a/plugins/arm/v7/opdefs/str_A88204.d +++ b/plugins/arm/v7/opdefs/str_A88204.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,29 +23,99 @@ @title STR (immediate, ARM) -@desc Store Register (immediate) calculates an address from a base register value and an immediate offset, and stores a word from a register to memory. It can use offset, post-indexed, or pre-indexed addressing. For information about memory accesses see Memory accesses on page A8-294. +@id 203 + +@desc { + + Store Register (immediate) calculates an address from a base register value and an immediate offset, and stores a word from a register to memory. It can use offset, post-indexed, or pre-indexed addressing. For information about memory accesses see Memory accesses on page A8-294. + +} @encoding (A1) { @word cond(4) 0 1 0 P(1) U(1) 0 W(1) 0 Rn(4) Rt(4) imm12(12) - @syntax <reg_T> <mem_access> + @syntax { + + @assert { + + P == 1 + P == 1 && W == 0 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm12, 32) + maccess = MemAccessOffset(reg_N, imm32) + + } + + @asm str reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) + + } + + } + + @syntax { - @conv { + @assert { - reg_T = Register(Rt) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm12, 32) - index = (P == '1') - add = (U == '1') - wback = (P == '0') || (W == '1') - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, index, add, wback) + P == 1 + P == 0 || W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm12, 32) + maccess = MemAccessPreIndexed(reg_N, imm32) + + } + + @asm str reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + P == 0 + P == 0 || W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm12, 32) + maccess = MemAccessPostIndexed(reg_N, imm32) + + } + + @asm str reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/str_A88205.d b/plugins/arm/v7/opdefs/str_A88205.d index 55f154c..e4eb6fb 100644 --- a/plugins/arm/v7/opdefs/str_A88205.d +++ b/plugins/arm/v7/opdefs/str_A88205.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title STR (register) -@desc Store Register (register) calculates an address from a base register value and an offset register value, stores a word from a register to memory. The offset register value can optionally be shifted. For information about memory accesses see Memory accesses on page A8-294. +@id 204 + +@desc { + + Store Register (register) calculates an address from a base register value and an offset register value, stores a word from a register to memory. The offset register value can optionally be shifted. For information about memory accesses see Memory accesses on page A8-294. + +} @encoding (t1) { @half 0 1 0 1 0 0 0 Rm(3) Rn(3) Rt(3) - @syntax <reg_T> <mem_access> + @syntax { + + @conv { - @conv { + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + maccess = MemAccessOffset(reg_N, reg_M) - reg_T = Register(Rt) - reg_N = Register(Rn) - reg_M = Register(Rm) - mem_access = MakeMemoryAccess(reg_N, reg_M, NULL, true, true, false) + } + + @asm str reg_T maccess } @@ -46,15 +56,19 @@ @word 1 1 1 1 1 0 0 0 0 1 0 0 Rn(4) Rt(4) 0 0 0 0 0 0 imm2(2) Rm(4) - @syntax ".W" <reg_T> <mem_access> + @syntax { + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = FixedShift(SRType_LSL, imm2) + maccess = MemAccessOffsetExtended(reg_N, reg_M, shift) - @conv { + } - reg_T = Register(Rt) - reg_N = Register(Rn) - reg_M = Register(Rm) - shift = DecodeImmShift(0, imm2) - mem_access = MakeMemoryAccess(reg_N, reg_M, shift, true, true, false) + @asm str.w reg_T maccess } @@ -64,24 +78,90 @@ @word cond(4) 0 1 1 P(1) U(1) 0 W(1) 0 Rn(4) Rt(4) imm5(5) type(2) 0 Rm(4) - @syntax <reg_T> <mem_access> + @syntax { + + @assert { + + P == 1 + P == 1 && W == 0 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) + maccess = MemAccessOffsetExtended(reg_N, reg_M, shift) + + } + + @asm str reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) + + } + + } + + @syntax { + + @assert { + + P == 1 + P == 0 || W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) + maccess = MemAccessPreIndexedExtended(reg_N, reg_M, shift) + + } + + @asm str reg_T maccess + + @rules { - @conv { + check g_arm_instruction_set_cond(cond) - reg_T = Register(Rt) - reg_N = Register(Rn) - reg_M = Register(Rm) - index = (P == '1') - add = (U == '1') - wback = (P == '0') || (W == '1') - shift = DecodeImmShift(type, imm5) - mem_access = MakeMemoryAccess(reg_N, reg_M, shift, index, add, wback) + } } - @rules { + @syntax { + + @assert { + + P == 0 + P == 0 || W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) + maccess = MemAccessPostIndexedExtended(reg_N, reg_M, shift) + + } + + @asm str reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/strb_A88206.d b/plugins/arm/v7/opdefs/strb_A88206.d index 2caf94c..ed21cc9 100644 --- a/plugins/arm/v7/opdefs/strb_A88206.d +++ b/plugins/arm/v7/opdefs/strb_A88206.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title STRB (immediate, Thumb) -@desc Store Register Byte (immediate) calculates an address from a base register value and an immediate offset, and stores a byte from a register to memory. It can use offset, post-indexed, or pre-indexed addressing. For information about memory accesses see Memory accesses on page A8-294. +@id 205 + +@desc { + + Store Register Byte (immediate) calculates an address from a base register value and an immediate offset, and stores a byte from a register to memory. It can use offset, post-indexed, or pre-indexed addressing. For information about memory accesses see Memory accesses on page A8-294. + +} @encoding (t1) { @half 0 1 1 1 0 imm5(5) Rn(3) Rt(3) - @syntax <reg_T> <mem_access> + @syntax { + + @conv { - @conv { + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm5, 32) + maccess = MemAccessOffset(reg_N, imm32) - reg_T = Register(Rt) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm5, 32) - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, true, true, false) + } + + @asm strb reg_T maccess } @@ -46,14 +56,18 @@ @word 1 1 1 1 1 0 0 0 1 0 0 0 Rn(4) Rt(4) imm12(12) - @syntax ".W" <reg_T> <mem_access> + @syntax { + + @conv { - @conv { + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm12, 32) + maccess = MemAccessOffset(reg_N, imm32) - reg_T = Register(Rt) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm12, 32) - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, true, true, false) + } + + @asm strb.w reg_T maccess } @@ -63,17 +77,69 @@ @word 1 1 1 1 1 0 0 0 0 0 0 0 Rn(4) Rt(4) 1 P(1) U(1) W(1) imm8(8) - @syntax <reg_T> <mem_access> + @syntax { + + @assert { + + P == 1 + W == 0 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8, 32) + maccess = MemAccessOffset(reg_N, imm32) + + } + + @asm strb reg_T maccess + + } + + @syntax { + + @assert { + + P == 1 + W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8, 32) + maccess = MemAccessPreIndexed(reg_N, imm32) + + } + + @asm strb reg_T maccess + + } + + @syntax { + + @assert { + + P == 0 + W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8, 32) + maccess = MemAccessPostIndexed(reg_N, imm32) - @conv { + } - reg_T = Register(Rt) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm8, 32) - index = (P == '1') - add = (U == '1') - wback = (W == '1') - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, index, add, wback) + @asm strb reg_T maccess } diff --git a/plugins/arm/v7/opdefs/strb_A88207.d b/plugins/arm/v7/opdefs/strb_A88207.d index 4e893fb..e495ea8 100644 --- a/plugins/arm/v7/opdefs/strb_A88207.d +++ b/plugins/arm/v7/opdefs/strb_A88207.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,29 +23,99 @@ @title STRB (immediate, ARM) -@desc Store Register Byte (immediate) calculates an address from a base register value and an immediate offset, and stores a byte from a register to memory. It can use offset, post-indexed, or pre-indexed addressing. For information about memory accesses see Memory accesses on page A8-294. +@id 206 + +@desc { + + Store Register Byte (immediate) calculates an address from a base register value and an immediate offset, and stores a byte from a register to memory. It can use offset, post-indexed, or pre-indexed addressing. For information about memory accesses see Memory accesses on page A8-294. + +} @encoding (A1) { @word cond(4) 0 1 0 P(1) U(1) 1 W(1) 0 Rn(4) Rt(4) imm12(12) - @syntax <reg_T> <mem_access> + @syntax { + + @assert { + + P == 1 + P == 1 && W == 0 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm12, 32) + maccess = MemAccessOffset(reg_N, imm32) + + } + + @asm strb reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) + + } + + } + + @syntax { - @conv { + @assert { - reg_T = Register(Rt) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm12, 32) - index = (P == '1') - add = (U == '1') - wback = (P == '0') || (W == '1') - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, index, add, wback) + P == 1 + P == 0 || W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm12, 32) + maccess = MemAccessPreIndexed(reg_N, imm32) + + } + + @asm strb reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + P == 0 + P == 0 || W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm12, 32) + maccess = MemAccessPostIndexed(reg_N, imm32) + + } + + @asm strb reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/strb_A88208.d b/plugins/arm/v7/opdefs/strb_A88208.d index 36f6134..11d5931 100644 --- a/plugins/arm/v7/opdefs/strb_A88208.d +++ b/plugins/arm/v7/opdefs/strb_A88208.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title STRB (register) -@desc Store Register Byte (register) calculates an address from a base register value and an offset register value, and stores a byte from a register to memory. The offset register value can optionally be shifted. For information about memory accesses see Memory accesses on page A8-294. +@id 207 + +@desc { + + Store Register Byte (register) calculates an address from a base register value and an offset register value, and stores a byte from a register to memory. The offset register value can optionally be shifted. For information about memory accesses see Memory accesses on page A8-294. + +} @encoding (t1) { @half 0 1 0 1 0 1 0 Rm(3) Rn(3) Rt(3) - @syntax <reg_T> <mem_access> + @syntax { + + @conv { - @conv { + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + maccess = MemAccessOffset(reg_N, reg_M) - reg_T = Register(Rt) - reg_N = Register(Rn) - reg_M = Register(Rm) - mem_access = MakeMemoryAccess(reg_N, reg_M, NULL, true, true, false) + } + + @asm strb reg_T maccess } @@ -46,15 +56,19 @@ @word 1 1 1 1 1 0 0 0 0 0 0 0 Rn(4) Rt(4) 0 0 0 0 0 0 imm2(2) Rm(4) - @syntax ".W" <reg_T> <mem_access> + @syntax { + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = FixedShift(SRType_LSL, imm2) + maccess = MemAccessOffsetExtended(reg_N, reg_M, shift) - @conv { + } - reg_T = Register(Rt) - reg_N = Register(Rn) - reg_M = Register(Rm) - shift = DecodeImmShift(0, imm2) - mem_access = MakeMemoryAccess(reg_N, reg_M, shift, true, true, false) + @asm strb.w reg_T maccess } @@ -64,24 +78,90 @@ @word cond(4) 0 1 1 P(1) U(1) 1 W(1) 0 Rn(4) Rt(4) imm5(5) type(2) 0 Rm(4) - @syntax <reg_T> <mem_access> + @syntax { + + @assert { + + P == 1 + P == 1 && W == 0 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) + maccess = MemAccessOffsetExtended(reg_N, reg_M, shift) + + } + + @asm strb reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) + + } + + } + + @syntax { + + @assert { + + P == 1 + P == 0 || W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) + maccess = MemAccessPreIndexedExtended(reg_N, reg_M, shift) + + } + + @asm strb reg_T maccess + + @rules { - @conv { + check g_arm_instruction_set_cond(cond) - reg_T = Register(Rt) - reg_N = Register(Rn) - reg_M = Register(Rm) - index = (P == '1') - add = (U == '1') - wback = (P == '0') || (W == '1') - shift = DecodeImmShift(type, imm5) - mem_access = MakeMemoryAccess(reg_N, reg_M, shift, index, add, wback) + } } - @rules { + @syntax { + + @assert { + + P == 0 + P == 0 || W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) + maccess = MemAccessPostIndexedExtended(reg_N, reg_M, shift) + + } + + @asm strb reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/strbt_A88209.d b/plugins/arm/v7/opdefs/strbt_A88209.d index 2bcb260..034b4ad 100644 --- a/plugins/arm/v7/opdefs/strbt_A88209.d +++ b/plugins/arm/v7/opdefs/strbt_A88209.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title STRBT -@desc Store Register Byte Unprivileged stores a byte from a register to memory. For information about memory accesses see Memory accesses on page A8-294. The memory access is restricted as if the processor were running in User mode. This makes no difference if the processor is actually running in User mode. STRBT is UNPREDICTABLE in Hyp mode. The Thumb instruction uses an offset addressing mode, that calculates the address used for the memory access from a base register value and an immediate offset, and leaves the base register unchanged. The ARM instruction uses a post-indexed addressing mode, that uses a base register value as the address for the memory access, and calculates a new address from a base register value and an offset and writes it back to the base register. The offset can be an immediate value or an optionally-shifted register value. +@id 208 + +@desc { + + Store Register Byte Unprivileged stores a byte from a register to memory. For information about memory accesses see Memory accesses on page A8-294. The memory access is restricted as if the processor were running in User mode. This makes no difference if the processor is actually running in User mode. STRBT is UNPREDICTABLE in Hyp mode. The Thumb instruction uses an offset addressing mode, that calculates the address used for the memory access from a base register value and an immediate offset, and leaves the base register unchanged. The ARM instruction uses a post-indexed addressing mode, that uses a base register value as the address for the memory access, and calculates a new address from a base register value and an offset and writes it back to the base register. The offset can be an immediate value or an optionally-shifted register value. + +} @encoding (T1) { @word 1 1 1 1 1 0 0 0 0 0 0 0 Rn(4) Rt(4) 1 1 1 0 imm8(8) - @syntax <reg_T> <mem_access> + @syntax { + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8, 32) + maccess = MemAccessOffset(reg_N, imm32) - @conv { + } - reg_T = Register(Rt) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm8, 32) - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, true, true, false) + @asm strbt reg_T maccess } @@ -46,21 +56,24 @@ @word cond(4) 0 1 0 0 U(1) 1 1 0 Rn(4) Rt(4) imm12(12) - @syntax <reg_T> <mem_access> + @syntax { - @conv { + @conv { - reg_T = Register(Rt) - reg_N = Register(Rn) - add = (U == '1') - imm32 = ZeroExtend(imm12, 32) - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, false, add, false) + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm12, 32) + maccess = MemAccessPostIndexed(reg_N, imm32) - } + } + + @asm strbt reg_T maccess + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } @@ -70,22 +83,25 @@ @word cond(4) 0 1 1 0 U(1) 1 1 0 Rn(4) Rt(4) imm5(5) type(2) 0 Rm(4) - @syntax <reg_T> <mem_access> + @syntax { - @conv { + @conv { - reg_T = Register(Rt) - reg_N = Register(Rn) - reg_M = Register(Rm) - add = (U == '1') - shift = DecodeImmShift(type, imm5) - mem_access = MakeMemoryAccess(reg_N, reg_M, shift, false, add, false) + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) + maccess = MemAccessPostIndexedExtended(reg_N, reg_M, shift) - } + } + + @asm strbt reg_T maccess + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/strd_A88210.d b/plugins/arm/v7/opdefs/strd_A88210.d index 437bcb3..93608eb 100644 --- a/plugins/arm/v7/opdefs/strd_A88210.d +++ b/plugins/arm/v7/opdefs/strd_A88210.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,24 +23,84 @@ @title STRD (immediate) -@desc Store Register Dual (immediate) calculates an address from a base register value and an immediate offset, and stores two words from two registers to memory. It can use offset, post-indexed, or pre-indexed addressing. For information about memory accesses see Memory accesses on page A8-294. +@id 209 + +@desc { + + Store Register Dual (immediate) calculates an address from a base register value and an immediate offset, and stores two words from two registers to memory. It can use offset, post-indexed, or pre-indexed addressing. For information about memory accesses see Memory accesses on page A8-294. + +} @encoding (T1) { @word 1 1 1 0 1 0 0 P(1) U(1) 1 W(1) 0 Rn(4) Rt(4) Rt2(4) imm8(8) - @syntax <reg_T> <reg_T2> <mem_access> + @syntax { + + @assert { + + P == 1 + W == 0 + + } + + @conv { + + reg_T = Register(Rt) + reg_T2 = Register(Rt2) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8:'00', 32) + maccess = MemAccessOffset(reg_N, imm32) + + } + + @asm strd reg_T reg_T2 maccess + + } + + @syntax { + + @assert { - @conv { + P == 1 + W == 1 - reg_T = Register(Rt) - reg_T2 = Register(Rt2) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm8:'00', 32) - index = (P == '1') - add = (U == '1') - wback = (W == '1') - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, index, add, wback) + } + + @conv { + + reg_T = Register(Rt) + reg_T2 = Register(Rt2) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8:'00', 32) + maccess = MemAccessPreIndexed(reg_N, imm32) + + } + + @asm strd reg_T reg_T2 maccess + + } + + @syntax { + + @assert { + + P == 0 + W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_T2 = Register(Rt2) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8:'00', 32) + maccess = MemAccessPostIndexed(reg_N, imm32) + + } + + @asm strd reg_T reg_T2 maccess } @@ -50,24 +110,90 @@ @word cond(4) 0 0 0 P(1) U(1) 1 W(1) 0 Rn(4) Rt(4) imm4H(4) 1 1 1 1 imm4L(4) - @syntax <reg_T> <reg_T2> <mem_access> + @syntax { + + @assert { - @conv { + P == 1 + P == 1 && W == 0 - reg_T = Register(Rt) - reg_T2 = NextRegister(reg_T) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm4H:imm4L, 32) - index = (P == '1') - add = (U == '1') - wback = (P == '0') || (W == '1') - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, index, add, wback) + } + + @conv { + + reg_T = Register(Rt) + reg_T2 = NextRegister(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm4H:imm4L, 32) + maccess = MemAccessOffset(reg_N, imm32) + + } + + @asm strd reg_T reg_T2 maccess + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + P == 1 + P == 0 || W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_T2 = NextRegister(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm4H:imm4L, 32) + maccess = MemAccessPreIndexed(reg_N, imm32) + + } + + @asm strd reg_T reg_T2 maccess + + @rules { + + check g_arm_instruction_set_cond(cond) + + } + + } + + @syntax { + + @assert { + + P == 0 + P == 0 || W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_T2 = NextRegister(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm4H:imm4L, 32) + maccess = MemAccessPostIndexed(reg_N, imm32) + + } + + @asm strd reg_T reg_T2 maccess + + @rules { + + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/strd_A88211.d b/plugins/arm/v7/opdefs/strd_A88211.d index b30d4a5..1f0dc14 100644 --- a/plugins/arm/v7/opdefs/strd_A88211.d +++ b/plugins/arm/v7/opdefs/strd_A88211.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,30 +23,102 @@ @title STRD (register) -@desc Store Register Dual (register) calculates an address from a base register value and a register offset, and stores two words from two registers to memory. It can use offset, post-indexed, or pre-indexed addressing. For information about memory accesses see Memory accesses on page A8-294. +@id 210 + +@desc { + + Store Register Dual (register) calculates an address from a base register value and a register offset, and stores two words from two registers to memory. It can use offset, post-indexed, or pre-indexed addressing. For information about memory accesses see Memory accesses on page A8-294. + +} @encoding (A1) { @word cond(4) 0 0 0 P(1) U(1) 0 W(1) 0 Rn(4) Rt(4) 0 0 0 0 1 1 1 1 Rm(4) - @syntax <reg_T> <reg_T2> <mem_access> + @syntax { + + @assert { + + P == 1 + P == 1 && W == 0 + + } + + @conv { + + reg_T = Register(Rt) + reg_T2 = NextRegister(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + maccess = MemAccessOffset(reg_N, reg_M) + + } + + @asm strd reg_T reg_T2 maccess + + @rules { + + check g_arm_instruction_set_cond(cond) + + } + + } + + @syntax { - @conv { + @assert { - reg_T = Register(Rt) - reg_T2 = NextRegister(reg_T) - reg_N = Register(Rn) - reg_M = Register(Rm) - index = (P == '1') - add = (U == '1') - wback = (P == '0') || (W == '1') - mem_access = MakeMemoryAccess(reg_N, reg_M, NULL, index, add, wback) + P == 1 + P == 0 || W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_T2 = NextRegister(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + maccess = MemAccessPreIndexed(reg_N, reg_M) + + } + + @asm strd reg_T reg_T2 maccess + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + P == 0 + P == 0 || W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_T2 = NextRegister(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + maccess = MemAccessPostIndexed(reg_N, reg_M) + + } + + @asm strd reg_T reg_T2 maccess + + @rules { + + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/strex_A88212.d b/plugins/arm/v7/opdefs/strex_A88212.d index 65a7dfe..0631064 100644 --- a/plugins/arm/v7/opdefs/strex_A88212.d +++ b/plugins/arm/v7/opdefs/strex_A88212.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,21 +23,31 @@ @title STREX -@desc Store Register Exclusive calculates an address from a base register value and an immediate offset, and stores a word from a register to memory if the executing processor has exclusive access to the memory addressed. For more information about support for shared memory see Synchronization and semaphores on page A3-114. For information about memory accesses see Memory accesses on page A8-294. +@id 211 + +@desc { + + Store Register Exclusive calculates an address from a base register value and an immediate offset, and stores a word from a register to memory if the executing processor has exclusive access to the memory addressed. For more information about support for shared memory see Synchronization and semaphores on page A3-114. For information about memory accesses see Memory accesses on page A8-294. + +} @encoding (T1) { @word 1 1 1 0 1 0 0 0 0 1 0 0 Rn(4) Rt(4) Rd(4) imm8(8) - @syntax <reg_D> <reg_T> <mem_access> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8:'00', 32) + maccess = MemAccessOffset(reg_N, imm32) - reg_D = Register(Rd) - reg_T = Register(Rt) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm8:'00', 32) - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, true, false, false) + } + + @asm strex reg_D reg_T maccess } @@ -47,20 +57,25 @@ @word cond(4) 0 0 0 1 1 0 0 0 Rn(4) Rd(4) 1 1 1 1 1 0 0 1 Rt(4) - @syntax <reg_D> <reg_T> <mem_access> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_T = Register(Rt) - reg_N = Register(Rn) - mem_access = MakeMemoryAccess(reg_N, NULL, NULL, true, false, false) + reg_D = Register(Rd) + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = Zeros(32) + maccess = MemAccessOffset(reg_N, imm32) - } + } + + @asm strex reg_D reg_T maccess + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/strexb_A88213.d b/plugins/arm/v7/opdefs/strexb_A88213.d index 0197d6c..af0a005 100644 --- a/plugins/arm/v7/opdefs/strexb_A88213.d +++ b/plugins/arm/v7/opdefs/strexb_A88213.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title STREXB -@desc Store Register Exclusive Byte derives an address from a base register value, and stores a byte from a register to memory if the executing processor has exclusive access to the memory addressed. For more information about support for shared memory see Synchronization and semaphores on page A3-114. For information about memory accesses see Memory accesses on page A8-294. +@id 212 + +@desc { + + Store Register Exclusive Byte derives an address from a base register value, and stores a byte from a register to memory if the executing processor has exclusive access to the memory addressed. For more information about support for shared memory see Synchronization and semaphores on page A3-114. For information about memory accesses see Memory accesses on page A8-294. + +} @encoding (T1) { @word 1 1 1 0 1 0 0 0 1 1 0 0 Rn(4) Rt(4) 1 1 1 1 0 1 0 0 Rd(4) - @syntax <reg_D> <reg_T> <mem_access> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_T = Register(Rt) + reg_N = Register(Rn) + maccess = MemAccessOffset(reg_N, NULL) - reg_D = Register(Rd) - reg_T = Register(Rt) - reg_N = Register(Rn) - mem_access = MakeMemoryAccess(reg_N, NULL, NULL, true, false, false) + } + + @asm strexb reg_D reg_T maccess } @@ -46,20 +56,24 @@ @word cond(4) 0 0 0 1 1 1 0 0 Rn(4) Rd(4) 1 1 1 1 1 0 0 1 Rt(4) - @syntax <reg_D> <reg_T> <mem_access> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_T = Register(Rt) - reg_N = Register(Rn) - mem_access = MakeMemoryAccess(reg_N, NULL, NULL, true, false, false) + reg_D = Register(Rd) + reg_T = Register(Rt) + reg_N = Register(Rn) + maccess = MemAccessOffset(reg_N, NULL) - } + } + + @asm strexb reg_D reg_T maccess + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/strexd_A88214.d b/plugins/arm/v7/opdefs/strexd_A88214.d index 2867cea..3da8f64 100644 --- a/plugins/arm/v7/opdefs/strexd_A88214.d +++ b/plugins/arm/v7/opdefs/strexd_A88214.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,21 +23,31 @@ @title STREXD -@desc Store Register Exclusive Doubleword derives an address from a base register value, and stores a 64-bit doubleword from two registers to memory if the executing processor has exclusive access to the memory addressed. For more information about support for shared memory see Synchronization and semaphores on page A3-114. For information about memory accesses see Memory accesses on page A8-294. +@id 213 + +@desc { + + Store Register Exclusive Doubleword derives an address from a base register value, and stores a 64-bit doubleword from two registers to memory if the executing processor has exclusive access to the memory addressed. For more information about support for shared memory see Synchronization and semaphores on page A3-114. For information about memory accesses see Memory accesses on page A8-294. + +} @encoding (T1) { @word 1 1 1 0 1 0 0 0 1 1 0 0 Rn(4) Rt(4) Rt2(4) 0 1 1 1 Rd(4) - @syntax <reg_D> <reg_T> <reg_T2> <mem_access> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_T = Register(Rt) + reg_T2 = Register(Rt2) + reg_N = Register(Rn) + maccess = MemAccessOffset(reg_N, NULL) - reg_D = Register(Rd) - reg_T = Register(Rt) - reg_T2 = Register(Rt2) - reg_N = Register(Rn) - mem_access = MakeMemoryAccess(reg_N, NULL, NULL, true, false, false) + } + + @asm strexd reg_D reg_T reg_T2 maccess } @@ -47,21 +57,25 @@ @word cond(4) 0 0 0 1 1 0 1 0 Rn(4) Rd(4) 1 1 1 1 1 0 0 1 Rt(4) - @syntax <reg_D> <reg_T> <reg_T2> <mem_access> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_T = Register(Rt) - reg_T2 = NextRegister(reg_T) - reg_N = Register(Rn) - mem_access = MakeMemoryAccess(reg_N, NULL, NULL, true, false, false) + reg_D = Register(Rd) + reg_T = Register(Rt) + reg_T2 = NextRegister(Rt) + reg_N = Register(Rn) + maccess = MemAccessOffset(reg_N, NULL) - } + } + + @asm strexd reg_D reg_T reg_T2 maccess + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/strexh_A88215.d b/plugins/arm/v7/opdefs/strexh_A88215.d index 4ca0b6f..4341851 100644 --- a/plugins/arm/v7/opdefs/strexh_A88215.d +++ b/plugins/arm/v7/opdefs/strexh_A88215.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title STREXH -@desc Store Register Exclusive Halfword derives an address from a base register value, and stores a halfword from a register to memory if the executing processor has exclusive access to the memory addressed. For more information about support for shared memory see Synchronization and semaphores on page A3-114. For information about memory accesses see Memory accesses on page A8-294. +@id 214 + +@desc { + + Store Register Exclusive Halfword derives an address from a base register value, and stores a halfword from a register to memory if the executing processor has exclusive access to the memory addressed. For more information about support for shared memory see Synchronization and semaphores on page A3-114. For information about memory accesses see Memory accesses on page A8-294. + +} @encoding (T1) { @word 1 1 1 0 1 0 0 0 1 1 0 0 Rn(4) Rt(4) 1 1 1 1 0 1 0 1 Rd(4) - @syntax <reg_D> <reg_T> <mem_access> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_T = Register(Rt) + reg_N = Register(Rn) + maccess = MemAccessOffset(reg_N, NULL) - reg_D = Register(Rd) - reg_T = Register(Rt) - reg_N = Register(Rn) - mem_access = MakeMemoryAccess(reg_N, NULL, NULL, true, false, false) + } + + @asm strexh reg_D reg_T maccess } @@ -46,20 +56,24 @@ @word cond(4) 0 0 0 1 1 1 1 0 Rn(4) Rd(4) 1 1 1 1 1 0 0 1 Rt(4) - @syntax <reg_D> <reg_T> <mem_access> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_T = Register(Rt) - reg_N = Register(Rn) - mem_access = MakeMemoryAccess(reg_N, NULL, NULL, true, false, false) + reg_D = Register(Rd) + reg_T = Register(Rt) + reg_N = Register(Rn) + maccess = MemAccessOffset(reg_N, NULL) - } + } + + @asm strexh reg_D reg_T maccess + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/strh_A88216.d b/plugins/arm/v7/opdefs/strh_A88216.d index 624b483..05b7b12 100644 --- a/plugins/arm/v7/opdefs/strh_A88216.d +++ b/plugins/arm/v7/opdefs/strh_A88216.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title STRH (immediate, Thumb) -@desc Store Register Halfword (immediate) calculates an address from a base register value and an immediate offset, and stores a halfword from a register to memory. It can use offset, post-indexed, or pre-indexed addressing. For information about memory accesses see Memory accesses on page A8-294. +@id 215 + +@desc { + + Store Register Halfword (immediate) calculates an address from a base register value and an immediate offset, and stores a halfword from a register to memory. It can use offset, post-indexed, or pre-indexed addressing. For information about memory accesses see Memory accesses on page A8-294. + +} @encoding (t1) { @half 1 0 0 0 0 imm5(5) Rn(3) Rt(3) - @syntax <reg_T> <mem_access> + @syntax { + + @conv { - @conv { + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm5:'0', 32) + maccess = MemAccessOffset(reg_N, imm32) - reg_T = Register(Rt) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm5:'0', 32) - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, true, true, false) + } + + @asm strh reg_T maccess } @@ -46,14 +56,18 @@ @word 1 1 1 1 1 0 0 0 1 0 1 0 Rn(4) Rt(4) imm12(12) - @syntax ".W" <reg_T> <mem_access> + @syntax { + + @conv { - @conv { + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm12, 32) + maccess = MemAccessOffset(reg_N, imm32) - reg_T = Register(Rt) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm12, 32) - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, true, true, false) + } + + @asm strh.w reg_T maccess } @@ -63,17 +77,69 @@ @word 1 1 1 1 1 0 0 0 0 0 1 0 Rn(4) Rt(4) 1 P(1) U(1) W(1) imm8(8) - @syntax <reg_T> <mem_access> + @syntax { + + @assert { + + P == 1 + W == 0 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8, 32) + maccess = MemAccessOffset(reg_N, imm32) + + } + + @asm strh reg_T maccess + + } + + @syntax { + + @assert { + + P == 1 + W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8, 32) + maccess = MemAccessPreIndexed(reg_N, imm32) + + } + + @asm strh reg_T maccess + + } + + @syntax { + + @assert { + + P == 0 + W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8, 32) + maccess = MemAccessPostIndexed(reg_N, imm32) - @conv { + } - reg_T = Register(Rt) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm8, 32) - index = (P == '1') - add = (U == '1') - wback = (W == '1') - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, index, add, wback) + @asm strh reg_T maccess } diff --git a/plugins/arm/v7/opdefs/strh_A88217.d b/plugins/arm/v7/opdefs/strh_A88217.d index 3b5f97c..5b7fa38 100644 --- a/plugins/arm/v7/opdefs/strh_A88217.d +++ b/plugins/arm/v7/opdefs/strh_A88217.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,29 +23,99 @@ @title STRH (immediate, ARM) -@desc Store Register Halfword (immediate) calculates an address from a base register value and an immediate offset, and stores a halfword from a register to memory. It can use offset, post-indexed, or pre-indexed addressing. For information about memory accesses see Memory accesses on page A8-294. +@id 216 + +@desc { + + Store Register Halfword (immediate) calculates an address from a base register value and an immediate offset, and stores a halfword from a register to memory. It can use offset, post-indexed, or pre-indexed addressing. For information about memory accesses see Memory accesses on page A8-294. + +} @encoding (A1) { @word cond(4) 0 0 0 P(1) U(1) 1 W(1) 0 Rn(4) Rt(4) imm4H(4) 1 0 1 1 imm4L(4) - @syntax <reg_T> <mem_access> + @syntax { + + @assert { + + P == 1 + P == 1 && W == 0 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm4H:imm4L, 32) + maccess = MemAccessOffset(reg_N, imm32) + + } + + @asm strh reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) + + } + + } + + @syntax { - @conv { + @assert { - reg_T = Register(Rt) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm4H:imm4L, 32) - index = (P == '1') - add = (U == '1') - wback = (P == '0') || (W == '1') - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, index, add, wback) + P == 1 + P == 0 || W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm4H:imm4L, 32) + maccess = MemAccessPreIndexed(reg_N, imm32) + + } + + @asm strh reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + P == 0 + P == 0 || W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm4H:imm4L, 32) + maccess = MemAccessPostIndexed(reg_N, imm32) + + } + + @asm strh reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/strh_A88218.d b/plugins/arm/v7/opdefs/strh_A88218.d index 1e9dc1f..149ba8d 100644 --- a/plugins/arm/v7/opdefs/strh_A88218.d +++ b/plugins/arm/v7/opdefs/strh_A88218.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title STRH (register) -@desc Store Register Halfword (register) calculates an address from a base register value and an offset register value, and stores a halfword from a register to memory. The offset register value can be shifted left by 0, 1, 2, or 3 bits. For information about memory accesses see Memory accesses on page A8-294. +@id 217 + +@desc { + + Store Register Halfword (register) calculates an address from a base register value and an offset register value, and stores a halfword from a register to memory. The offset register value can be shifted left by 0, 1, 2, or 3 bits. For information about memory accesses see Memory accesses on page A8-294. + +} @encoding (t1) { @half 0 1 0 1 0 0 1 Rm(3) Rn(3) Rt(3) - @syntax <reg_T> <mem_access> + @syntax { + + @conv { - @conv { + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + maccess = MemAccessOffset(reg_N, reg_M) - reg_T = Register(Rt) - reg_N = Register(Rn) - reg_M = Register(Rm) - mem_access = MakeMemoryAccess(reg_N, reg_M, NULL, true, true, false) + } + + @asm strh reg_T maccess } @@ -46,15 +56,19 @@ @word 1 1 1 1 1 0 0 0 0 0 1 0 Rn(4) Rt(4) 0 0 0 0 0 0 imm2(2) Rm(4) - @syntax ".W" <reg_T> <mem_access> + @syntax { + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = FixedShift(SRType_LSL, imm2) + maccess = MemAccessOffsetExtended(reg_N, reg_M, shift) - @conv { + } - reg_T = Register(Rt) - reg_N = Register(Rn) - reg_M = Register(Rm) - shift = DecodeImmShift(0, imm2) - mem_access = MakeMemoryAccess(reg_N, reg_M, shift, true, true, false) + @asm strh.w reg_T maccess } @@ -64,23 +78,87 @@ @word cond(4) 0 0 0 P(1) U(1) 0 W(1) 0 Rn(4) Rt(4) 0 0 0 0 1 0 1 1 Rm(4) - @syntax <reg_T> <mem_access> + @syntax { + + @assert { + + P == 1 + P == 1 && W == 0 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + maccess = MemAccessOffset(reg_N, reg_M) + + } + + @asm strh reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) + + } + + } + + @syntax { + + @assert { + + P == 1 + P == 0 || W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + maccess = MemAccessPreIndexed(reg_N, reg_M) + + } + + @asm strh reg_T maccess + + @rules { - @conv { + check g_arm_instruction_set_cond(cond) - reg_T = Register(Rt) - reg_N = Register(Rn) - reg_M = Register(Rm) - index = (P == '1') - add = (U == '1') - wback = (P == '0') || (W == '1') - mem_access = MakeMemoryAccess(reg_N, reg_M, NULL, index, add, wback) + } } - @rules { + @syntax { + + @assert { + + P == 0 + P == 0 || W == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + maccess = MemAccessPostIndexed(reg_N, reg_M) + + } + + @asm strh reg_T maccess + + @rules { + + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/strht_A88219.d b/plugins/arm/v7/opdefs/strht_A88219.d index 3811572..f7fb37f 100644 --- a/plugins/arm/v7/opdefs/strht_A88219.d +++ b/plugins/arm/v7/opdefs/strht_A88219.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title STRHT -@desc Store Register Halfword Unprivileged stores a halfword from a register to memory. For information about memory accesses see Memory accesses on page A8-294. The memory access is restricted as if the processor were running in User mode. This makes no difference if the processor is actually running in User mode. STRHT is UNPREDICTABLE in Hyp mode. The Thumb instruction uses an offset addressing mode, that calculates the address used for the memory access from a base register value and an immediate offset, and leaves the base register unchanged. The ARM instruction uses a post-indexed addressing mode, that uses a base register value as the address for the memory access, and calculates a new address from a base register value and an offset and writes it back to the base register. The offset can be an immediate value or a register value. +@id 218 + +@desc { + + Store Register Halfword Unprivileged stores a halfword from a register to memory. For information about memory accesses see Memory accesses on page A8-294. The memory access is restricted as if the processor were running in User mode. This makes no difference if the processor is actually running in User mode. STRHT is UNPREDICTABLE in Hyp mode. The Thumb instruction uses an offset addressing mode, that calculates the address used for the memory access from a base register value and an immediate offset, and leaves the base register unchanged. The ARM instruction uses a post-indexed addressing mode, that uses a base register value as the address for the memory access, and calculates a new address from a base register value and an offset and writes it back to the base register. The offset can be an immediate value or a register value. + +} @encoding (T1) { @word 1 1 1 1 1 0 0 0 0 0 1 0 Rn(4) Rt(4) 1 1 1 0 imm8(8) - @syntax <reg_T> <mem_access> + @syntax { + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8, 32) + maccess = MemAccessOffset(reg_N, imm32) - @conv { + } - reg_T = Register(Rt) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm8, 32) - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, true, true, false) + @asm strht reg_T maccess } @@ -46,21 +56,24 @@ @word cond(4) 0 0 0 0 U(1) 1 1 0 Rn(4) Rt(4) imm4H(4) 1 0 1 1 imm4L(4) - @syntax <reg_T> <mem_access> + @syntax { - @conv { + @conv { - reg_T = Register(Rt) - reg_N = Register(Rn) - add = (U == '1') - imm32 = ZeroExtend(imm4H:imm4L, 32) - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, false, add, false) + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm4H:imm4L, 32) + maccess = MemAccessPostIndexed(reg_N, imm32) - } + } + + @asm strht reg_T maccess + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } @@ -70,21 +83,24 @@ @word cond(4) 0 0 0 0 U(1) 0 1 0 Rn(4) Rt(4) 0 0 0 0 1 0 1 1 Rm(4) - @syntax <reg_T> <mem_access> + @syntax { - @conv { + @conv { - reg_T = Register(Rt) - reg_N = Register(Rn) - reg_M = Register(Rm) - add = (U == '1') - mem_access = MakeMemoryAccess(reg_N, reg_M, NULL, false, add, false) + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + maccess = MemAccessPostIndexed(reg_N, reg_M) - } + } + + @asm strht reg_T maccess + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/strt_A88220.d b/plugins/arm/v7/opdefs/strt_A88220.d index 794a0fa..dd1c03a 100644 --- a/plugins/arm/v7/opdefs/strt_A88220.d +++ b/plugins/arm/v7/opdefs/strt_A88220.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title STRT -@desc Store Register Unprivileged stores a word from a register to memory. For information about memory accesses see Memory accesses on page A8-294. The memory access is restricted as if the processor were running in User mode. This makes no difference if the processor is actually running in User mode. STRT is UNPREDICTABLE in Hyp mode. The Thumb instruction uses an offset addressing mode, that calculates the address used for the memory access from a base register value and an immediate offset, and leaves the base register unchanged. The ARM instruction uses a post-indexed addressing mode, that uses a base register value as the address for the memory access, and calculates a new address from a base register value and an offset and writes it back to the base register. The offset can be an immediate value or an optionally-shifted register value. +@id 219 + +@desc { + + Store Register Unprivileged stores a word from a register to memory. For information about memory accesses see Memory accesses on page A8-294. The memory access is restricted as if the processor were running in User mode. This makes no difference if the processor is actually running in User mode. STRT is UNPREDICTABLE in Hyp mode. The Thumb instruction uses an offset addressing mode, that calculates the address used for the memory access from a base register value and an immediate offset, and leaves the base register unchanged. The ARM instruction uses a post-indexed addressing mode, that uses a base register value as the address for the memory access, and calculates a new address from a base register value and an offset and writes it back to the base register. The offset can be an immediate value or an optionally-shifted register value. + +} @encoding (T1) { @word 1 1 1 1 1 0 0 0 0 1 0 0 Rn(4) Rt(4) 1 1 1 0 imm8(8) - @syntax <reg_T> <mem_access> + @syntax { + + @conv { + + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm8, 32) + maccess = MemAccessOffset(reg_N, imm32) - @conv { + } - reg_T = Register(Rt) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm8, 32) - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, true, true, false) + @asm strt reg_T maccess } @@ -46,21 +56,24 @@ @word cond(4) 0 1 0 0 U(1) 0 1 0 Rn(4) Rt(4) imm12(12) - @syntax <reg_T> <mem_access> + @syntax { - @conv { + @conv { - reg_T = Register(Rt) - reg_N = Register(Rn) - add = (U == '1') - imm32 = ZeroExtend(imm12, 32) - mem_access = MakeMemoryAccess(reg_N, imm32, NULL, false, add, false) + reg_T = Register(Rt) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm12, 32) + maccess = MemAccessPostIndexed(reg_N, imm32) - } + } + + @asm strt reg_T maccess + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } @@ -70,22 +83,25 @@ @word cond(4) 0 1 1 0 U(1) 0 1 0 Rn(4) Rt(4) imm5(5) type(2) 0 Rm(4) - @syntax <reg_T> <mem_access> + @syntax { - @conv { + @conv { - reg_T = Register(Rt) - reg_N = Register(Rn) - reg_M = Register(Rm) - add = (U == '1') - shift = DecodeImmShift(type, imm5) - mem_access = MakeMemoryAccess(reg_N, reg_M, shift, false, add, false) + reg_T = Register(Rt) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) + maccess = MemAccessPostIndexedExtended(reg_N, reg_M, shift) - } + } + + @asm strt reg_T maccess + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/sub_A88221.d b/plugins/arm/v7/opdefs/sub_A88221.d index 41ce6b3..365943c 100644 --- a/plugins/arm/v7/opdefs/sub_A88221.d +++ b/plugins/arm/v7/opdefs/sub_A88221.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title SUB (immediate, Thumb) -@desc This instruction subtracts an immediate value from a register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. +@id 220 + +@desc { + + This instruction subtracts an immediate value from a register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. + +} @encoding (t1) { @half 0 0 0 1 1 1 1 imm3(3) Rn(3) Rd(3) - @syntax "subs" <reg_D> <reg_N> <imm32> + @syntax { + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + imm32 = ZeroExtend(imm3, 32) - @conv { + } - reg_D = Register(Rd) - reg_N = Register(Rn) - imm32 = ZeroExtend(imm3, 32) + @asm sub ?reg_D reg_N imm32 } @@ -45,12 +55,17 @@ @half 0 0 1 1 1 Rdn(3) imm8(8) - @syntax "subs" <reg_DN> <imm32> + @syntax { - @conv { + @conv { - reg_DN = Register(Rdn) - imm32 = ZeroExtend(imm8, 32) + reg_D = Register(Rdn) + reg_N = Register(Rdn) + imm32 = ZeroExtend(imm8, 32) + + } + + @asm sub ?reg_D reg_N imm32 } @@ -60,21 +75,43 @@ @word 1 1 1 1 0 i(1) 0 1 1 0 1 S(1) Rn(4) 0 imm3(3) Rd(4) imm8(8) - @syntax <reg_D> <reg_N> <imm32> + @syntax { + + @assert { + + S == 0 + + } - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - setflags = (S == '1') - imm32 = ThumbExpandImm(i:imm3:imm8) + reg_D = Register(Rd) + reg_N = Register(Rn) + imm32 = ThumbExpandImm(i:imm3:imm8) + + } + + @asm sub.w ?reg_D reg_N imm32 } - @rules { + @syntax { + + @assert { + + S == 1 + + } - if (setflags); chk_call ExtendKeyword("s") - chk_call ExtendKeyword(".w") + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + imm32 = ThumbExpandImm(i:imm3:imm8) + + } + + @asm subs.w ?reg_D reg_N imm32 } @@ -84,13 +121,17 @@ @word 1 1 1 1 0 i(1) 1 0 1 0 1 0 Rn(4) 0 imm3(3) Rd(4) imm8(8) - @syntax "subw" <reg_D> <reg_N> <imm32> + @syntax { + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + imm32 = ZeroExtend(i:imm3:imm8, 32) - @conv { + } - reg_D = Register(Rd) - reg_N = Register(Rn) - imm32 = ZeroExtend(i:imm3:imm8, 32) + @asm subw ?reg_D reg_N imm32 } diff --git a/plugins/arm/v7/opdefs/sub_A88222.d b/plugins/arm/v7/opdefs/sub_A88222.d index ef326b8..289d045 100644 --- a/plugins/arm/v7/opdefs/sub_A88222.d +++ b/plugins/arm/v7/opdefs/sub_A88222.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,27 +23,67 @@ @title SUB (immediate, ARM) -@desc This instruction subtracts an immediate value from a register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. +@id 221 + +@desc { + + This instruction subtracts an immediate value from a register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. + +} @encoding (A1) { @word cond(4) 0 0 1 0 0 1 0 S(1) Rn(4) Rd(4) imm12(12) - @syntax <reg_D> <reg_N> <imm32> + @syntax { + + @assert { + + S == 0 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + imm32 = ARMExpandImm(imm12) + + } + + @asm sub ?reg_D reg_N imm32 - @conv { + @rules { - reg_D = Register(Rd) - reg_N = Register(Rn) - setflags = (S == '1') - imm32 = ARMExpandImm(imm12) + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + imm32 = ARMExpandImm(imm12) + + } + + @asm subs ?reg_D reg_N imm32 + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/sub_A88223.d b/plugins/arm/v7/opdefs/sub_A88223.d index a629250..b3b9ef6 100644 --- a/plugins/arm/v7/opdefs/sub_A88223.d +++ b/plugins/arm/v7/opdefs/sub_A88223.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title SUB (register) -@desc This instruction subtracts an optionally-shifted register value from a register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. +@id 222 + +@desc { + + This instruction subtracts an optionally-shifted register value from a register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. + +} @encoding (t1) { @half 0 0 0 1 1 0 1 Rm(3) Rn(3) Rd(3) - @syntax "subs" <reg_D> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm sub ?reg_D reg_N reg_M } @@ -45,22 +55,45 @@ @word 1 1 1 0 1 0 1 1 1 0 1 S(1) Rn(4) 0 imm3(3) Rd(4) imm2(2) type(2) Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <?shift> + @syntax { + + @assert { + + S == 0 + + } - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') - shift = DecodeImmShift(type, imm3:imm2) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm3:imm2) + + } + + @asm sub.w ?reg_D reg_N reg_M ?shift } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm3:imm2) + + } - if (setflags); chk_call ExtendKeyword("s") - chk_call ExtendKeyword(".w") + @asm subs.w ?reg_D reg_N reg_M ?shift } @@ -70,22 +103,57 @@ @word cond(4) 0 0 0 0 0 1 0 S(1) Rn(4) Rd(4) imm5(5) type(2) 0 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <?shift> + @syntax { - @conv { + @assert { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') - shift = DecodeImmShift(type, imm5) + S == 0 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) + + } + + @asm sub ?reg_D reg_N reg_M ?shift + + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) + + } + + @asm subs ?reg_D reg_N reg_M ?shift + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/sub_A88224.d b/plugins/arm/v7/opdefs/sub_A88224.d deleted file mode 100644 index 5ef4e4d..0000000 --- a/plugins/arm/v7/opdefs/sub_A88224.d +++ /dev/null @@ -1,52 +0,0 @@ - -/* Chrysalide - Outil d'analyse de fichiers binaires - * ##FILE## - traduction d'instructions ARMv7 - * - * Copyright (C) 2015 Cyrille Bagard - * - * This file is part of Chrysalide. - * - * Chrysalide is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * Chrysalide is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Foobar. If not, see <http://www.gnu.org/licenses/>. - */ - - -@title SUB (register-shifted register) - -@desc This instruction subtracts a register-shifted register value from a register value, and writes the result to the destination register. It can optionally update the condition flags based on the result. - -@encoding (A1) { - - @word cond(4) 0 0 0 0 0 1 0 S(1) Rn(4) Rd(4) Rs(4) 0 type(2) 1 Rm(4) - - @syntax <reg_D> <reg_N> <reg_M> <reg_shift> - - @conv { - - reg_shift = RegisterShift(type, Rs) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') - - } - - @rules { - - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) - - } - -} - diff --git a/plugins/arm/v7/opdefs/sub_A88225.d b/plugins/arm/v7/opdefs/sub_A88225.d index dc54c6b..96708b9 100644 --- a/plugins/arm/v7/opdefs/sub_A88225.d +++ b/plugins/arm/v7/opdefs/sub_A88225.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title SUB (SP minus immediate) -@desc This instruction subtracts an immediate value from the SP value, and writes the result to the destination register. +@id 224 + +@desc { + + This instruction subtracts an immediate value from the SP value, and writes the result to the destination register. + +} @encoding (t1) { @half 1 0 1 1 0 0 0 0 1 imm7(7) - @syntax <SP_0> <SP_1> <imm32> + @syntax { + + @conv { - @conv { + reg_D = Register(13) + reg_SP = Register(13) + imm32 = ZeroExtend(imm7:'00', 32) - imm32 = ZeroExtend(imm7:'00', 32) - SP_0 = Register(13) - SP_1 = Register(13) + } + + @asm sub ?reg_D reg_SP imm32 } @@ -45,21 +55,43 @@ @word 1 1 1 1 0 i(1) 0 1 1 0 1 S(1) 1 1 0 1 0 imm3(3) Rd(4) imm8(8) - @syntax <reg_D> <SP> <imm32> + @syntax { + + @assert { + + S == 0 + + } - @conv { + @conv { - reg_D = Register(Rd) - setflags = (S == '1') - imm32 = ThumbExpandImm(i:imm3:imm8) - SP = Register(13) + reg_D = Register(Rd) + reg_SP = Register(13) + imm32 = ThumbExpandImm(i:imm3:imm8) + + } + + @asm sub.w ?reg_D reg_SP imm32 } - @rules { + @syntax { + + @assert { + + S == 1 + + } - if (setflags); chk_call ExtendKeyword("s") - chk_call ExtendKeyword(".w") + @conv { + + reg_D = Register(Rd) + reg_SP = Register(13) + imm32 = ThumbExpandImm(i:imm3:imm8) + + } + + @asm subs.w ?reg_D reg_SP imm32 } @@ -69,13 +101,17 @@ @word 1 1 1 1 0 i(1) 1 0 1 0 1 0 1 1 0 1 0 imm3(3) Rd(4) imm8(8) - @syntax "subw" <reg_D> <SP> <imm32> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_SP = Register(13) + imm32 = ZeroExtend(i:imm3:imm8, 32) - reg_D = Register(Rd) - imm32 = ZeroExtend(i:imm3:imm8, 32) - SP = Register(13) + } + + @asm subw ?reg_D reg_SP imm32 } @@ -85,21 +121,55 @@ @word cond(4) 0 0 1 0 0 1 0 S(1) 1 1 0 1 Rd(4) imm12(12) - @syntax <reg_D> <SP> <imm32> + @syntax { + + @assert { + + S == 0 + + } + + @conv { + + reg_D = Register(Rd) + reg_SP = Register(13) + imm32 = ARMExpandImm(imm12) + + } + + @asm sub ?reg_D reg_SP imm32 + + @rules { - @conv { + check g_arm_instruction_set_cond(cond) - reg_D = Register(Rd) - setflags = (S == '1') - imm32 = ARMExpandImm(imm12) - SP = Register(13) + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_D = Register(Rd) + reg_SP = Register(13) + imm32 = ARMExpandImm(imm12) + + } + + @asm subs ?reg_D reg_SP imm32 + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/sub_A88226.d b/plugins/arm/v7/opdefs/sub_A88226.d deleted file mode 100644 index 02ecada..0000000 --- a/plugins/arm/v7/opdefs/sub_A88226.d +++ /dev/null @@ -1,76 +0,0 @@ - -/* Chrysalide - Outil d'analyse de fichiers binaires - * ##FILE## - traduction d'instructions ARMv7 - * - * Copyright (C) 2015 Cyrille Bagard - * - * This file is part of Chrysalide. - * - * Chrysalide is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * Chrysalide is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Foobar. If not, see <http://www.gnu.org/licenses/>. - */ - - -@title SUB (SP minus register) - -@desc This instruction subtracts an optionally-shifted register value from the SP value, and writes the result to the destination register. - -@encoding (T1) { - - @word 1 1 1 0 1 0 1 1 1 0 1 S(1) 1 1 0 1 0 imm3(3) Rd(4) imm2(2) type(2) Rm(4) - - @syntax <reg_D> <SP> <reg_M> <?shift> - - @conv { - - reg_D = Register(Rd) - reg_M = Register(Rm) - setflags = (S == '1') - shift = DecodeImmShift(type, imm3:imm2) - SP = Register(13) - - } - - @rules { - - if (setflags); chk_call ExtendKeyword("s") - - } - -} - -@encoding (A1) { - - @word cond(4) 0 0 0 0 0 1 0 S(1) 1 1 0 1 Rd(4) imm5(5) type(2) 0 Rm(4) - - @syntax <reg_D> <SP> <reg_M> <?shift> - - @conv { - - reg_D = Register(Rd) - reg_M = Register(Rm) - setflags = (S == '1') - shift = DecodeImmShift(type, imm5) - SP = Register(13) - - } - - @rules { - - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) - - } - -} - diff --git a/plugins/arm/v7/opdefs/svc_A88228.d b/plugins/arm/v7/opdefs/svc_A88228.d index be48545..0ddc95f 100644 --- a/plugins/arm/v7/opdefs/svc_A88228.d +++ b/plugins/arm/v7/opdefs/svc_A88228.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,17 +23,27 @@ @title SVC (previously SWI) -@desc Supervisor Call, previously called Software Interrupt, causes a Supervisor Call exception. For more information, see Supervisor Call (SVC) exception on page B1-1209. Software can use this instruction as a call to an operating system to provide a service. In the following cases, the Supervisor Call exception generated by the SVC instruction is taken to Hyp mode: • If the SVC is executed in Hyp mode. • If HCR.TGE is set to 1, and the SVC is executed in Non-secure User mode. For more information, see Supervisor Call exception, when HCR.TGE is set to 1 on page B1-1191 In these cases, the HSR identifies that the exception entry was caused by a Supervisor Call exception, EC value 0x11, see Use of the HSR on page B3-1424. The immediate field in the HSR: • if the SVC is unconditional: — for the Thumb instruction, is the zero-extended value of the imm8 field — for the ARM instruction, is the least-significant 16 bits the imm24 field • if the SVC is conditional, is UNKNOWN. +@id 227 + +@desc { + + Supervisor Call, previously called Software Interrupt, causes a Supervisor Call exception. For more information, see Supervisor Call (SVC) exception on page B1-1209. Software can use this instruction as a call to an operating system to provide a service. In the following cases, the Supervisor Call exception generated by the SVC instruction is taken to Hyp mode: • If the SVC is executed in Hyp mode. • If HCR.TGE is set to 1, and the SVC is executed in Non-secure User mode. For more information, see Supervisor Call exception, when HCR.TGE is set to 1 on page B1-1191 In these cases, the HSR identifies that the exception entry was caused by a Supervisor Call exception, EC value 0x11, see Use of the HSR on page B3-1424. The immediate field in the HSR: • if the SVC is unconditional: — for the Thumb instruction, is the zero-extended value of the imm8 field — for the ARM instruction, is the least-significant 16 bits the imm24 field • if the SVC is conditional, is UNKNOWN. + +} @encoding (t1) { @half 1 1 0 1 1 1 1 1 imm8(8) - @syntax <imm32> + @syntax { + + @conv { - @conv { + imm32 = ZeroExtend(imm8, 32) - imm32 = ZeroExtend(imm8, 32) + } + + @asm svc imm32 } @@ -43,17 +53,21 @@ @word cond(4) 1 1 1 1 imm24(24) - @syntax <imm32> + @syntax { - @conv { + @conv { - imm32 = ZeroExtend(imm24, 32) + imm32 = ZeroExtend(imm24, 32) - } + } + + @asm svc imm32 + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/swp_A88229.d b/plugins/arm/v7/opdefs/swp_A88229.d index 2e39015..b901462 100644 --- a/plugins/arm/v7/opdefs/swp_A88229.d +++ b/plugins/arm/v7/opdefs/swp_A88229.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,28 +23,69 @@ @title SWP, SWPB -@desc SWP (Swap) swaps a word between registers and memory. SWP loads a word from the memory address given by the value of register <Rn>. The value of register <Rt2> is then stored to the memory address given by the value of <Rn>, and the original loaded value is written to register <Rt>. If the same register is specified for <Rt> and <Rt2>, this instruction swaps the value of the register and the value at the memory address. SWPB (Swap Byte) swaps a byte between registers and memory. SWPB loads a byte from the memory address given by the value of register <Rn>. The value of the least significant byte of register <Rt2> is stored to the memory address given by <Rn>, the original loaded value is zero-extended to a 32-bit word, and the word is written to register <Rt>. If the same register is specified for <Rt> and <Rt2>, this instruction swaps the value of the least significant byte of the register and the byte value at the memory address, and clears the most significant three bytes of the register. For both instructions, the memory system ensures that no other memory access can occur to the memory location between the load access and the store access. Note • The SWP and SWPB instructions rely on the properties of the system beyond the processor to ensure that no stores from other observers can occur between the load access and the store access, and this might not be implemented for all regions of memory on some system implementations. In all cases, SWP and SWPB do ensure that no stores from the processor that executed the SWP or SWPB instruction can occur between the load access and the store access of the SWP or SWPB. • ARM deprecates the use of SWP and SWPB, and strongly recommends that new software uses: LDREX/STREX in preference to SWP — LDREXB/STREXB in preference to SWPB. — • If the translation table entries that relate to a memory location accessed by the SWP or SWPB instruction change, or are seen to change by the executing processor as a result of TLB eviction, this might mean that the translation table attributes, permissions or addresses for the load are different to those for the store. In this case, the architecture makes no guarantee that no memory access occur to these memory locations between the load and store. The Virtualization Extensions make the SWP and SWPB instructions OPTIONAL and deprecated: • If an implementation does not include the SWP and SWPB instructions, the ID_ISAR0.Swap_instrs and ID_ISAR4.SWP_frac fields are zero, see About the Instruction Set Attribute registers on page B7-1950. • In an implementation that includes SWP and SWPB, both instructions are UNDEFINED in Hyp mode. +@id 228 + +@desc { + + SWP (Swap) swaps a word between registers and memory. SWP loads a word from the memory address given by the value of register <Rn>. The value of register <Rt2> is then stored to the memory address given by the value of <Rn>, and the original loaded value is written to register <Rt>. If the same register is specified for <Rt> and <Rt2>, this instruction swaps the value of the register and the value at the memory address. SWPB (Swap Byte) swaps a byte between registers and memory. SWPB loads a byte from the memory address given by the value of register <Rn>. The value of the least significant byte of register <Rt2> is stored to the memory address given by <Rn>, the original loaded value is zero-extended to a 32-bit word, and the word is written to register <Rt>. If the same register is specified for <Rt> and <Rt2>, this instruction swaps the value of the least significant byte of the register and the byte value at the memory address, and clears the most significant three bytes of the register. For both instructions, the memory system ensures that no other memory access can occur to the memory location between the load access and the store access. Note • The SWP and SWPB instructions rely on the properties of the system beyond the processor to ensure that no stores from other observers can occur between the load access and the store access, and this might not be implemented for all regions of memory on some system implementations. In all cases, SWP and SWPB do ensure that no stores from the processor that executed the SWP or SWPB instruction can occur between the load access and the store access of the SWP or SWPB. • ARM deprecates the use of SWP and SWPB, and strongly recommends that new software uses: LDREX/STREX in preference to SWP — — LDREXB/STREXB in preference to SWPB. • If the translation table entries that relate to a memory location accessed by the SWP or SWPB instruction change, or are seen to change by the executing processor as a result of TLB eviction, this might mean that the translation table attributes, permissions or addresses for the load are different to those for the store. In this case, the architecture makes no guarantee that no memory access occur to these memory locations between the load and store. The Virtualization Extensions make the SWP and SWPB instructions OPTIONAL and deprecated: • If an implementation does not include the SWP and SWPB instructions, the ID_ISAR0.Swap_instrs and ID_ISAR4.SWP_frac fields are zero, see About the Instruction Set Attribute registers on page B7-1950. • In an implementation that includes SWP and SWPB, both instructions are UNDEFINED in Hyp mode. + +} @encoding (A1) { @word cond(4) 0 0 0 1 0 B(1) 0 0 Rn(4) Rt(4) 0 0 0 0 1 0 0 1 Rt2(4) - @syntax <reg_T> <reg_T2> <mem_access> + @syntax { + + @assert { + + B == 0 + + } + + @conv { + + reg_T = Register(Rt) + reg_T2 = Register(Rt2) + reg_N = Register(Rn) + maccess = MemAccessOffset(reg_N, NULL) + + } + + @asm swp reg_T reg_T2 maccess - @conv { + @rules { - reg_T = Register(Rt) - reg_T2 = Register(Rt2) - reg_N = Register(Rn) - size = (B != 4) - mem_access = MakeMemoryAccess(reg_N, NULL, NULL, true, false, false) + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + B == 1 + + } + + @conv { + + reg_T = Register(Rt) + reg_T2 = Register(Rt2) + reg_N = Register(Rn) + maccess = MemAccessOffset(reg_N, NULL) + + } + + @asm swpb reg_T reg_T2 maccess + + @rules { + + check g_arm_instruction_set_cond(cond) - if (size); chk_call ExtendKeyword("b") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/teq_A88237.d b/plugins/arm/v7/opdefs/teq_A88237.d index 89073f6..7b431a3 100644 --- a/plugins/arm/v7/opdefs/teq_A88237.d +++ b/plugins/arm/v7/opdefs/teq_A88237.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,18 +23,28 @@ @title TEQ (immediate) -@desc Test Equivalence (immediate) performs a bitwise exclusive OR operation on a register value and an immediate value. It updates the condition flags based on the result, and discards the result. +@id 236 + +@desc { + + Test Equivalence (immediate) performs a bitwise exclusive OR operation on a register value and an immediate value. It updates the condition flags based on the result, and discards the result. + +} @encoding (T1) { @word 1 1 1 1 0 i(1) 0 0 1 0 0 1 Rn(4) 0 imm3(3) 1 1 1 1 imm8(8) - @syntax <reg_N> <imm32> + @syntax { + + @conv { - @conv { + reg_N = Register(Rn) + const = ThumbExpandImm_C(i:imm3:imm8, APSR_C) - reg_N = Register(Rn) - imm32 = ThumbExpandImm_C(i:imm3:imm8, 0) + } + + @asm teq reg_N const } @@ -44,18 +54,22 @@ @word cond(4) 0 0 1 1 0 0 1 1 Rn(4) 0 0 0 0 imm12(12) - @syntax <reg_N> <imm32> + @syntax { - @conv { + @conv { - reg_N = Register(Rn) - imm32 = ARMExpandImm_C(imm12, 0) + reg_N = Register(Rn) + const = ARMExpandImm_C(imm12, APSR_C) - } + } + + @asm teq reg_N const + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/teq_A88238.d b/plugins/arm/v7/opdefs/teq_A88238.d index 8187d81..9e80034 100644 --- a/plugins/arm/v7/opdefs/teq_A88238.d +++ b/plugins/arm/v7/opdefs/teq_A88238.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title TEQ (register) -@desc Test Equivalence (register) performs a bitwise exclusive OR operation on a register value and an optionally-shifted register value. It updates the condition flags based on the result, and discards the result. +@id 237 + +@desc { + + Test Equivalence (register) performs a bitwise exclusive OR operation on a register value and an optionally-shifted register value. It updates the condition flags based on the result, and discards the result. + +} @encoding (T1) { @word 1 1 1 0 1 0 1 0 1 0 0 1 Rn(4) 0 imm3(3) 1 1 1 1 imm2(2) type(2) Rm(4) - @syntax <reg_N> <reg_M> <?shift> + @syntax { + + @conv { - @conv { + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm3:imm2) - reg_N = Register(Rn) - reg_M = Register(Rm) - shift = DecodeImmShift(type, imm3:imm2) + } + + @asm teq reg_N reg_M ?shift } @@ -45,19 +55,23 @@ @word cond(4) 0 0 0 1 0 0 1 1 Rn(4) 0 0 0 0 imm5(5) type(2) 0 Rm(4) - @syntax <reg_N> <reg_M> <?shift> + @syntax { - @conv { + @conv { - reg_N = Register(Rn) - reg_M = Register(Rm) - shift = DecodeImmShift(type, imm5) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) - } + } + + @asm teq reg_N reg_M ?shift + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/teq_A88239.d b/plugins/arm/v7/opdefs/teq_A88239.d index 986a7f0..76e3062 100644 --- a/plugins/arm/v7/opdefs/teq_A88239.d +++ b/plugins/arm/v7/opdefs/teq_A88239.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,25 +23,37 @@ @title TEQ (register-shifted register) -@desc Test Equivalence (register-shifted register) performs a bitwise exclusive OR operation on a register value and a register-shifted register value. It updates the condition flags based on the result, and discards the result. +@id 238 + +@desc { + + Test Equivalence (register-shifted register) performs a bitwise exclusive OR operation on a register value and a register-shifted register value. It updates the condition flags based on the result, and discards the result. + +} @encoding (A1) { @word cond(4) 0 0 0 1 0 0 1 1 Rn(4) 0 0 0 0 Rs(4) 0 type(2) 1 Rm(4) - @syntax <reg_N> <reg_M> <reg_shift> + @syntax { - @conv { + @conv { - reg_shift = RegisterShift(type, Rs) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift_t = UInt(type) + reg_S = Register(Rs) + shift = BuildRegShift(shift_t, reg_S) - } + } + + @asm teq reg_N reg_M shift + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/tst_A88240.d b/plugins/arm/v7/opdefs/tst_A88240.d index 0ff5121..50c0507 100644 --- a/plugins/arm/v7/opdefs/tst_A88240.d +++ b/plugins/arm/v7/opdefs/tst_A88240.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,18 +23,28 @@ @title TST (immediate) -@desc Test (immediate) performs a bitwise AND operation on a register value and an immediate value. It updates the condition flags based on the result, and discards the result. +@id 239 + +@desc { + + Test (immediate) performs a bitwise AND operation on a register value and an immediate value. It updates the condition flags based on the result, and discards the result. + +} @encoding (T1) { @word 1 1 1 1 0 i(1) 0 0 0 0 0 1 Rn(4) 0 imm3(3) 1 1 1 1 imm8(8) - @syntax <reg_N> <imm32> + @syntax { + + @conv { - @conv { + reg_N = Register(Rn) + const = ThumbExpandImm_C(i:imm3:imm8, APSR_C) - reg_N = Register(Rn) - imm32 = ThumbExpandImm_C(i:imm3:imm8, 0) + } + + @asm tst reg_N const } @@ -44,18 +54,22 @@ @word cond(4) 0 0 1 1 0 0 0 1 Rn(4) 0 0 0 0 imm12(12) - @syntax <reg_N> <imm32> + @syntax { - @conv { + @conv { - reg_N = Register(Rn) - imm32 = ARMExpandImm_C(imm12, 0) + reg_N = Register(Rn) + const = ARMExpandImm_C(imm12, APSR_C) - } + } + + @asm tst reg_N const + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/tst_A88241.d b/plugins/arm/v7/opdefs/tst_A88241.d index 8777d06..ac1d843 100644 --- a/plugins/arm/v7/opdefs/tst_A88241.d +++ b/plugins/arm/v7/opdefs/tst_A88241.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,18 +23,28 @@ @title TST (register) -@desc Test (register) performs a bitwise AND operation on a register value and an optionally-shifted register value. It updates the condition flags based on the result, and discards the result. +@id 240 + +@desc { + + Test (register) performs a bitwise AND operation on a register value and an optionally-shifted register value. It updates the condition flags based on the result, and discards the result. + +} @encoding (t1) { @half 0 1 0 0 0 0 1 0 0 0 Rm(3) Rn(3) - @syntax <reg_N> <reg_M> + @syntax { + + @conv { + + reg_N = Register(Rn) + reg_M = Register(Rm) - @conv { + } - reg_N = Register(Rn) - reg_M = Register(Rm) + @asm tst reg_N reg_M } @@ -44,13 +54,17 @@ @word 1 1 1 0 1 0 1 0 0 0 0 1 Rn(4) 0 imm3(3) 1 1 1 1 imm2(2) type(2) Rm(4) - @syntax ".W" <reg_N> <reg_M> <?shift> + @syntax { - @conv { + @conv { - reg_N = Register(Rn) - reg_M = Register(Rm) - shift = DecodeImmShift(type, imm3:imm2) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm3:imm2) + + } + + @asm tst.w reg_N reg_M ?shift } @@ -60,19 +74,23 @@ @word cond(4) 0 0 0 1 0 0 0 1 Rn(4) 0 0 0 0 imm5(5) type(2) 0 Rm(4) - @syntax <reg_N> <reg_M> <?shift> + @syntax { - @conv { + @conv { - reg_N = Register(Rn) - reg_M = Register(Rm) - shift = DecodeImmShift(type, imm5) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift = DecodeImmShift(type, imm5) - } + } + + @asm tst reg_N reg_M ?shift + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/tst_A88242.d b/plugins/arm/v7/opdefs/tst_A88242.d index d3fdd9c..7ffb302 100644 --- a/plugins/arm/v7/opdefs/tst_A88242.d +++ b/plugins/arm/v7/opdefs/tst_A88242.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,25 +23,37 @@ @title TST (register-shifted register) -@desc Test (register-shifted register) performs a bitwise AND operation on a register value and a register-shifted register value. It updates the condition flags based on the result, and discards the result. +@id 241 + +@desc { + + Test (register-shifted register) performs a bitwise AND operation on a register value and a register-shifted register value. It updates the condition flags based on the result, and discards the result. + +} @encoding (A1) { @word cond(4) 0 0 0 1 0 0 0 1 Rn(4) 0 0 0 0 Rs(4) 0 type(2) 1 Rm(4) - @syntax <reg_N> <reg_M> <reg_shift> + @syntax { - @conv { + @conv { - reg_shift = RegisterShift(type, Rs) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_N = Register(Rn) + reg_M = Register(Rm) + shift_t = UInt(type) + reg_S = Register(Rs) + shift = BuildRegShift(shift_t, reg_S) - } + } + + @asm tst reg_N reg_M shift + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/uadd16_A88243.d b/plugins/arm/v7/opdefs/uadd16_A88243.d index fcaadee..9e6ec47 100644 --- a/plugins/arm/v7/opdefs/uadd16_A88243.d +++ b/plugins/arm/v7/opdefs/uadd16_A88243.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title UADD16 -@desc Unsigned Add 16 performs two 16-bit unsigned integer additions, and writes the results to the destination register. It sets the APSR.GE bits according to the results of the additions. +@id 242 + +@desc { + + Unsigned Add 16 performs two 16-bit unsigned integer additions, and writes the results to the destination register. It sets the APSR.GE bits according to the results of the additions. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 1 0 0 1 Rn(4) 1 1 1 1 Rd(4) 0 1 0 0 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm uadd16 ?reg_D reg_N reg_M } @@ -45,19 +55,23 @@ @word cond(4) 0 1 1 0 0 1 0 1 Rn(4) Rd(4) 1 1 1 1 0 0 0 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - } + } + + @asm uadd16 ?reg_D reg_N reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/uadd8_A88244.d b/plugins/arm/v7/opdefs/uadd8_A88244.d index 451ca79..1cd1b79 100644 --- a/plugins/arm/v7/opdefs/uadd8_A88244.d +++ b/plugins/arm/v7/opdefs/uadd8_A88244.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title UADD8 -@desc Unsigned Add 8 performs four unsigned 8-bit integer additions, and writes the results to the destination register. It sets the APSR.GE bits according to the results of the additions. +@id 243 + +@desc { + + Unsigned Add 8 performs four unsigned 8-bit integer additions, and writes the results to the destination register. It sets the APSR.GE bits according to the results of the additions. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 1 0 0 0 Rn(4) 1 1 1 1 Rd(4) 0 1 0 0 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm uadd8 ?reg_D reg_N reg_M } @@ -45,19 +55,23 @@ @word cond(4) 0 1 1 0 0 1 0 1 Rn(4) Rd(4) 1 1 1 1 1 0 0 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - } + } + + @asm uadd8 ?reg_D reg_N reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/uasx_A88245.d b/plugins/arm/v7/opdefs/uasx_A88245.d index f968527..ada4b7a 100644 --- a/plugins/arm/v7/opdefs/uasx_A88245.d +++ b/plugins/arm/v7/opdefs/uasx_A88245.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title UASX -@desc Unsigned Add and Subtract with Exchange exchanges the two halfwords of the second operand, performs one unsigned 16-bit integer addition and one unsigned 16-bit subtraction, and writes the results to the destination register. It sets the APSR.GE bits according to the results. +@id 244 + +@desc { + + Unsigned Add and Subtract with Exchange exchanges the two halfwords of the second operand, performs one unsigned 16-bit integer addition and one unsigned 16-bit subtraction, and writes the results to the destination register. It sets the APSR.GE bits according to the results. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 1 0 1 0 Rn(4) 1 1 1 1 Rd(4) 0 1 0 0 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm uasx ?reg_D reg_N reg_M } @@ -45,19 +55,23 @@ @word cond(4) 0 1 1 0 0 1 0 1 Rn(4) Rd(4) 1 1 1 1 0 0 1 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - } + } + + @asm uasx ?reg_D reg_N reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/ubfx_A88246.d b/plugins/arm/v7/opdefs/ubfx_A88246.d index 1f9488e..31c3f43 100644 --- a/plugins/arm/v7/opdefs/ubfx_A88246.d +++ b/plugins/arm/v7/opdefs/ubfx_A88246.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,31 @@ @title UBFX -@desc Unsigned Bit Field Extract extracts any number of adjacent bits at any position from a register, zero-extends them to 32 bits, and writes the result to the destination register. +@id 245 + +@desc { + + Unsigned Bit Field Extract extracts any number of adjacent bits at any position from a register, zero-extends them to 32 bits, and writes the result to the destination register. + +} @encoding (T1) { @word 1 1 1 1 0 0 1 1 1 1 0 0 Rn(4) 0 imm3(3) Rd(4) imm2(2) 0 widthm1(5) - @syntax <reg_D> <reg_N> <lsbit> <width> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + lsbit = UInt(imm3:imm2) + widthminus1 = UInt(widthm1) + width = MinusBitDiff(widthminus1, lsbit) - reg_D = Register(Rd) - reg_N = Register(Rn) - lsbit = UInt(imm3:imm2) - width = IncWidth(widthm1) + } + + @asm ubfx reg_D reg_N lsbit width } @@ -46,20 +57,25 @@ @word cond(4) 0 1 1 1 1 1 1 widthm1(5) Rd(4) lsb(5) 1 0 1 Rn(4) - @syntax <reg_D> <reg_N> <lsbit> <width> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - lsbit = UInt(lsb) - width = IncWidth(widthm1) + reg_D = Register(Rd) + reg_N = Register(Rn) + lsbit = UInt(lsb) + widthminus1 = UInt(widthm1) + width = MinusBitDiff(widthminus1, lsbit) - } + } + + @asm ubfx reg_D reg_N lsbit width + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/udf_A88247.d b/plugins/arm/v7/opdefs/udf_A88247.d index 38f818c..db8fc28 100644 --- a/plugins/arm/v7/opdefs/udf_A88247.d +++ b/plugins/arm/v7/opdefs/udf_A88247.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,17 +23,27 @@ @title UDF -@desc Permanently Undefined generates an Undefined Instruction exception. The encodings for UDF used in this section are defined as permanently UNDEFINED in the versions of the architecture specified in this section. Issue C.a of this manual first defines an assembler mnemonic for these encodings. However: • with the Thumb instruction set, ARM deprecates using the UDF instruction in an IT block • in the ARM instruction set, UDF is not conditional. +@id 246 + +@desc { + + Permanently Undefined generates an Undefined Instruction exception. The encodings for UDF used in this section are defined as permanently UNDEFINED in the versions of the architecture specified in this section. Issue C.a of this manual first defines an assembler mnemonic for these encodings. However: • with the Thumb instruction set, ARM deprecates using the UDF instruction in an IT block • in the ARM instruction set, UDF is not conditional. + +} @encoding (t1) { @half 1 1 0 1 1 1 1 0 imm8(8) - @syntax <imm32> + @syntax { + + @conv { - @conv { + imm32 = ZeroExtend(imm8, 32) - imm32 = ZeroExtend(imm8, 32) + } + + @asm udf imm32 } @@ -43,11 +53,15 @@ @word 1 1 1 1 0 1 1 1 1 1 1 1 imm4(4) 1 0 1 0 imm12(12) - @syntax ".W" <imm32> + @syntax { + + @conv { + + imm32 = ZeroExtend(imm4:imm12, 32) - @conv { + } - imm32 = ZeroExtend(imm4:imm12, 32) + @asm udf.w imm32 } @@ -57,11 +71,15 @@ @word 1 1 1 0 0 1 1 1 1 1 1 1 imm12(12) 1 1 1 1 imm4(4) - @syntax <imm32> + @syntax { + + @conv { + + imm32 = ZeroExtend(imm12:imm4, 32) - @conv { + } - imm32 = ZeroExtend(imm12:imm4, 32) + @asm udf imm32 } diff --git a/plugins/arm/v7/opdefs/udiv_A88248.d b/plugins/arm/v7/opdefs/udiv_A88248.d index eea7947..411e323 100644 --- a/plugins/arm/v7/opdefs/udiv_A88248.d +++ b/plugins/arm/v7/opdefs/udiv_A88248.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title UDIV -@desc Unsigned Divide divides a 32-bit unsigned integer register value by a 32-bit unsigned integer register value, and writes the result to the destination register. The condition flags are not affected. See ARMv7 implementation requirements and options for the divide instructions on page A4-172 for more information about this instruction. +@id 247 + +@desc { + + Unsigned Divide divides a 32-bit unsigned integer register value by a 32-bit unsigned integer register value, and writes the result to the destination register. The condition flags are not affected. See ARMv7 implementation requirements and options for the divide instructions on page A4-172 for more information about this instruction. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 1 1 0 1 1 Rn(4) 1 1 1 1 Rd(4) 1 1 1 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm udiv ?reg_D reg_N reg_M } @@ -45,19 +55,23 @@ @word cond(4) 0 1 1 1 0 0 1 1 Rd(4) 1 1 1 1 Rm(4) 0 0 0 1 Rn(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - } + } + + @asm udiv ?reg_D reg_N reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/uhadd16_A88249.d b/plugins/arm/v7/opdefs/uhadd16_A88249.d index 54da5b0..e335f3c 100644 --- a/plugins/arm/v7/opdefs/uhadd16_A88249.d +++ b/plugins/arm/v7/opdefs/uhadd16_A88249.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title UHADD16 -@desc Unsigned Halving Add 16 performs two unsigned 16-bit integer additions, halves the results, and writes the results to the destination register. +@id 248 + +@desc { + + Unsigned Halving Add 16 performs two unsigned 16-bit integer additions, halves the results, and writes the results to the destination register. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 1 0 0 1 Rn(4) 1 1 1 1 Rd(4) 0 1 1 0 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm uhadd16 ?reg_D reg_N reg_M } @@ -45,19 +55,23 @@ @word cond(4) 0 1 1 0 0 1 1 1 Rn(4) Rd(4) 1 1 1 1 0 0 0 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - } + } + + @asm uhadd16 ?reg_D reg_N reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/uhadd8_A88250.d b/plugins/arm/v7/opdefs/uhadd8_A88250.d index 759a0a7..f392b5e 100644 --- a/plugins/arm/v7/opdefs/uhadd8_A88250.d +++ b/plugins/arm/v7/opdefs/uhadd8_A88250.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title UHADD8 -@desc Unsigned Halving Add 8 performs four unsigned 8-bit integer additions, halves the results, and writes the results to the destination register. +@id 249 + +@desc { + + Unsigned Halving Add 8 performs four unsigned 8-bit integer additions, halves the results, and writes the results to the destination register. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 1 0 0 0 Rn(4) 1 1 1 1 Rd(4) 0 1 1 0 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm uhadd8 ?reg_D reg_N reg_M } @@ -45,19 +55,23 @@ @word cond(4) 0 1 1 0 0 1 1 1 Rn(4) Rd(4) 1 1 1 1 1 0 0 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - } + } + + @asm uhadd8 ?reg_D reg_N reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/uhasx_A88251.d b/plugins/arm/v7/opdefs/uhasx_A88251.d index 3751394..b5c4153 100644 --- a/plugins/arm/v7/opdefs/uhasx_A88251.d +++ b/plugins/arm/v7/opdefs/uhasx_A88251.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title UHASX -@desc Unsigned Halving Add and Subtract with Exchange exchanges the two halfwords of the second operand, performs one unsigned 16-bit integer addition and one unsigned 16-bit subtraction, halves the results, and writes the results to the destination register. +@id 250 + +@desc { + + Unsigned Halving Add and Subtract with Exchange exchanges the two halfwords of the second operand, performs one unsigned 16-bit integer addition and one unsigned 16-bit subtraction, halves the results, and writes the results to the destination register. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 1 0 1 0 Rn(4) 1 1 1 1 Rd(4) 0 1 1 0 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm uhasx ?reg_D reg_N reg_M } @@ -45,19 +55,23 @@ @word cond(4) 0 1 1 0 0 1 1 1 Rn(4) Rd(4) 1 1 1 1 0 0 1 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - } + } + + @asm uhasx ?reg_D reg_N reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/uhsax_A88252.d b/plugins/arm/v7/opdefs/uhsax_A88252.d index f06b2ba..7b793f4 100644 --- a/plugins/arm/v7/opdefs/uhsax_A88252.d +++ b/plugins/arm/v7/opdefs/uhsax_A88252.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title UHSAX -@desc Unsigned Halving Subtract and Add with Exchange exchanges the two halfwords of the second operand, performs one unsigned 16-bit integer subtraction and one unsigned 16-bit addition, halves the results, and writes the results to the destination register. +@id 251 + +@desc { + + Unsigned Halving Subtract and Add with Exchange exchanges the two halfwords of the second operand, performs one unsigned 16-bit integer subtraction and one unsigned 16-bit addition, halves the results, and writes the results to the destination register. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 1 1 1 0 Rn(4) 1 1 1 1 Rd(4) 0 1 1 0 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm uhsax ?reg_D reg_N reg_M } @@ -45,19 +55,23 @@ @word cond(4) 0 1 1 0 0 1 1 1 Rn(4) Rd(4) 1 1 1 1 0 1 0 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - } + } + + @asm uhsax ?reg_D reg_N reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/uhsub16_A88253.d b/plugins/arm/v7/opdefs/uhsub16_A88253.d index 93f92f7..482ac1d 100644 --- a/plugins/arm/v7/opdefs/uhsub16_A88253.d +++ b/plugins/arm/v7/opdefs/uhsub16_A88253.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title UHSUB16 -@desc Unsigned Halving Subtract 16 performs two unsigned 16-bit integer subtractions, halves the results, and writes the results to the destination register. +@id 252 + +@desc { + + Unsigned Halving Subtract 16 performs two unsigned 16-bit integer subtractions, halves the results, and writes the results to the destination register. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 1 1 0 1 Rn(4) 1 1 1 1 Rd(4) 0 1 1 0 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm uhsub16 ?reg_D reg_N reg_M } @@ -45,19 +55,23 @@ @word cond(4) 0 1 1 0 0 1 1 1 Rn(4) Rd(4) 1 1 1 1 0 1 1 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - } + } + + @asm uhsub16 ?reg_D reg_N reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/uhsub8_A88254.d b/plugins/arm/v7/opdefs/uhsub8_A88254.d index 198a095..c5349e4 100644 --- a/plugins/arm/v7/opdefs/uhsub8_A88254.d +++ b/plugins/arm/v7/opdefs/uhsub8_A88254.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title UHSUB8 -@desc Unsigned Halving Subtract 8 performs four unsigned 8-bit integer subtractions, halves the results, and writes the results to the destination register. +@id 253 + +@desc { + + Unsigned Halving Subtract 8 performs four unsigned 8-bit integer subtractions, halves the results, and writes the results to the destination register. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 1 1 0 0 Rn(4) 1 1 1 1 Rd(4) 0 1 1 0 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm uhsub8 ?reg_D reg_N reg_M } @@ -45,19 +55,23 @@ @word cond(4) 0 1 1 0 0 1 1 1 Rn(4) Rd(4) 1 1 1 1 1 1 1 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - } + } + + @asm uhsub8 ?reg_D reg_N reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/umaal_A88255.d b/plugins/arm/v7/opdefs/umaal_A88255.d index 34cb707..10a823a 100644 --- a/plugins/arm/v7/opdefs/umaal_A88255.d +++ b/plugins/arm/v7/opdefs/umaal_A88255.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title UMAAL -@desc Unsigned Multiply Accumulate Accumulate Long multiplies two unsigned 32-bit values to produce a 64-bit value, adds two unsigned 32-bit values, and writes the 64-bit result to two registers. +@id 254 + +@desc { + + Unsigned Multiply Accumulate Accumulate Long multiplies two unsigned 32-bit values to produce a 64-bit value, adds two unsigned 32-bit values, and writes the 64-bit result to two registers. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 1 1 1 1 0 Rn(4) RdLo(4) RdHi(4) 0 1 1 0 Rm(4) - @syntax <reg_DLO> <reg_DHI> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_DLO = Register(RdLo) + reg_DHI = Register(RdHi) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_DLO = Register(RdLo) - reg_DHI = Register(RdHi) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm umaal reg_DLO reg_DHI reg_N reg_M } @@ -46,20 +56,24 @@ @word cond(4) 0 0 0 0 0 1 0 0 RdHi(4) RdLo(4) Rm(4) 1 0 0 1 Rn(4) - @syntax <reg_DLO> <reg_DHI> <reg_N> <reg_M> + @syntax { - @conv { + @conv { - reg_DLO = Register(RdLo) - reg_DHI = Register(RdHi) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_DLO = Register(RdLo) + reg_DHI = Register(RdHi) + reg_N = Register(Rn) + reg_M = Register(Rm) - } + } + + @asm umaal reg_DLO reg_DHI reg_N reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/umlal_A88256.d b/plugins/arm/v7/opdefs/umlal_A88256.d index 00d1903..83af10c 100644 --- a/plugins/arm/v7/opdefs/umlal_A88256.d +++ b/plugins/arm/v7/opdefs/umlal_A88256.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title UMLAL -@desc Unsigned Multiply Accumulate Long multiplies two unsigned 32-bit values to produce a 64-bit value, and accumulates this with a 64-bit value. In ARM instructions, the condition flags can optionally be updated based on the result. Use of this option adversely affects performance on many processor implementations. +@id 255 + +@desc { + + Unsigned Multiply Accumulate Long multiplies two unsigned 32-bit values to produce a 64-bit value, and accumulates this with a 64-bit value. In ARM instructions, the condition flags can optionally be updated based on the result. Use of this option adversely affects performance on many processor implementations. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 1 1 1 1 0 Rn(4) RdLo(4) RdHi(4) 0 0 0 0 Rm(4) - @syntax <reg_DLO> <reg_DHI> <reg_N> <reg_M> + @syntax { + + @conv { + + reg_DLO = Register(RdLo) + reg_DHI = Register(RdHi) + reg_N = Register(Rn) + reg_M = Register(Rm) - @conv { + } - reg_DLO = Register(RdLo) - reg_DHI = Register(RdHi) - reg_N = Register(Rn) - reg_M = Register(Rm) + @asm umlal reg_DLO reg_DHI reg_N reg_M } @@ -46,22 +56,57 @@ @word cond(4) 0 0 0 0 1 0 1 S(1) RdHi(4) RdLo(4) Rm(4) 1 0 0 1 Rn(4) - @syntax <reg_DLO> <reg_DHI> <reg_N> <reg_M> + @syntax { + + @assert { + + S == 0 + + } + + @conv { + + reg_DLO = Register(RdLo) + reg_DHI = Register(RdHi) + reg_N = Register(Rn) + reg_M = Register(Rm) + + } - @conv { + @asm umlal reg_DLO reg_DHI reg_N reg_M - reg_DLO = Register(RdLo) - reg_DHI = Register(RdHi) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_DLO = Register(RdLo) + reg_DHI = Register(RdHi) + reg_N = Register(Rn) + reg_M = Register(Rm) + + } + + @asm umlals reg_DLO reg_DHI reg_N reg_M + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/umull_A88257.d b/plugins/arm/v7/opdefs/umull_A88257.d index d2cc321..2164bb4 100644 --- a/plugins/arm/v7/opdefs/umull_A88257.d +++ b/plugins/arm/v7/opdefs/umull_A88257.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title UMULL -@desc Unsigned Multiply Long multiplies two 32-bit unsigned values to produce a 64-bit result. In ARM instructions, the condition flags can optionally be updated based on the result. Use of this option adversely affects performance on many processor implementations. +@id 256 + +@desc { + + Unsigned Multiply Long multiplies two 32-bit unsigned values to produce a 64-bit result. In ARM instructions, the condition flags can optionally be updated based on the result. Use of this option adversely affects performance on many processor implementations. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 1 1 0 1 0 Rn(4) RdLo(4) RdHi(4) 0 0 0 0 Rm(4) - @syntax <reg_DLO> <reg_DHI> <reg_N> <reg_M> + @syntax { + + @conv { + + reg_DLO = Register(RdLo) + reg_DHI = Register(RdHi) + reg_N = Register(Rn) + reg_M = Register(Rm) - @conv { + } - reg_DLO = Register(RdLo) - reg_DHI = Register(RdHi) - reg_N = Register(Rn) - reg_M = Register(Rm) + @asm umull reg_DLO reg_DHI reg_N reg_M } @@ -46,22 +56,57 @@ @word cond(4) 0 0 0 0 1 0 0 S(1) RdHi(4) RdLo(4) Rm(4) 1 0 0 1 Rn(4) - @syntax <reg_DLO> <reg_DHI> <reg_N> <reg_M> + @syntax { + + @assert { + + S == 0 + + } + + @conv { + + reg_DLO = Register(RdLo) + reg_DHI = Register(RdHi) + reg_N = Register(Rn) + reg_M = Register(Rm) + + } - @conv { + @asm umull reg_DLO reg_DHI reg_N reg_M - reg_DLO = Register(RdLo) - reg_DHI = Register(RdHi) - reg_N = Register(Rn) - reg_M = Register(Rm) - setflags = (S == '1') + @rules { + + check g_arm_instruction_set_cond(cond) + + } } - @rules { + @syntax { + + @assert { + + S == 1 + + } + + @conv { + + reg_DLO = Register(RdLo) + reg_DHI = Register(RdHi) + reg_N = Register(Rn) + reg_M = Register(Rm) + + } + + @asm umulls reg_DLO reg_DHI reg_N reg_M + + @rules { + + check g_arm_instruction_set_cond(cond) - if (setflags); chk_call ExtendKeyword("s") - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/uqadd16_A88258.d b/plugins/arm/v7/opdefs/uqadd16_A88258.d index 14528c8..4e099ec 100644 --- a/plugins/arm/v7/opdefs/uqadd16_A88258.d +++ b/plugins/arm/v7/opdefs/uqadd16_A88258.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title UQADD16 -@desc Unsigned Saturating Add 16 performs two unsigned 16-bit integer additions, saturates the results to the 16-bit unsigned integer range 0 ≤ x ≤ 216 – 1, and writes the results to the destination register. +@id 257 + +@desc { + + Unsigned Saturating Add 16 performs two unsigned 16-bit integer additions, saturates the results to the 16-bit unsigned integer range 0 ≤ x ≤ 216 – 1, and writes the results to the destination register. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 1 0 0 1 Rn(4) 1 1 1 1 Rd(4) 0 1 0 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm uqadd16 ?reg_D reg_N reg_M } @@ -45,19 +55,23 @@ @word cond(4) 0 1 1 0 0 1 1 0 Rn(4) Rd(4) 1 1 1 1 0 0 0 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - } + } + + @asm uqadd16 ?reg_D reg_N reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/uqadd8_A88259.d b/plugins/arm/v7/opdefs/uqadd8_A88259.d index 94b8e39..4ac517a 100644 --- a/plugins/arm/v7/opdefs/uqadd8_A88259.d +++ b/plugins/arm/v7/opdefs/uqadd8_A88259.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title UQADD8 -@desc Unsigned Saturating Add 8 performs four unsigned 8-bit integer additions, saturates the results to the 8-bit unsigned integer range 0 ≤ x ≤ 28 – 1, and writes the results to the destination register. +@id 258 + +@desc { + + Unsigned Saturating Add 8 performs four unsigned 8-bit integer additions, saturates the results to the 8-bit unsigned integer range 0 ≤ x ≤ 28 – 1, and writes the results to the destination register. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 1 0 0 0 Rn(4) 1 1 1 1 Rd(4) 0 1 0 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm uqadd8 ?reg_D reg_N reg_M } @@ -45,19 +55,23 @@ @word cond(4) 0 1 1 0 0 1 1 0 Rn(4) Rd(4) 1 1 1 1 1 0 0 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - } + } + + @asm uqadd8 ?reg_D reg_N reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/uqasx_A88260.d b/plugins/arm/v7/opdefs/uqasx_A88260.d index 174b08c..0b2047f 100644 --- a/plugins/arm/v7/opdefs/uqasx_A88260.d +++ b/plugins/arm/v7/opdefs/uqasx_A88260.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title UQASX -@desc Unsigned Saturating Add and Subtract with Exchange exchanges the two halfwords of the second operand, performs one unsigned 16-bit integer addition and one unsigned 16-bit subtraction, saturates the results to the 16-bit unsigned integer range 0 ≤ x ≤ 216 – 1, and writes the results to the destination register. +@id 259 + +@desc { + + Unsigned Saturating Add and Subtract with Exchange exchanges the two halfwords of the second operand, performs one unsigned 16-bit integer addition and one unsigned 16-bit subtraction, saturates the results to the 16-bit unsigned integer range 0 ≤ x ≤ 216 – 1, and writes the results to the destination register. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 1 0 1 0 Rn(4) 1 1 1 1 Rd(4) 0 1 0 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm uqasx ?reg_D reg_N reg_M } @@ -45,19 +55,23 @@ @word cond(4) 0 1 1 0 0 1 1 0 Rn(4) Rd(4) 1 1 1 1 0 0 1 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - } + } + + @asm uqasx ?reg_D reg_N reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/uqsax_A88261.d b/plugins/arm/v7/opdefs/uqsax_A88261.d index 6092e51..57b1b3f 100644 --- a/plugins/arm/v7/opdefs/uqsax_A88261.d +++ b/plugins/arm/v7/opdefs/uqsax_A88261.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title UQSAX -@desc Unsigned Saturating Subtract and Add with Exchange exchanges the two halfwords of the second operand, performs one unsigned 16-bit integer subtraction and one unsigned 16-bit addition, saturates the results to the 16-bit unsigned integer range 0 ≤ x ≤ 216 – 1, and writes the results to the destination register. +@id 260 + +@desc { + + Unsigned Saturating Subtract and Add with Exchange exchanges the two halfwords of the second operand, performs one unsigned 16-bit integer subtraction and one unsigned 16-bit addition, saturates the results to the 16-bit unsigned integer range 0 ≤ x ≤ 216 – 1, and writes the results to the destination register. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 1 1 1 0 Rn(4) 1 1 1 1 Rd(4) 0 1 0 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm uqsax ?reg_D reg_N reg_M } @@ -45,19 +55,23 @@ @word cond(4) 0 1 1 0 0 1 1 0 Rn(4) Rd(4) 1 1 1 1 0 1 0 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - } + } + + @asm uqsax ?reg_D reg_N reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/uqsub16_A88262.d b/plugins/arm/v7/opdefs/uqsub16_A88262.d index 1f458ff..23a4fb7 100644 --- a/plugins/arm/v7/opdefs/uqsub16_A88262.d +++ b/plugins/arm/v7/opdefs/uqsub16_A88262.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title UQSUB16 -@desc Unsigned Saturating Subtract 16 performs two unsigned 16-bit integer subtractions, saturates the results to the 16-bit unsigned integer range 0 ≤ x ≤ 216 – 1, and writes the results to the destination register. +@id 261 + +@desc { + + Unsigned Saturating Subtract 16 performs two unsigned 16-bit integer subtractions, saturates the results to the 16-bit unsigned integer range 0 ≤ x ≤ 216 – 1, and writes the results to the destination register. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 1 1 0 1 Rn(4) 1 1 1 1 Rd(4) 0 1 0 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm uqsub16 ?reg_D reg_N reg_M } @@ -45,19 +55,23 @@ @word cond(4) 0 1 1 0 0 1 1 0 Rn(4) Rd(4) 1 1 1 1 0 1 1 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - } + } + + @asm uqsub16 ?reg_D reg_N reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/uqsub8_A88263.d b/plugins/arm/v7/opdefs/uqsub8_A88263.d index 37d96e7..4054ec5 100644 --- a/plugins/arm/v7/opdefs/uqsub8_A88263.d +++ b/plugins/arm/v7/opdefs/uqsub8_A88263.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title UQSUB8 -@desc Unsigned Saturating Subtract 8 performs four unsigned 8-bit integer subtractions, saturates the results to the 8-bit unsigned integer range 0 ≤ x ≤ 28 – 1, and writes the results to the destination register. +@id 262 + +@desc { + + Unsigned Saturating Subtract 8 performs four unsigned 8-bit integer subtractions, saturates the results to the 8-bit unsigned integer range 0 ≤ x ≤ 28 – 1, and writes the results to the destination register. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 1 1 0 0 Rn(4) 1 1 1 1 Rd(4) 0 1 0 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm uqsub8 ?reg_D reg_N reg_M } @@ -45,19 +55,23 @@ @word cond(4) 0 1 1 0 0 1 1 0 Rn(4) Rd(4) 1 1 1 1 1 1 1 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - } + } + + @asm uqsub8 ?reg_D reg_N reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/usad8_A88264.d b/plugins/arm/v7/opdefs/usad8_A88264.d index 09d7ece..2927910 100644 --- a/plugins/arm/v7/opdefs/usad8_A88264.d +++ b/plugins/arm/v7/opdefs/usad8_A88264.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title USAD8 -@desc Unsigned Sum of Absolute Differences performs four unsigned 8-bit subtractions, and adds the absolute values of the differences together. +@id 263 + +@desc { + + Unsigned Sum of Absolute Differences performs four unsigned 8-bit subtractions, and adds the absolute values of the differences together. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 1 0 1 1 1 Rn(4) 1 1 1 1 Rd(4) 0 0 0 0 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm usad8 ?reg_D reg_N reg_M } @@ -45,19 +55,23 @@ @word cond(4) 0 1 1 1 1 0 0 0 Rd(4) 1 1 1 1 Rm(4) 0 0 0 1 Rn(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - } + } + + @asm usad8 ?reg_D reg_N reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/usada8_A88265.d b/plugins/arm/v7/opdefs/usada8_A88265.d index dd1efdb..df1b7f4 100644 --- a/plugins/arm/v7/opdefs/usada8_A88265.d +++ b/plugins/arm/v7/opdefs/usada8_A88265.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title USADA8 -@desc Unsigned Sum of Absolute Differences and Accumulate performs four unsigned 8-bit subtractions, and adds the absolute values of the differences to a 32-bit accumulate operand. +@id 264 + +@desc { + + Unsigned Sum of Absolute Differences and Accumulate performs four unsigned 8-bit subtractions, and adds the absolute values of the differences to a 32-bit accumulate operand. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 1 0 1 1 1 Rn(4) Ra(4) Rd(4) 0 0 0 0 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <reg_A> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + reg_A = Register(Ra) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - reg_A = Register(Ra) + } + + @asm usada8 reg_D reg_N reg_M reg_A } @@ -46,20 +56,24 @@ @word cond(4) 0 1 1 1 1 0 0 0 Rd(4) Ra(4) Rm(4) 0 0 0 1 Rn(4) - @syntax <reg_D> <reg_N> <reg_M> <reg_A> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - reg_A = Register(Ra) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + reg_A = Register(Ra) - } + } + + @asm usada8 reg_D reg_N reg_M reg_A + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/usat16_A88267.d b/plugins/arm/v7/opdefs/usat16_A88267.d index c091dc6..056c0f2 100644 --- a/plugins/arm/v7/opdefs/usat16_A88267.d +++ b/plugins/arm/v7/opdefs/usat16_A88267.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title USAT16 -@desc Unsigned Saturate 16 saturates two signed 16-bit values to a selected unsigned range. The Q flag is set if the operation saturates. +@id 266 + +@desc { + + Unsigned Saturate 16 saturates two signed 16-bit values to a selected unsigned range. The Q flag is set if the operation saturates. + +} @encoding (T1) { @word 1 1 1 1 0 0 1 1 1 0 1 0 Rn(4) 0 0 0 0 Rd(4) 0 0 0 0 sat_imm(4) - @syntax <reg_D> <saturate_to> <reg_N> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + saturate_to = UInt(sat_imm) + reg_N = Register(Rn) - reg_D = Register(Rd) - reg_N = Register(Rn) - saturate_to = UInt(sat_imm) + } + + @asm usat16 reg_D saturate_to reg_N } @@ -45,19 +55,23 @@ @word cond(4) 0 1 1 0 1 1 1 0 sat_imm(4) Rd(4) 1 1 1 1 0 0 1 1 Rn(4) - @syntax <reg_D> <saturate_to> <reg_N> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - saturate_to = UInt(sat_imm) + reg_D = Register(Rd) + saturate_to = UInt(sat_imm) + reg_N = Register(Rn) - } + } + + @asm usat16 reg_D saturate_to reg_N + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/usat_A88266.d b/plugins/arm/v7/opdefs/usat_A88266.d index 55de21a..c89d083 100644 --- a/plugins/arm/v7/opdefs/usat_A88266.d +++ b/plugins/arm/v7/opdefs/usat_A88266.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title USAT -@desc Unsigned Saturate saturates an optionally-shifted signed value to a selected unsigned range. The Q flag is set if the operation saturates. +@id 265 + +@desc { + + Unsigned Saturate saturates an optionally-shifted signed value to a selected unsigned range. The Q flag is set if the operation saturates. + +} @encoding (T1) { @word 1 1 1 1 0 0 1 1 1 0 sh(1) 0 Rn(4) 0 imm3(3) Rd(4) imm2(2) 0 sat_imm(5) - @syntax <reg_D> <saturate_to> <reg_N> <?shift> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + saturate_to = UInt(sat_imm) + reg_N = Register(Rn) + shift = DecodeImmShift(sh:'0', imm3:imm2) - reg_D = Register(Rd) - reg_N = Register(Rn) - saturate_to = UInt(sat_imm) - shift = DecodeImmShift(sh:'0', imm3:imm2) + } + + @asm usat reg_D saturate_to reg_N ?shift } @@ -46,20 +56,24 @@ @word cond(4) 0 1 1 0 1 1 1 sat_imm(5) Rd(4) imm5(5) sh(1) 0 1 Rn(4) - @syntax <reg_D> <saturate_to> <reg_N> <?shift> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - saturate_to = UInt(sat_imm) - shift = DecodeImmShift(sh:'0', imm5) + reg_D = Register(Rd) + saturate_to = UInt(sat_imm) + reg_N = Register(Rn) + shift = DecodeImmShift(sh:'0', imm5) - } + } + + @asm usat reg_D saturate_to reg_N ?shift + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/usax_A88268.d b/plugins/arm/v7/opdefs/usax_A88268.d index 040eedc..d8c5305 100644 --- a/plugins/arm/v7/opdefs/usax_A88268.d +++ b/plugins/arm/v7/opdefs/usax_A88268.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title USAX -@desc Unsigned Subtract and Add with Exchange exchanges the two halfwords of the second operand, performs one unsigned 16-bit integer subtraction and one unsigned 16-bit addition, and writes the results to the destination register. It sets the APSR.GE bits according to the results. +@id 267 + +@desc { + + Unsigned Subtract and Add with Exchange exchanges the two halfwords of the second operand, performs one unsigned 16-bit integer subtraction and one unsigned 16-bit addition, and writes the results to the destination register. It sets the APSR.GE bits according to the results. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 1 1 1 0 Rn(4) 1 1 1 1 Rd(4) 0 1 0 0 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm usax ?reg_D reg_N reg_M } @@ -45,19 +55,23 @@ @word cond(4) 0 1 1 0 0 1 0 1 Rn(4) Rd(4) 1 1 1 1 0 1 0 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - } + } + + @asm usax ?reg_D reg_N reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/usub16_A88269.d b/plugins/arm/v7/opdefs/usub16_A88269.d index 31796d9..1209abf 100644 --- a/plugins/arm/v7/opdefs/usub16_A88269.d +++ b/plugins/arm/v7/opdefs/usub16_A88269.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title USUB16 -@desc Unsigned Subtract 16 performs two 16-bit unsigned integer subtractions, and writes the results to the destination register. It sets the APSR.GE bits according to the results of the subtractions. +@id 268 + +@desc { + + Unsigned Subtract 16 performs two 16-bit unsigned integer subtractions, and writes the results to the destination register. It sets the APSR.GE bits according to the results of the subtractions. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 1 1 0 1 Rn(4) 1 1 1 1 Rd(4) 0 1 0 0 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm usub16 ?reg_D reg_N reg_M } @@ -45,19 +55,23 @@ @word cond(4) 0 1 1 0 0 1 0 1 Rn(4) Rd(4) 1 1 1 1 0 1 1 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - } + } + + @asm usub16 ?reg_D reg_N reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/usub8_A88270.d b/plugins/arm/v7/opdefs/usub8_A88270.d index 576894c..659a0e0 100644 --- a/plugins/arm/v7/opdefs/usub8_A88270.d +++ b/plugins/arm/v7/opdefs/usub8_A88270.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title USUB8 -@desc Unsigned Subtract 8 performs four 8-bit unsigned integer subtractions, and writes the results to the destination register. It sets the APSR.GE bits according to the results of the subtractions. +@id 269 + +@desc { + + Unsigned Subtract 8 performs four 8-bit unsigned integer subtractions, and writes the results to the destination register. It sets the APSR.GE bits according to the results of the subtractions. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 1 1 0 0 Rn(4) 1 1 1 1 Rd(4) 0 1 0 0 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + } + + @asm usub8 ?reg_D reg_N reg_M } @@ -45,19 +55,23 @@ @word cond(4) 0 1 1 0 0 1 0 1 Rn(4) Rd(4) 1 1 1 1 1 1 1 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) - } + } + + @asm usub8 ?reg_D reg_N reg_M + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/uxtab16_A88272.d b/plugins/arm/v7/opdefs/uxtab16_A88272.d index 4fc61d2..92109fb 100644 --- a/plugins/arm/v7/opdefs/uxtab16_A88272.d +++ b/plugins/arm/v7/opdefs/uxtab16_A88272.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title UXTAB16 -@desc Unsigned Extend and Add Byte 16 extracts two 8-bit values from a register, zero-extends them to 16 bits each, adds the results to two 16-bit values from another register, and writes the final results to the destination register. The instruction can specify a rotation by 0, 8, 16, or 24 bits before extracting the 8-bit values. +@id 271 + +@desc { + + Unsigned Extend and Add Byte 16 extracts two 8-bit values from a register, zero-extends them to 16 bits each, adds the results to two 16-bit values from another register, and writes the final results to the destination register. The instruction can specify a rotation by 0, 8, 16, or 24 bits before extracting the 8-bit values. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 0 0 1 1 Rn(4) 1 1 1 1 Rd(4) 1 0 rotate(2) Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <?rotation> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + rotation = Rotation(rotate:'000') - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - rotation = Rotation(rotate:'000') + } + + @asm uxtab16 ?reg_D reg_N reg_M ?rotation } @@ -46,20 +56,24 @@ @word cond(4) 0 1 1 0 1 1 0 0 Rn(4) Rd(4) rotate(2) 0 0 0 1 1 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <?rotation> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - rotation = Rotation(rotate:'000') + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + rotation = Rotation(rotate:'000') - } + } + + @asm uxtab16 ?reg_D reg_N reg_M ?rotation + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/uxtab_A88271.d b/plugins/arm/v7/opdefs/uxtab_A88271.d index fe27d4b..9c98102 100644 --- a/plugins/arm/v7/opdefs/uxtab_A88271.d +++ b/plugins/arm/v7/opdefs/uxtab_A88271.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title UXTAB -@desc Unsigned Extend and Add Byte extracts an 8-bit value from a register, zero-extends it to 32 bits, adds the result to the value in another register, and writes the final result to the destination register. The instruction can specify a rotation by 0, 8, 16, or 24 bits before extracting the 8-bit value. +@id 270 + +@desc { + + Unsigned Extend and Add Byte extracts an 8-bit value from a register, zero-extends it to 32 bits, adds the result to the value in another register, and writes the final result to the destination register. The instruction can specify a rotation by 0, 8, 16, or 24 bits before extracting the 8-bit value. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 0 1 0 1 Rn(4) 1 1 1 1 Rd(4) 1 0 rotate(2) Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <?rotation> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + rotation = Rotation(rotate:'000') - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - rotation = Rotation(rotate:'000') + } + + @asm uxtab ?reg_D reg_N reg_M ?rotation } @@ -46,20 +56,24 @@ @word cond(4) 0 1 1 0 1 1 1 0 Rn(4) Rd(4) rotate(2) 0 0 0 1 1 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <?rotation> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - rotation = Rotation(rotate:'000') + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + rotation = Rotation(rotate:'000') - } + } + + @asm uxtab ?reg_D reg_N reg_M ?rotation + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/uxtah_A88273.d b/plugins/arm/v7/opdefs/uxtah_A88273.d index 3c587d9..c1d0d36 100644 --- a/plugins/arm/v7/opdefs/uxtah_A88273.d +++ b/plugins/arm/v7/opdefs/uxtah_A88273.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,20 +23,30 @@ @title UXTAH -@desc Unsigned Extend and Add Halfword extracts a 16-bit value from a register, zero-extends it to 32 bits, adds the result to a value from another register, and writes the final result to the destination register. The instruction can specify a rotation by 0, 8, 16, or 24 bits before extracting the 16-bit value. +@id 272 + +@desc { + + Unsigned Extend and Add Halfword extracts a 16-bit value from a register, zero-extends it to 32 bits, adds the result to a value from another register, and writes the final result to the destination register. The instruction can specify a rotation by 0, 8, 16, or 24 bits before extracting the 16-bit value. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 0 0 0 1 Rn(4) 1 1 1 1 Rd(4) 1 0 rotate(2) Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <?rotation> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + rotation = Rotation(rotate:'000') - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - rotation = Rotation(rotate:'000') + } + + @asm uxtah ?reg_D reg_N reg_M ?rotation } @@ -46,20 +56,24 @@ @word cond(4) 0 1 1 0 1 1 1 1 Rn(4) Rd(4) rotate(2) 0 0 0 1 1 1 Rm(4) - @syntax <reg_D> <reg_N> <reg_M> <?rotation> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_N = Register(Rn) - reg_M = Register(Rm) - rotation = Rotation(rotate:'000') + reg_D = Register(Rd) + reg_N = Register(Rn) + reg_M = Register(Rm) + rotation = Rotation(rotate:'000') - } + } + + @asm uxtah ?reg_D reg_N reg_M ?rotation + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/uxtb16_A88275.d b/plugins/arm/v7/opdefs/uxtb16_A88275.d index a30d133..b2ac134 100644 --- a/plugins/arm/v7/opdefs/uxtb16_A88275.d +++ b/plugins/arm/v7/opdefs/uxtb16_A88275.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,29 @@ @title UXTB16 -@desc Unsigned Extend Byte 16 extracts two 8-bit values from a register, zero-extends them to 16 bits each, and writes the results to the destination register. The instruction can specify a rotation by 0, 8, 16, or 24 bits before extracting the 8-bit values. +@id 274 + +@desc { + + Unsigned Extend Byte 16 extracts two 8-bit values from a register, zero-extends them to 16 bits each, and writes the results to the destination register. The instruction can specify a rotation by 0, 8, 16, or 24 bits before extracting the 8-bit values. + +} @encoding (T1) { @word 1 1 1 1 1 0 1 0 0 0 1 1 1 1 1 1 1 1 1 1 Rd(4) 1 0 rotate(2) Rm(4) - @syntax <reg_D> <reg_M> <?rotation> + @syntax { + + @conv { - @conv { + reg_D = Register(Rd) + reg_M = Register(Rm) + rotation = Rotation(rotate:'000') - reg_D = Register(Rd) - reg_M = Register(Rm) - rotation = Rotation(rotate:'000') + } + + @asm uxtb16 ?reg_D reg_M ?rotation } @@ -45,19 +55,23 @@ @word cond(4) 0 1 1 0 1 1 0 0 1 1 1 1 Rd(4) rotate(2) 0 0 0 1 1 1 Rm(4) - @syntax <reg_D> <reg_M> <?rotation> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_M = Register(Rm) - rotation = Rotation(rotate:'000') + reg_D = Register(Rd) + reg_M = Register(Rm) + rotation = Rotation(rotate:'000') - } + } + + @asm uxtb16 ?reg_D reg_M ?rotation + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/uxtb_A88274.d b/plugins/arm/v7/opdefs/uxtb_A88274.d index f49ba83..ac5b421 100644 --- a/plugins/arm/v7/opdefs/uxtb_A88274.d +++ b/plugins/arm/v7/opdefs/uxtb_A88274.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,18 +23,29 @@ @title UXTB -@desc Unsigned Extend Byte extracts an 8-bit value from a register, zero-extends it to 32 bits, and writes the result to the destination register. The instruction can specify a rotation by 0, 8, 16, or 24 bits before extracting the 8-bit value. +@id 273 + +@desc { + + Unsigned Extend Byte extracts an 8-bit value from a register, zero-extends it to 32 bits, and writes the result to the destination register. The instruction can specify a rotation by 0, 8, 16, or 24 bits before extracting the 8-bit value. + +} @encoding (t1) { @half 1 0 1 1 0 0 1 0 1 1 Rm(3) Rd(3) - @syntax <reg_D> <reg_M> + @syntax { + + @conv { + + reg_D = Register(Rd) + reg_M = Register(Rm) + rotation = Rotation(0) - @conv { + } - reg_D = Register(Rd) - reg_M = Register(Rm) + @asm uxtb ?reg_D reg_M ?rotation } @@ -44,13 +55,17 @@ @word 1 1 1 1 1 0 1 0 0 1 0 1 1 1 1 1 1 1 1 1 Rd(4) 1 0 rotate(2) Rm(4) - @syntax ".W" <reg_D> <reg_M> <?rotation> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_M = Register(Rm) - rotation = Rotation(rotate:'000') + reg_D = Register(Rd) + reg_M = Register(Rm) + rotation = Rotation(rotate:'000') + + } + + @asm uxtb.w ?reg_D reg_M ?rotation } @@ -60,19 +75,23 @@ @word cond(4) 0 1 1 0 1 1 1 0 1 1 1 1 Rd(4) rotate(2) 0 0 0 1 1 1 Rm(4) - @syntax <reg_D> <reg_M> <?rotation> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_M = Register(Rm) - rotation = Rotation(rotate:'000') + reg_D = Register(Rd) + reg_M = Register(Rm) + rotation = Rotation(rotate:'000') - } + } + + @asm uxtb ?reg_D reg_M ?rotation + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/uxth_A88276.d b/plugins/arm/v7/opdefs/uxth_A88276.d index 5ae4f4f..b49360f 100644 --- a/plugins/arm/v7/opdefs/uxth_A88276.d +++ b/plugins/arm/v7/opdefs/uxth_A88276.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,18 +23,29 @@ @title UXTH -@desc Unsigned Extend Halfword extracts a 16-bit value from a register, zero-extends it to 32 bits, and writes the result to the destination register. The instruction can specify a rotation by 0, 8, 16, or 24 bits before extracting the 16-bit value. +@id 275 + +@desc { + + Unsigned Extend Halfword extracts a 16-bit value from a register, zero-extends it to 32 bits, and writes the result to the destination register. The instruction can specify a rotation by 0, 8, 16, or 24 bits before extracting the 16-bit value. + +} @encoding (t1) { @half 1 0 1 1 0 0 1 0 1 0 Rm(3) Rd(3) - @syntax <reg_D> <reg_M> + @syntax { + + @conv { + + reg_D = Register(Rd) + reg_M = Register(Rm) + rotation = Rotation(0) - @conv { + } - reg_D = Register(Rd) - reg_M = Register(Rm) + @asm uxth ?reg_D reg_M ?rotation } @@ -44,13 +55,17 @@ @word 1 1 1 1 1 0 1 0 0 0 0 1 1 1 1 1 1 1 1 1 Rd(4) 1 0 rotate(2) Rm(4) - @syntax ".W" <reg_D> <reg_M> <?rotation> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_M = Register(Rm) - rotation = Rotation(rotate:'000') + reg_D = Register(Rd) + reg_M = Register(Rm) + rotation = Rotation(rotate:'000') + + } + + @asm uxth.w ?reg_D reg_M ?rotation } @@ -60,19 +75,23 @@ @word cond(4) 0 1 1 0 1 1 1 1 1 1 1 1 Rd(4) rotate(2) 0 0 0 1 1 1 Rm(4) - @syntax <reg_D> <reg_M> <?rotation> + @syntax { - @conv { + @conv { - reg_D = Register(Rd) - reg_M = Register(Rm) - rotation = Rotation(rotate:'000') + reg_D = Register(Rd) + reg_M = Register(Rm) + rotation = Rotation(rotate:'000') - } + } + + @asm uxth ?reg_D reg_M ?rotation + + @rules { - @rules { + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/wfi_A88425.d b/plugins/arm/v7/opdefs/wfi_A88425.d index f11d033..0fd2552 100644 --- a/plugins/arm/v7/opdefs/wfi_A88425.d +++ b/plugins/arm/v7/opdefs/wfi_A88425.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,35 @@ @title WFI -@desc Wait For Interrupt is a hint instruction that permits the processor to enter a low-power state until one of a number of asynchronous events occurs. For more information, see Wait For Interrupt on page B1-1202. In an implementation that includes the Virtualization Extensions, if HCR.TWI is set to 1, execution of a WFI instruction in a Non-secure mode other than Hyp mode generates a Hyp Trap exception if, ignoring the value of the HCR.TWI bit, conditions permit the processor to suspend execution. For more information see Trapping use of the WFI and WFE instructions on page B1-1255. +@id 424 + +@desc { + + Wait For Interrupt is a hint instruction that permits the processor to enter a low-power state until one of a number of asynchronous events occurs. For more information, see Wait For Interrupt on page B1-1202. In an implementation that includes the Virtualization Extensions, if HCR.TWI is set to 1, execution of a WFI instruction in a Non-secure mode other than Hyp mode generates a Hyp Trap exception if, ignoring the value of the HCR.TWI bit, conditions permit the processor to suspend execution. For more information see Trapping use of the WFI and WFE instructions on page B1-1255. + +} @encoding (t1) { @half 1 0 1 1 1 1 1 1 0 0 1 1 0 0 0 0 + @syntax { + + @asm wfi + + } + } @encoding (T2) { @word 1 1 1 1 0 0 1 1 1 0 1 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 - @syntax ".W" + @syntax { + + @asm wfi.w + + } } @@ -43,9 +59,15 @@ @word cond(4) 0 0 1 1 0 0 1 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 - @rules { + @syntax { + + @asm wfi + + @rules { + + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/opdefs/yield_A88426.d b/plugins/arm/v7/opdefs/yield_A88426.d index 252c018..1ccee59 100644 --- a/plugins/arm/v7/opdefs/yield_A88426.d +++ b/plugins/arm/v7/opdefs/yield_A88426.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions ARMv7 * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2017 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,19 +23,35 @@ @title YIELD -@desc YIELD is a hint instruction. Software with a multithreading capability can use a YIELD instruction to indicate to the hardware that it is performing a task, for example a spin-lock, that could be swapped out to improve overall system performance. Hardware can use this hint to suspend and resume multiple software threads if it supports the capability. For more information about the recommended use of this instruction see The Yield instruction on page A4-178. +@id 425 + +@desc { + + YIELD is a hint instruction. Software with a multithreading capability can use a YIELD instruction to indicate to the hardware that it is performing a task, for example a spin-lock, that could be swapped out to improve overall system performance. Hardware can use this hint to suspend and resume multiple software threads if it supports the capability. For more information about the recommended use of this instruction see The Yield instruction on page A4-178. + +} @encoding (t1) { @half 1 0 1 1 1 1 1 1 0 0 0 1 0 0 0 0 + @syntax { + + @asm yield + + } + } @encoding (T2) { @word 1 1 1 1 0 0 1 1 1 0 1 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 - @syntax ".W" + @syntax { + + @asm yield.w + + } } @@ -43,9 +59,15 @@ @word cond(4) 0 0 1 1 0 0 1 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 1 - @rules { + @syntax { + + @asm yield + + @rules { + + check g_arm_instruction_set_cond(cond) - chk_call StoreCondition(cond) + } } diff --git a/plugins/arm/v7/operands/maccess.c b/plugins/arm/v7/operands/maccess.c index 043d801..24d5393 100644 --- a/plugins/arm/v7/operands/maccess.c +++ b/plugins/arm/v7/operands/maccess.c @@ -36,8 +36,8 @@ struct _GArmV7MAccessOperand GArchOperand *base; /* Base de l'accès en mémoire */ GArchOperand *offset; /* Décalage pour l'adresse */ - GArchOperand *shift; /* Décalage pour le décalage */ - bool not_post_indexed; /* Positio du décalage */ + GArchOperand *shift; /* Décalage pour le décallage */ + bool post_indexed; /* Position du décalage */ bool write_back; /* Mise à jour de la base */ }; @@ -194,7 +194,7 @@ static int g_armv7_maccess_operand_compare(const GArmV7MAccessOperand *a, const result = sort_pointer(a->shift, b->shift, (__compar_fn_t)g_arch_operand_compare); if (result != 0) goto gamoc_done; - result = sort_boolean(a->not_post_indexed, b->not_post_indexed); + result = sort_boolean(a->post_indexed, b->post_indexed); if (result != 0) goto gamoc_done; result = sort_boolean(a->write_back, b->write_back); @@ -226,7 +226,7 @@ static void g_armv7_maccess_operand_print(const GArmV7MAccessOperand *operand, G g_arch_operand_print(operand->base, line, syntax); - if (!operand->not_post_indexed) + if (operand->post_indexed) g_buffer_line_append_text(line, BLC_ASSEMBLY, "]", 1, RTT_HOOK, NULL); if (operand->offset != NULL) @@ -247,7 +247,7 @@ static void g_armv7_maccess_operand_print(const GArmV7MAccessOperand *operand, G } - if (operand->not_post_indexed) + if (!operand->post_indexed) g_buffer_line_append_text(line, BLC_ASSEMBLY, "]", 1, RTT_HOOK, NULL); if (operand->write_back) @@ -258,11 +258,19 @@ static void g_armv7_maccess_operand_print(const GArmV7MAccessOperand *operand, G /****************************************************************************** * * +<<<<<<< HEAD * Paramètres : base = représente le registre de la base d'accès. * * offset = détermine le décalage entre l'adresse et la base. * * shift = opération de décalage pour jouer sur le décalage. * * indexed = précise la forme donnée au décalage à appliquer. * * wback = indique une mise à jour de la base après usage. * +======= +* Paramètres : base = représente le registre de la base d'accès. * +* offset = détermine le décallage entre l'adresse et la base. * +* shift = opération de décallage pour jouer sur le décallage. * +* post = précise la forme donnée au décallage à appliquer. * +* wback = indique une mise à jour de la base après usage. * +>>>>>>> Rewritten the whole instruction definition format. * * * Description : Crée un accès à la mémoire depuis une base et un décalage. * * * @@ -272,7 +280,7 @@ static void g_armv7_maccess_operand_print(const GArmV7MAccessOperand *operand, G * * ******************************************************************************/ -GArchOperand *g_armv7_maccess_operand_new(GArchOperand *base, GArchOperand *offset, GArchOperand *shift, bool indexed, bool wback) +GArchOperand *g_armv7_maccess_operand_new(GArchOperand *base, GArchOperand *offset, GArchOperand *shift, bool post, bool wback) { GArmV7MAccessOperand *result; /* Structure à retourner */ @@ -282,7 +290,7 @@ GArchOperand *g_armv7_maccess_operand_new(GArchOperand *base, GArchOperand *offs result->offset = offset; result->shift = shift; - result->not_post_indexed = indexed; + result->post_indexed = post; result->write_back = wback; return G_ARCH_OPERAND(result); @@ -361,7 +369,7 @@ GArchOperand *g_armv7_maccess_operand_get_shift(const GArmV7MAccessOperand *oper bool g_armv7_maccess_operand_is_post_indexed(const GArmV7MAccessOperand *operand) { - return !operand->not_post_indexed; + return operand->post_indexed; } diff --git a/plugins/arm/v7/operands/reglist.c b/plugins/arm/v7/operands/reglist.c index 00c3b98..1f56249 100644 --- a/plugins/arm/v7/operands/reglist.c +++ b/plugins/arm/v7/operands/reglist.c @@ -255,7 +255,7 @@ static void g_armv7_reglist_operand_print(const GArmV7RegListOperand *operand, G /****************************************************************************** * * -* Paramètres : - * +* Paramètres : selected = masque de bits pour les registres à intégrer. * * * * Description : Crée une liste vierge de registres ARM. * * * @@ -265,48 +265,24 @@ static void g_armv7_reglist_operand_print(const GArmV7RegListOperand *operand, G * * ******************************************************************************/ -GArchOperand *g_armv7_reglist_operand_new(void) -{ - GArchOperand *result; /* Structure à retourner */ - - result = g_object_new(G_TYPE_ARMV7_REGLIST_OPERAND, NULL); - - return G_ARCH_OPERAND(result); - -} - - -/****************************************************************************** -* * -* Paramètres : operand = liste de registres à compléter. * -* selected = masque de bits pour les registres à intégrer. * -* * -* Description : Remplit une liste de registres de registres ARM. * -* * -* Retour : Bilan de l'opération. * -* * -* Remarques : - * -* * -******************************************************************************/ - -bool g_armv7_reglist_load_registers(GArmV7RegListOperand *operand, uint32_t selected) +GArchOperand *g_armv7_reglist_operand_new(uint16_t selected) { + GArmV7RegListOperand *result; /* Structure à retourner */ uint8_t i; /* Boucle de parcours */ GArmV7Register *reg; /* Nouveau registre à intégrer */ - for (i = 18; i < 32; i++) - if (selected & (1 << i)) return false; + result = g_object_new(G_TYPE_ARMV7_REGLIST_OPERAND, NULL); - for (i = 0; i < 18; i++) + for (i = 0; i < 16; i++) { if ((selected & (1 << i)) == 0) continue; reg = g_armv7_register_new(i); - g_armv7_reglist_add_register(operand, reg); + g_armv7_reglist_add_register(result, reg); } - return true; + return G_ARCH_OPERAND(result); } diff --git a/plugins/arm/v7/operands/reglist.h b/plugins/arm/v7/operands/reglist.h index 60b78a6..82f1a60 100644 --- a/plugins/arm/v7/operands/reglist.h +++ b/plugins/arm/v7/operands/reglist.h @@ -55,10 +55,7 @@ typedef struct _GArmV7RegListOperandClass GArmV7RegListOperandClass; GType g_armv7_reglist_operand_get_type(void); /* Crée une liste vierge de registres ARM. */ -GArchOperand *g_armv7_reglist_operand_new(void); - -/* Remplit une liste de registres de registres ARM. */ -bool g_armv7_reglist_load_registers(GArmV7RegListOperand *, uint32_t); +GArchOperand *g_armv7_reglist_operand_new(uint16_t); /* Ajoute un registre à une liste de registres ARM. */ void g_armv7_reglist_add_register(GArmV7RegListOperand *, GArmV7Register *); diff --git a/plugins/arm/v7/pseudo.c b/plugins/arm/v7/pseudo.c index e560f5d..12ad50b 100644 --- a/plugins/arm/v7/pseudo.c +++ b/plugins/arm/v7/pseudo.c @@ -483,7 +483,7 @@ bool armv7_thumb_expand_imm(uint32_t imm12, uint32_t *value) * * ******************************************************************************/ -bool armv7_decode_imm_shift(uint8_t type2, uint8_t imm5, SRType *type, uint32_t *value) +bool armv7_decode_imm_shift(uint8_t type2, uint8_t imm5, SRType *type, uint8_t *value) { bool result; /* Bilan à retourner */ @@ -681,3 +681,50 @@ uint32_t armv7_zero_extend(uint32_t x, unsigned int n, unsigned int i) return x; } + + +/****************************************************************************** +* * +* Paramètres : x = valeur sur 32 bits maximum à traiter. * +* t = bit de poids nombre de bits à prendre en compte. * +* i = taille finale à obtenir. * +* * +* Description : Fournit une aide pour la fonction 'SignExtend'. * +* * +* Retour : Nouvelle valeur calculée. * +* * +* Remarques : - * +* * +******************************************************************************/ + +uint32_t armv7_sign_extend(uint32_t x, unsigned int t, unsigned int i) +{ + uint32_t result; /* Valeur à retourner */ + bool set; /* Bit de poids fort à 1 ? */ + unsigned int k; /* Boucle de parcours */ + + result = 0; + + set = (x & (1 << t)); + + switch (i) + { + +#define SIGN_EXTEND_CASE(sz) \ + case sz: \ + result = x; \ + if (set) \ + for (k = t + 1; k < sz; k++) \ + result |= (1 << k); \ + break; + + SIGN_EXTEND_CASE(4); + SIGN_EXTEND_CASE(8); + SIGN_EXTEND_CASE(16); + SIGN_EXTEND_CASE(32); + + } + + return result; + +} diff --git a/plugins/arm/v7/pseudo.h b/plugins/arm/v7/pseudo.h index c918d57..d070bcd 100644 --- a/plugins/arm/v7/pseudo.h +++ b/plugins/arm/v7/pseudo.h @@ -110,7 +110,7 @@ typedef enum _SRType /* Traduit la fonction 'DecodeImmShift'. */ -bool armv7_decode_imm_shift(uint8_t, uint8_t, SRType *, uint32_t *); +bool armv7_decode_imm_shift(uint8_t, uint8_t, SRType *, uint8_t *); /* Traduit la fonction 'DecodeRegShift'. */ bool armv7_decode_reg_shift(uint8_t, SRType *); @@ -131,6 +131,9 @@ bool armv7_shift(uint32_t, unsigned int, SRType, unsigned int, bool, uint32_t *) /* Traduit la fonction 'ZeroExtend'. */ uint32_t armv7_zero_extend(uint32_t, unsigned int, unsigned int); +/* Fournit une aide pour la fonction 'SignExtend'. */ +uint32_t armv7_sign_extend(uint32_t, unsigned int, unsigned int); + #endif /* _PLUGINS_ARM_V7_PSEUDO_H */ diff --git a/plugins/dalvik/Makefile.am b/plugins/dalvik/Makefile.am index d12f733..2e042f2 100644 --- a/plugins/dalvik/Makefile.am +++ b/plugins/dalvik/Makefile.am @@ -12,13 +12,14 @@ libdalvik_la_SOURCES = \ link.h link.c \ operand.h operand.c \ post.h \ + processor-int.h \ processor.h processor.c \ register.h register.c libdalvik_la_LIBADD = \ - opcodes/libdalvikopcodes.la \ operands/libdalvikoperands.la \ - pseudo/libdalvikpseudo.la + pseudo/libdalvikpseudo.la \ + v35/libdalvik35.la libdalvik_la_CFLAGS = $(AM_CFLAGS) @@ -28,4 +29,4 @@ AM_CPPFLAGS = $(LIBGTK_CFLAGS) $(LIBPYTHON_CFLAGS) $(LIBPYGOBJECT_CFLAGS) $(LIBX AM_CFLAGS = $(DEBUG_CFLAGS) $(WARNING_FLAGS) $(COMPLIANCE_FLAGS) -SUBDIRS = opdefs opcodes operands pseudo +SUBDIRS = operands pseudo v35 diff --git a/plugins/dalvik/context.h b/plugins/dalvik/context.h index fbee9e0..76c2ea4 100644 --- a/plugins/dalvik/context.h +++ b/plugins/dalvik/context.h @@ -21,8 +21,8 @@ */ -#ifndef _ARCH_DALVIK_CONTEXT_H -#define _ARCH_DALVIK_CONTEXT_H +#ifndef _PLUGINS_DALVIK_CONTEXT_H +#define _PLUGINS_DALVIK_CONTEXT_H #include <glib-object.h> @@ -99,4 +99,4 @@ GDalvikDContext *g_dalvik_dcontext_new(void); -#endif /* _ARCH_DALVIK_CONTEXT_H */ +#endif /* _PLUGINS_DALVIK_CONTEXT_H */ diff --git a/plugins/dalvik/core.c b/plugins/dalvik/core.c index 7f0c79f..57d382c 100644 --- a/plugins/dalvik/core.c +++ b/plugins/dalvik/core.c @@ -28,8 +28,8 @@ #include <plugins/plugin-def.h> -#include "processor.h" #include "register.h" +#include "v35/processor.h" @@ -54,7 +54,7 @@ G_MODULE_EXPORT bool chrysalide_plugin_init(GPluginModule *plugin) { bool result; /* Bilan à retourner */ - result = register_processor_type("dalvik", "Dalvik Virtual Machine", G_TYPE_DALVIK_PROCESSOR, + result = register_processor_type("dalvik35", "Dalvik Virtual Machine v35", G_TYPE_DALVIK35_PROCESSOR, NULL, NULL); return result; diff --git a/plugins/dalvik/fetch.h b/plugins/dalvik/fetch.h index e9ea340..4a9a788 100644 --- a/plugins/dalvik/fetch.h +++ b/plugins/dalvik/fetch.h @@ -21,8 +21,8 @@ */ -#ifndef _ARCH_DALVIK_FETCH_H -#define _ARCH_DALVIK_FETCH_H +#ifndef _PLUGINS_DALVIK_FETCH_H +#define _PLUGINS_DALVIK_FETCH_H #include <arch/instruction.h> @@ -53,4 +53,4 @@ static inline void help_fetching_with_dalvik_ifz_instruction(GArchInstruction *i -#endif /* _ARCH_DALVIK_FETCH_H */ +#endif /* _PLUGINS_DALVIK_FETCH_H */ diff --git a/plugins/dalvik/helpers.h b/plugins/dalvik/helpers.h index 6a0ba5c..5b23f0e 100644 --- a/plugins/dalvik/helpers.h +++ b/plugins/dalvik/helpers.h @@ -21,8 +21,8 @@ */ -#ifndef _ARCH_DALVIK_HELPERS_H -#define _ARCH_DALVIK_HELPERS_H +#ifndef _PLUGINS_DALVIK_HELPERS_H +#define _PLUGINS_DALVIK_HELPERS_H #include "operand.h" @@ -40,4 +40,4 @@ -#endif /* _ARCH_DALVIK_HELPERS_H */ +#endif /* _PLUGINS_DALVIK_HELPERS_H */ diff --git a/plugins/dalvik/instruction-def.h b/plugins/dalvik/instruction-def.h deleted file mode 100644 index af6e308..0000000 --- a/plugins/dalvik/instruction-def.h +++ /dev/null @@ -1,305 +0,0 @@ - -/* Chrysalide - Outil d'analyse de fichiers binaires - * instruction-def.h - définition interne des identifiants d'instructions Dalvik - * - * Copyright (C) 2011-2017 Cyrille Bagard - * - * This file is part of Chrysalide. - * - * Chrysalide is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * Chrysalide is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Foobar. If not, see <http://www.gnu.org/licenses/>. - */ - - -#ifndef _ARCH_DALVIK_INSTRUCTION_DEF_H -#define _ARCH_DALVIK_INSTRUCTION_DEF_H - - - -/* Enumération de tous les opcodes */ -typedef enum _DalvikOpcodes -{ - DOP_NOP, /* nop (0x00) */ - DOP_MOVE, /* move (0x01) */ - DOP_MOVE_FROM_16, /* move/from16 (0x02) */ - DOP_MOVE_16, /* move/16 (0x03) */ - DOP_MOVE_WIDE, /* move-wide (0x04) */ - DOP_MOVE_WIDE_FROM_16, /* move-wide/from16 (0x05) */ - DOP_MOVE_WIDE_16, /* move-wide/16 (0x06) */ - DOP_MOVE_OBJECT, /* move-object (0x07) */ - DOP_MOVE_OBJECT_FROM_16, /* move-object/from16 (0x08) */ - DOP_MOVE_OBJECT_16, /* move-object/16 (0x09) */ - DOP_MOVE_RESULT, /* move-result (0x0a) */ - DOP_MOVE_RESULT_WIDE, /* move-result-wide (0x0b) */ - DOP_MOVE_RESULT_OBJECT, /* move-result-object (0x0c) */ - DOP_MOVE_EXCEPTION, /* move-exception (0x0d) */ - DOP_RETURN_VOID, /* return-void (0x0e) */ - DOP_RETURN, /* return (0x0f) */ - DOP_RETURN_WIDE, /* return-wide (0x10) */ - DOP_RETURN_OBJECT, /* return-object (0x11) */ - DOP_CONST_4, /* const/4 (0x12) */ - DOP_CONST_16, /* const/16 (0x13) */ - DOP_CONST, /* const (0x14) */ - DOP_CONST_HIGH16, /* const/high16 (0x15) */ - DOP_CONST_WIDE_16, /* const-wide/16 (0x16) */ - DOP_CONST_WIDE_32, /* const-wide/32 (0x17) */ - DOP_CONST_WIDE, /* const-wide (0x18) */ - DOP_CONST_WIDE_HIGH16, /* const-wide/high16 (0x19) */ - DOP_CONST_STRING, /* const-string (0x1a) */ - DOP_CONST_STRING_JUMBO, /* const-string/jumbo (0x1b) */ - DOP_CONST_CLASS, /* const-class (0x1c) */ - DOP_MONITOR_ENTER, /* monitor-enter (0x1d) */ - DOP_MONITOR_EXIT, /* monitor-exit (0x1e) */ - DOP_CHECK_CAST, /* check-cast (0x1f) */ - DOP_INSTANCE_OF, /* instance-of (0x20) */ - DOP_ARRAY_LENGTH, /* array-length (0x21) */ - DOP_NEW_INSTANCE, /* new-instance (0x22) */ - DOP_NEW_ARRAY, /* new-array (0x23) */ - DOP_FILLED_NEW_ARRAY, /* filled-new-array (0x24) */ - DOP_FILLED_NEW_ARRAY_RANGE, /* filled-new-array/range(0x25)*/ - DOP_FILL_ARRAY_DATA, /* fill-array-data (0x26) */ - DOP_THROW, /* throw (0x27) */ - DOP_GOTO, /* goto (0x28) */ - DOP_GOTO_16, /* goto/16 (0x29) */ - DOP_GOTO_32, /* goto/32 (0x2a) */ - DOP_PACKED_SWITCH, /* packed-switch (0x2b) */ - DOP_SPARSE_SWITCH, /* sparse-switch (0x2c) */ - DOP_CMPL_FLOAT, /* cmp-long (0x2d) */ - DOP_CMPG_FLOAT, /* cmpg-float (0x2e) */ - DOP_CMPL_DOUBLE, /* cmpl-double (0x2f) */ - DOP_CMPG_DOUBLE, /* cmpg-double (0x30) */ - DOP_CMP_LONG, /* cmp-long (0x31) */ - DOP_IF_EQ, /* if-eq (0x32) */ - DOP_IF_NE, /* if-ne (0x33) */ - DOP_IF_LT, /* if-lt (0x34) */ - DOP_IF_GE, /* if-ge (0x35) */ - DOP_IF_GT, /* if-gt (0x36) */ - DOP_IF_LE, /* if-le (0x37) */ - DOP_IF_EQZ, /* if-eqz (0x38) */ - DOP_IF_NEZ, /* if-nez (0x39) */ - DOP_IF_LTZ, /* if-ltz (0x3a) */ - DOP_IF_GEZ, /* if-gez (0x3b) */ - DOP_IF_GTZ, /* if-gtz (0x3c) */ - DOP_IF_LEZ, /* if-lez (0x3d) */ - DOP_UNUSED_3E, /* -unused- (0x3e) */ - DOP_UNUSED_3F, /* -unused- (0x3f) */ - DOP_UNUSED_40, /* -unused- (0x40) */ - DOP_UNUSED_41, /* -unused- (0x41) */ - DOP_UNUSED_42, /* -unused- (0x42) */ - DOP_UNUSED_43, /* -unused- (0x43) */ - DOP_AGET, /* aget (0x44) */ - DOP_AGET_WIDE, /* aget-wide (0x45) */ - DOP_AGET_OBJECT, /* aget-object (0x46) */ - DOP_AGET_BOOLEAN, /* aget-boolean (0x47) */ - DOP_AGET_BYTE, /* aget-byte (0x48) */ - DOP_AGET_CHAR, /* aget-char (0x49) */ - DOP_AGET_SHORT, /* aget-short (0x4a) */ - DOP_APUT, /* aput (0x4b) */ - DOP_APUT_WIDE, /* aput-wide (0x4c) */ - DOP_APUT_OBJECT, /* aput-object (0x4d) */ - DOP_APUT_BOOLEAN, /* aput-boolean (0x4e) */ - DOP_APUT_BYTE, /* aput-byte (0x4f) */ - DOP_APUT_CHAR, /* aput-char (0x50) */ - DOP_APUT_SHORT, /* aput-short (0x51) */ - DOP_IGET, /* iget (0x52) */ - DOP_IGET_WIDE, /* iget-wide (0x53) */ - DOP_IGET_OBJECT, /* iget-object (0x54) */ - DOP_IGET_BOOLEAN, /* iget-boolean (0x55) */ - DOP_IGET_BYTE, /* iget-byte (0x56) */ - DOP_IGET_CHAR, /* iget-char (0x57) */ - DOP_IGET_SHORT, /* iget-short (0x58) */ - DOP_IPUT, /* iput (0x59) */ - DOP_IPUT_WIDE, /* iput-wide (0x5a) */ - DOP_IPUT_OBJECT, /* iput-object (0x5b) */ - DOP_IPUT_BOOLEAN, /* iput-boolean (0x5c) */ - DOP_IPUT_BYTE, /* iput-byte (0x5d) */ - DOP_IPUT_CHAR, /* iput-char (0x5e) */ - DOP_IPUT_SHORT, /* iput-short (0x5f) */ - DOP_SGET, /* sget (0x60) */ - DOP_SGET_WIDE, /* sget-wide (0x61) */ - DOP_SGET_OBJECT, /* sget-object (0x62) */ - DOP_SGET_BOOLEAN, /* sget-boolean (0x63) */ - DOP_SGET_BYTE, /* sget-byte (0x64) */ - DOP_SGET_CHAR, /* sget-char (0x65) */ - DOP_SGET_SHORT, /* sget-short (0x66) */ - DOP_SPUT, /* sput (0x67) */ - DOP_SPUT_WIDE, /* sput-wide (0x68) */ - DOP_SPUT_OBJECT, /* sput-object (0x69) */ - DOP_SPUT_BOOLEAN, /* sput-boolean (0x6a) */ - DOP_SPUT_BYTE, /* sput-byte (0x6b) */ - DOP_SPUT_CHAR, /* sput-char (0x6c) */ - DOP_SPUT_SHORT, /* sput-short (0x6d) */ - DOP_INVOKE_VIRTUAL, /* invoke-virtual (0x6e) */ - DOP_INVOKE_SUPER, /* invoke-super (0x6f) */ - DOP_INVOKE_DIRECT, /* invoke-direct (0x70) */ - DOP_INVOKE_STATIC, /* invoke-static (0x71) */ - DOP_INVOKE_INTERFACE, /* invoke-interface (0x72) */ - DOP_UNUSED_73, /* -unused- (0x73) */ - DOP_INVOKE_VIRTUAL_RANGE, /* invoke-virtual/range (0x74) */ - DOP_INVOKE_SUPER_RANGE, /* invoke-super/range (0x75) */ - DOP_INVOKE_DIRECT_RANGE, /* invoke-direct/range (0x76) */ - DOP_INVOKE_STATIC_RANGE, /* invoke-static/range (0x77) */ - DOP_INVOKE_INTERFACE_RANGE, /* invoke-interface/rg. (0x78) */ - DOP_UNUSED_79, /* -unused- (0x79) */ - DOP_UNUSED_7A, /* -unused- (0x7a) */ - DOP_NEG_INT, /* neg-int (0x7b) */ - DOP_NOT_INT, /* not-int (0x7c) */ - DOP_NEG_LONG, /* neg-long (0x7d) */ - DOP_NOT_LONG, /* not-long (0x7e) */ - DOP_NEG_FLOAT, /* neg-float (0x7f) */ - DOP_NEG_DOUBLE, /* neg-double (0x80) */ - DOP_TO_INT_LONG, /* int-to-long (0x81) */ - DOP_TO_INT_FLOAT, /* int-to-float (0x82) */ - DOP_TO_INT_DOUBLE, /* int-to-double (0x83) */ - DOP_TO_LONG_INT, /* long-to-int (0x84) */ - DOP_TO_LONG_FLOAT, /* long-to-float (0x85) */ - DOP_TO_LONG_DOUBLE, /* long-to-double (0x86) */ - DOP_TO_FLOAT_INT, /* float-to-int (0x87) */ - DOP_TO_FLOAT_LONG, /* float-to-long (0x88) */ - DOP_TO_FLOAT_DOUBLE, /* float-to-double (0x89) */ - DOP_TO_DOUBLE_INT, /* double-to-int (0x8a) */ - DOP_TO_DOUBLE_LONG, /* double-to-long (0x8b) */ - DOP_TO_DOUBLE_FLOAT, /* double-to-float (0x8c) */ - DOP_TO_INT_BYTE, /* int-to-byte (0x8d) */ - DOP_TO_INT_CHAR, /* int-to-char (0x8e) */ - DOP_TO_INT_SHORT, /* int-to-short (0x8f) */ - DOP_ADD_INT, /* add-int (0x90) */ - DOP_SUB_INT, /* sub-int (0x91) */ - DOP_MUL_INT, /* mul-int (0x92) */ - DOP_DIV_INT, /* div-int (0x93) */ - DOP_REM_INT, /* rem-int (0x94) */ - DOP_AND_INT, /* and-int (0x95) */ - DOP_OR_INT, /* or-int (0x96) */ - DOP_XOR_INT, /* xor-int (0x97) */ - DOP_SHL_INT, /* shl-int (0x98) */ - DOP_SHR_INT, /* shr-int (0x99) */ - DOP_USHR_INT, /* ushr-int (0x9a) */ - DOP_ADD_LONG, /* add-long (0x9b) */ - DOP_SUB_LONG, /* sub-long (0x9c) */ - DOP_MUL_LONG, /* mul-long (0x9d) */ - DOP_DIV_LONG, /* div-long (0x9e) */ - DOP_REM_LONG, /* rem-long (0x9f) */ - DOP_AND_LONG, /* and-long (0xa0) */ - DOP_OR_LONG, /* or-long (0xa1) */ - DOP_XOR_LONG, /* xor-long (0xa2) */ - DOP_SHL_LONG, /* shl-long (0xa3) */ - DOP_SHR_LONG, /* shr-long (0xa4) */ - DOP_USHR_LONG, /* ushr-long (0xa5) */ - DOP_ADD_FLOAT, /* add-float (0xa6) */ - DOP_SUB_FLOAT, /* sub-float (0xa7) */ - DOP_MUL_FLOAT, /* mul-float (0xa8) */ - DOP_DIV_FLOAT, /* mul-float (0xa9) */ - DOP_REM_FLOAT, /* mul-float (0xaa) */ - DOP_ADD_DOUBLE, /* add-double (0xab) */ - DOP_SUB_DOUBLE, /* sub-double (0xac) */ - DOP_MUL_DOUBLE, /* mul-double (0xad) */ - DOP_DIV_DOUBLE, /* div-double (0xae) */ - DOP_REM_DOUBLE, /* rem-double (0xaf) */ - DOP_ADD_INT_2ADDR, /* add-int/2addr (0xb0) */ - DOP_SUB_INT_2ADDR, /* add-int/2addr (0xb1) */ - DOP_MUL_INT_2ADDR, /* mul-int/2addr (0xb2) */ - DOP_DIV_INT_2ADDR, /* div-int/2addr (0xb3) */ - DOP_REM_INT_2ADDR, /* rem-int/2addr (0xb4) */ - DOP_AND_INT_2ADDR, /* and-int/2addr (0xb5) */ - DOP_OR_INT_2ADDR, /* or-int/2addr (0xb6) */ - DOP_XOR_INT_2ADDR, /* xor-int/2addr (0xb7) */ - DOP_SHL_INT_2ADDR, /* shl-int/2addr (0xb8) */ - DOP_SHR_INT_2ADDR, /* shr-int/2addr (0xb9) */ - DOP_USHR_INT_2ADDR, /* ushr-int/2addr (0xba) */ - DOP_ADD_LONG_2ADDR, /* add-long/2addr (0xbb) */ - DOP_SUB_LONG_2ADDR, /* sub-long/2addr (0xbc) */ - DOP_MUL_LONG_2ADDR, /* mul-long/2addr (0xbd) */ - DOP_DIV_LONG_2ADDR, /* div-long/2addr (0xbe) */ - DOP_REM_LONG_2ADDR, /* rem-long/2addr (0xbf) */ - DOP_AND_LONG_2ADDR, /* and-long/2addr (0xc0) */ - DOP_OR_LONG_2ADDR, /* or-long/2addr (0xc1) */ - DOP_XOR_LONG_2ADDR, /* xor-long/2addr (0xc2) */ - DOP_SHL_LONG_2ADDR, /* shl-long/2addr (0xc3) */ - DOP_SHR_LONG_2ADDR, /* shr-long/2addr (0xc4) */ - DOP_USHR_LONG_2ADDR, /* ushr-long/2addr (0xc5) */ - DOP_ADD_FLOAT_2ADDR, /* add-float/2addr (0xc6) */ - DOP_SUB_FLOAT_2ADDR, /* sub-float/2addr (0xc7) */ - DOP_MUL_FLOAT_2ADDR, /* mul-float/2addr (0xc8) */ - DOP_DIV_FLOAT_2ADDR, /* div-float/2addr (0xc9) */ - DOP_REM_FLOAT_2ADDR, /* rem-float/2addr (0xca) */ - DOP_ADD_DOUBLE_2ADDR, /* add-double/2addr (0xcb) */ - DOP_SUB_DOUBLE_2ADDR, /* sub-double/2addr (0xcc) */ - DOP_MUL_DOUBLE_2ADDR, /* mul-double/2addr (0xcd) */ - DOP_DIV_DOUBLE_2ADDR, /* div-double/2addr (0xce) */ - DOP_REM_DOUBLE_2ADDR, /* rem-double/2addr (0xcf) */ - DOP_ADD_INT_LIT16, /* add-int/lit16 (0xd0) */ - DOP_RSUB_INT, /* rsub-int (0xd1) */ - DOP_MUL_INT_LIT16, /* mul-int/lit16 (0xd2) */ - DOP_DIV_INT_LIT16, /* div-int/lit16 (0xd3) */ - DOP_REM_INT_LIT16, /* rem-int/lit16 (0xd4) */ - DOP_AND_INT_LIT16, /* and-int/lit16 (0xd5) */ - DOP_OR_INT_LIT16, /* or-int/lit16 (0xd6) */ - DOP_XOR_INT_LIT16, /* xor-int/lit16 (0xd7) */ - DOP_ADD_INT_LIT8, /* add-int/lit8 (0xd8) */ - DOP_RSUB_INT_LIT8, /* rsub-int/lit8 (0xd9) */ - DOP_MUL_INT_LIT8, /* mul-int/lit8 (0xda) */ - DOP_DIV_INT_LIT8, /* div-int/lit8 (0xdb) */ - DOP_REM_INT_LIT8, /* rem-int/lit8 (0xdc) */ - DOP_AND_INT_LIT8, /* and-int/lit8 (0xdd) */ - DOP_OR_INT_LIT8, /* or-int/lit8 (0xde) */ - DOP_XOR_INT_LIT8, /* xor-int/lit8 (0xdf) */ - DOP_SHL_INT_LIT8, /* shl-int/lit8 (0xe0) */ - DOP_SHR_INT_LIT8, /* shr-int/lit8 (0xe1) */ - DOP_USHR_INT_LIT8, /* ushr-int/lit8 (0xe2) */ - DOP_UNUSED_E3, /* -unused- (0xe3) */ - DOP_UNUSED_E4, /* -unused- (0xe4) */ - DOP_UNUSED_E5, /* -unused- (0xe5) */ - DOP_UNUSED_E6, /* -unused- (0xe6) */ - DOP_UNUSED_E7, /* -unused- (0xe7) */ - DOP_UNUSED_E8, /* -unused- (0xe8) */ - DOP_UNUSED_E9, /* -unused- (0xe9) */ - DOP_UNUSED_EA, /* -unused- (0xea) */ - DOP_UNUSED_EB, /* -unused- (0xeb) */ - DOP_UNUSED_EC, /* -unused- (0xec) */ - DOP_UNUSED_ED, /* -unused- (0xed) */ - DOP_UNUSED_EE, /* -unused- (0xee) */ - DOP_UNUSED_EF, /* -unused- (0xef) */ - DOP_UNUSED_F0, /* -unused- (0xf0) */ - DOP_UNUSED_F1, /* -unused- (0xf1) */ - DOP_UNUSED_F2, /* -unused- (0xf2) */ - DOP_UNUSED_F3, /* -unused- (0xf3) */ - DOP_UNUSED_F4, /* -unused- (0xf4) */ - DOP_UNUSED_F5, /* -unused- (0xf5) */ - DOP_UNUSED_F6, /* -unused- (0xf6) */ - DOP_UNUSED_F7, /* -unused- (0xf7) */ - DOP_UNUSED_F8, /* -unused- (0xf8) */ - DOP_UNUSED_F9, /* -unused- (0xf9) */ - DOP_UNUSED_FA, /* -unused- (0xfa) */ - DOP_UNUSED_FB, /* -unused- (0xfb) */ - DOP_UNUSED_FC, /* -unused- (0xfc) */ - DOP_UNUSED_FD, /* -unused- (0xfd) */ - DOP_UNUSED_FE, /* -unused- (0xfe) */ - DOP_UNUSED_FF, /* -unused- (0xff) */ - - DOP_COUNT - -} DalvikOpcodes; - - -/* Enumération de tous les pseudo-opcodes */ -typedef enum _DalvikPseudoOpcodes -{ - DPO_PACKED_SWITCH = 0x0100, /* Switch aux clefs compactes */ - DPO_SPARSE_SWITCH = 0x0200, /* Switch aux clefs éclatées */ - DPO_FILL_ARRAY_DATA = 0x0300 /* Contenu de tableau */ - -} DalvikPseudoOpcodes; - - - -#endif /* _ARCH_DALVIK_INSTRUCTION_DEF_H */ diff --git a/plugins/dalvik/instruction-int.h b/plugins/dalvik/instruction-int.h index b4e59b0..847b112 100644 --- a/plugins/dalvik/instruction-int.h +++ b/plugins/dalvik/instruction-int.h @@ -21,14 +21,14 @@ */ -#ifndef _ARCH_DALVIK_INSTRUCTION_INT_H -#define _ARCH_DALVIK_INSTRUCTION_INT_H +#ifndef _PLUGINS_DALVIK_INSTRUCTION_INT_H +#define _PLUGINS_DALVIK_INSTRUCTION_INT_H -#include <arch/instruction-int.h> +#include "instruction.h" -#include "instruction-def.h" +#include <arch/instruction-int.h> @@ -37,11 +37,6 @@ struct _GDalvikInstruction { GArchInstruction parent; /* A laisser en premier */ - const char *keyword; /* Nom clef de l'instruction */ - - DalvikOpcodes type; /* Position dans la liste */ - DalvikPseudoOpcodes ptype; /* Position dans la liste #2 */ - }; /* Définition générique d'une instruction d'architecture Dalvik (classe) */ @@ -53,4 +48,4 @@ struct _GDalvikInstructionClass -#endif /* _ARCH_DALVIK_INSTRUCTION_INT_H */ +#endif /* _PLUGINS_DALVIK_INSTRUCTION_INT_H */ diff --git a/plugins/dalvik/instruction.c b/plugins/dalvik/instruction.c index 7105dc9..bd41cf9 100644 --- a/plugins/dalvik/instruction.c +++ b/plugins/dalvik/instruction.c @@ -32,7 +32,6 @@ #include "instruction-int.h" -#include "operands/register.h" @@ -48,12 +47,6 @@ static void g_dalvik_instruction_dispose(GDalvikInstruction *); /* Procède à la libération totale de la mémoire. */ static void g_dalvik_instruction_finalize(GDalvikInstruction *); -/* Indique l'encodage d'une instruction de façon détaillée. */ -static const char *g_dalvik_instruction_get_encoding(const GDalvikInstruction *); - -/* Fournit le nom humain de l'instruction manipulée. */ -static const char *g_dalvik_instruction_get_keyword(const GDalvikInstruction *, AsmSyntax); - /* Construit un petit résumé concis de l'instruction. */ static char *g_dalvik_instruction_build_tooltip(const GDalvikInstruction *); @@ -63,7 +56,6 @@ static char *g_dalvik_instruction_build_tooltip(const GDalvikInstruction *); G_DEFINE_TYPE(GDalvikInstruction, g_dalvik_instruction, G_TYPE_ARCH_INSTRUCTION); - /****************************************************************************** * * * Paramètres : klass = classe à initialiser. * @@ -88,8 +80,6 @@ static void g_dalvik_instruction_class_init(GDalvikInstructionClass *klass) instr = G_ARCH_INSTRUCTION_CLASS(klass); - instr->get_encoding = (get_instruction_encoding_fc)g_dalvik_instruction_get_encoding; - instr->get_keyword = (get_instruction_keyword_fc)g_dalvik_instruction_get_keyword; instr->build_tooltip = (build_instruction_tooltip_fc)g_dalvik_instruction_build_tooltip; } @@ -153,74 +143,6 @@ static void g_dalvik_instruction_finalize(GDalvikInstruction *instr) /****************************************************************************** * * -* Paramètres : keyword = définition du nom humaine de l'instruction. * -* * -* Description : Crée une instruction pour l'architecture Dalvik. * -* * -* Retour : Adresse de la structure mise en place. * -* * -* Remarques : - * -* * -******************************************************************************/ - -GArchInstruction *g_dalvik_instruction_new(const char *keyword) -{ - GArchInstruction *result; /* Structure à retourner */ - - result = g_object_new(G_TYPE_DALVIK_INSTRUCTION, NULL); - - G_DALVIK_INSTRUCTION(result)->keyword = keyword; - - return result; - -} - - -/****************************************************************************** -* * -* Paramètres : instr = instruction quelconque à consulter. * -* * -* Description : Indique l'encodage d'une instruction de façon détaillée. * -* * -* Retour : Description humaine de l'encodage utilisé. * -* * -* Remarques : - * -* * -******************************************************************************/ - -static const char *g_dalvik_instruction_get_encoding(const GDalvikInstruction *instr) -{ - const char *result; /* Description à retourner */ - - result = "Dalvik"; - - return result; - -} - - -/****************************************************************************** -* * -* Paramètres : instr = instruction d'assemblage à consulter. * -* syntax = type de représentation demandée. * -* * -* Description : Fournit le nom humain de l'instruction manipulée. * -* * -* Retour : Mot clef de bas niveau. * -* * -* Remarques : - * -* * -******************************************************************************/ - -static const char *g_dalvik_instruction_get_keyword(const GDalvikInstruction *instr, AsmSyntax syntax) -{ - return instr->keyword; - -} - - -/****************************************************************************** -* * * Paramètres : instr = instruction Dalvik à consulter. * * * * Description : Construit un petit résumé concis de l'instruction. * @@ -240,22 +162,3 @@ static char *g_dalvik_instruction_build_tooltip(const GDalvikInstruction *instr) return result; } - - -/****************************************************************************** -* * -* Paramètres : instr = instruction Dalvik à consulter. * -* * -* Description : Indique l'opcode associé à une instruction Dalvik. * -* * -* Retour : Identifiant de l'instruction en place. * -* * -* Remarques : - * -* * -******************************************************************************/ - -DalvikOpcodes g_dalvik_instruction_get_opcode(const GDalvikInstruction *instr) -{ - return instr->type; - -} diff --git a/plugins/dalvik/instruction.h b/plugins/dalvik/instruction.h index 8f05cc5..e11a249 100644 --- a/plugins/dalvik/instruction.h +++ b/plugins/dalvik/instruction.h @@ -21,16 +21,13 @@ */ -#ifndef _ARCH_DALVIK_INSTRUCTION_H -#define _ARCH_DALVIK_INSTRUCTION_H +#ifndef _PLUGINS_DALVIK_INSTRUCTION_H +#define _PLUGINS_DALVIK_INSTRUCTION_H #include <arch/instruction.h> -#include "instruction-def.h" - - #define G_TYPE_DALVIK_INSTRUCTION g_dalvik_instruction_get_type() #define G_DALVIK_INSTRUCTION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_dalvik_instruction_get_type(), GDalvikInstruction)) @@ -48,21 +45,6 @@ typedef struct _GDalvikInstructionClass GDalvikInstructionClass; /* Indique le type défini pour une instruction d'architecture Dalvik. */ GType g_dalvik_instruction_get_type(void); -/* Crée une instruction pour l'architecture Dalvik. */ -GArchInstruction *g_dalvik_instruction_new(const char *); - -/* Indique l'opcode associé à une instruction Dalvik. */ -DalvikOpcodes g_dalvik_instruction_get_opcode(const struct _GDalvikInstruction *); - - - -/* --------------------- AIDE A LA MISE EN PLACE D'INSTRUCTIONS --------------------- */ - - - - -/* ------------------------ AIDE A LA PHASE DE DECOMPILATION ------------------------ */ - -#endif /* _ARCH_DALVIK_INSTRUCTION_H */ +#endif /* _PLUGINS_DALVIK_INSTRUCTION_H */ diff --git a/plugins/dalvik/link.h b/plugins/dalvik/link.h index 41d03ec..36584b2 100644 --- a/plugins/dalvik/link.h +++ b/plugins/dalvik/link.h @@ -21,8 +21,8 @@ */ -#ifndef _ARCH_DALVIK_LINK_H -#define _ARCH_DALVIK_LINK_H +#ifndef _PLUGINS_DALVIK_LINK_H +#define _PLUGINS_DALVIK_LINK_H #include <arch/link.h> @@ -45,4 +45,4 @@ void handle_dalvik_packed_switch_links(GArchInstruction *, GArchProcessor *, GPr -#endif /* _ARCH_DALVIK_LINK_H */ +#endif /* _PLUGINS_DALVIK_LINK_H */ diff --git a/plugins/dalvik/opdefs/invoke_6e.d b/plugins/dalvik/opdefs/invoke_6e.d deleted file mode 100644 index e7b3f0d..0000000 --- a/plugins/dalvik/opdefs/invoke_6e.d +++ /dev/null @@ -1,30 +0,0 @@ - -/* Chrysalide - Outil d'analyse de fichiers binaires - * ##FILE## - traduction d'instructions Dalvik - * - * Copyright (C) 2015 Cyrille Bagard - * - * This file is part of Chrysalide. - * - * Chrysalide is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * Chrysalide is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Foobar. If not, see <http://www.gnu.org/licenses/>. - */ - - -@title invoke-virtual - -@encoding() { - - @format 35c | pool_meth - -} diff --git a/plugins/dalvik/opdefs/invoke_6f.d b/plugins/dalvik/opdefs/invoke_6f.d deleted file mode 100644 index 9fa4666..0000000 --- a/plugins/dalvik/opdefs/invoke_6f.d +++ /dev/null @@ -1,30 +0,0 @@ - -/* Chrysalide - Outil d'analyse de fichiers binaires - * ##FILE## - traduction d'instructions Dalvik - * - * Copyright (C) 2015 Cyrille Bagard - * - * This file is part of Chrysalide. - * - * Chrysalide is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * Chrysalide is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Foobar. If not, see <http://www.gnu.org/licenses/>. - */ - - -@title invoke-super - -@encoding() { - - @format 35c | pool_meth - -} diff --git a/plugins/dalvik/opdefs/invoke_70.d b/plugins/dalvik/opdefs/invoke_70.d deleted file mode 100644 index 6662ce3..0000000 --- a/plugins/dalvik/opdefs/invoke_70.d +++ /dev/null @@ -1,30 +0,0 @@ - -/* Chrysalide - Outil d'analyse de fichiers binaires - * ##FILE## - traduction d'instructions Dalvik - * - * Copyright (C) 2015 Cyrille Bagard - * - * This file is part of Chrysalide. - * - * Chrysalide is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * Chrysalide is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Foobar. If not, see <http://www.gnu.org/licenses/>. - */ - - -@title invoke-direct - -@encoding() { - - @format 35c | pool_meth - -} diff --git a/plugins/dalvik/opdefs/invoke_71.d b/plugins/dalvik/opdefs/invoke_71.d deleted file mode 100644 index f179dbd..0000000 --- a/plugins/dalvik/opdefs/invoke_71.d +++ /dev/null @@ -1,30 +0,0 @@ - -/* Chrysalide - Outil d'analyse de fichiers binaires - * ##FILE## - traduction d'instructions Dalvik - * - * Copyright (C) 2015 Cyrille Bagard - * - * This file is part of Chrysalide. - * - * Chrysalide is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * Chrysalide is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Foobar. If not, see <http://www.gnu.org/licenses/>. - */ - - -@title invoke-static - -@encoding() { - - @format 35c | pool_meth - -} diff --git a/plugins/dalvik/opdefs/invoke_72.d b/plugins/dalvik/opdefs/invoke_72.d deleted file mode 100644 index 6ad8e09..0000000 --- a/plugins/dalvik/opdefs/invoke_72.d +++ /dev/null @@ -1,30 +0,0 @@ - -/* Chrysalide - Outil d'analyse de fichiers binaires - * ##FILE## - traduction d'instructions Dalvik - * - * Copyright (C) 2015 Cyrille Bagard - * - * This file is part of Chrysalide. - * - * Chrysalide is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * Chrysalide is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Foobar. If not, see <http://www.gnu.org/licenses/>. - */ - - -@title invoke-interface - -@encoding() { - - @format 35c | pool_meth - -} diff --git a/plugins/dalvik/opdefs/nop_00.d b/plugins/dalvik/opdefs/nop_00.d deleted file mode 100644 index d10d439..0000000 --- a/plugins/dalvik/opdefs/nop_00.d +++ /dev/null @@ -1,30 +0,0 @@ - -/* Chrysalide - Outil d'analyse de fichiers binaires - * ##FILE## - traduction d'instructions Dalvik - * - * Copyright (C) 2015 Cyrille Bagard - * - * This file is part of Chrysalide. - * - * Chrysalide is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * Chrysalide is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Foobar. If not, see <http://www.gnu.org/licenses/>. - */ - - -@title nop - -@encoding() { - - @format 10x - -} diff --git a/plugins/dalvik/operand.h b/plugins/dalvik/operand.h index b34c87c..f5ef9ed 100644 --- a/plugins/dalvik/operand.h +++ b/plugins/dalvik/operand.h @@ -21,8 +21,8 @@ */ -#ifndef _ARCH_DALVIK_OPERAND_H -#define _ARCH_DALVIK_OPERAND_H +#ifndef _PLUGINS_DALVIK_OPERAND_H +#define _PLUGINS_DALVIK_OPERAND_H #include <arch/instruction.h> @@ -122,4 +122,4 @@ void dalvik_mark_first_operand_as_written(GArchInstruction *); -#endif /* _ARCH_DALVIK_OPERAND_H */ +#endif /* _PLUGINS_DALVIK_OPERAND_H */ diff --git a/plugins/dalvik/operands/args.h b/plugins/dalvik/operands/args.h index 354333d..9c4ba84 100644 --- a/plugins/dalvik/operands/args.h +++ b/plugins/dalvik/operands/args.h @@ -21,8 +21,8 @@ */ -#ifndef _ARCH_DALVIK_OPERANDS_ARGS_H -#define _ARCH_DALVIK_OPERANDS_ARGS_H +#ifndef _PLUGINS_DALVIK_OPERANDS_ARGS_H +#define _PLUGINS_DALVIK_OPERANDS_ARGS_H #include <glib-object.h> @@ -64,4 +64,4 @@ GArchOperand *g_dalvik_args_operand_get(const GDalvikArgsOperand *, size_t); -#endif /* _ARCH_DALVIK_OPERANDS_ARGS_H */ +#endif /* _PLUGINS_DALVIK_OPERANDS_ARGS_H */ diff --git a/plugins/dalvik/operands/pool.h b/plugins/dalvik/operands/pool.h index 3045a2c..d4e9722 100644 --- a/plugins/dalvik/operands/pool.h +++ b/plugins/dalvik/operands/pool.h @@ -21,8 +21,8 @@ */ -#ifndef _ARCH_DALVIK_OPERANDS_POOL_H -#define _ARCH_DALVIK_OPERANDS_POOL_H +#ifndef _PLUGINS_DALVIK_OPERANDS_POOL_H +#define _PLUGINS_DALVIK_OPERANDS_POOL_H #include <glib-object.h> @@ -77,4 +77,4 @@ uint32_t g_dalvik_pool_operand_get_index(const GDalvikPoolOperand *); -#endif /* _ARCH_DALVIK_OPERANDS_POOL_H */ +#endif /* _PLUGINS_DALVIK_OPERANDS_POOL_H */ diff --git a/plugins/dalvik/operands/register.h b/plugins/dalvik/operands/register.h index f1dec72..58be978 100644 --- a/plugins/dalvik/operands/register.h +++ b/plugins/dalvik/operands/register.h @@ -21,8 +21,8 @@ */ -#ifndef _ARCH_DALVIK_OPERANDS_REGISTER_H -#define _ARCH_DALVIK_OPERANDS_REGISTER_H +#ifndef _PLUGINS_DALVIK_OPERANDS_REGISTER_H +#define _PLUGINS_DALVIK_OPERANDS_REGISTER_H #include <glib-object.h> @@ -72,4 +72,4 @@ bool g_dalvik_register_operand_is_written(const GDalvikRegisterOperand *); -#endif /* _ARCH_DALVIK_OPERANDS_REGISTER_H */ +#endif /* _PLUGINS_DALVIK_OPERANDS_REGISTER_H */ diff --git a/plugins/dalvik/post.h b/plugins/dalvik/post.h index 63d35c3..7c867fd 100644 --- a/plugins/dalvik/post.h +++ b/plugins/dalvik/post.h @@ -21,8 +21,8 @@ */ -#ifndef _ARCH_DALVIK_POST_H -#define _ARCH_DALVIK_POST_H +#ifndef _PLUGINS_DALVIK_POST_H +#define _PLUGINS_DALVIK_POST_H #include <arch/post.h> @@ -49,4 +49,4 @@ static inline void post_process_dalvik_ifz_target_resolution(GArchInstruction *i -#endif /* _ARCH_DALVIK_POST_H */ +#endif /* _PLUGINS_DALVIK_POST_H */ diff --git a/plugins/dalvik/processor-int.h b/plugins/dalvik/processor-int.h new file mode 100644 index 0000000..6d551fa --- /dev/null +++ b/plugins/dalvik/processor-int.h @@ -0,0 +1,59 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * processor-int.h - prototypes pour la définition générique interne du processeur de la VM Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +#ifndef _PLUGINS_DALVIK_PROCESSOR_INT_H +#define _PLUGINS_DALVIK_PROCESSOR_INT_H + + +#include "processor.h" + + +#include <arch/processor-int.h> + + +#include "context.h" + + + +/* Définition du processeur de la VM Dalvik (instance) */ +struct _GDalvikProcessor +{ + GArchProcessor parent; /* Instance parente */ + +}; + + +/* Définition du processeur de la VM Dalvik (classe) */ +struct _GDalvikProcessorClass +{ + GArchProcessorClass parent; /* Classe parente */ + +}; + + +/* Décode une pseudo-instruction dans un flux de données. */ +GArchInstruction *g_dalvik_processor_disassemble_pseudo(const GArchProcessor *, GDalvikContext *, const GBinContent *, vmpa2t *, uint8_t); + + + +#endif /* _PLUGINS_DALVIK_PROCESSOR_INT_H */ diff --git a/plugins/dalvik/processor.c b/plugins/dalvik/processor.c index ff8b805..c3bce8f 100644 --- a/plugins/dalvik/processor.c +++ b/plugins/dalvik/processor.c @@ -27,34 +27,17 @@ #include <assert.h> -#include <arch/processor-int.h> #include <plugins/dex/format.h> -#include "context.h" #include "instruction.h" -#include "opcodes/opcodes.h" +#include "processor-int.h" #include "pseudo/fill.h" +#include "pseudo/identifiers.h" #include "pseudo/switch.h" -/* Définition du processeur de la VM Dalvik (instance) */ -struct _GDalvikProcessor -{ - GArchProcessor parent; /* Instance parente */ - -}; - - -/* Définition du processeur de la VM Dalvik (classe) */ -struct _GDalvikProcessorClass -{ - GArchProcessorClass parent; /* Classe parente */ - -}; - - /* Initialise la classe des processeurs de VM Dalvik. */ static void g_dalvik_processor_class_init(GDalvikProcessorClass *); @@ -73,19 +56,12 @@ static GDalvikContext *g_dalvik_processor_get_context(const GDalvikProcessor *); /* Fournit un contexte pour la décompilation Dalvik. */ //static GDalvikDContext *g_dalvik_processor_get_decomp_context(const GDalvikProcessor *); -/* Décode une instruction dans un flux de données. */ -static GArchInstruction *g_dalvik_processor_disassemble(const GArchProcessor *, GDalvikContext *, const GBinContent *, vmpa2t *, GExeFormat *); - -/* Décode une pseudo-instruction dans un flux de données. */ -static GArchInstruction *g_dalvik_processor_disassemble_pseudo(const GArchProcessor *, GDalvikContext *, const GBinContent *, vmpa2t *, uint8_t); - /* Indique le type défini par la GLib pour le processeur DALVIK. */ G_DEFINE_TYPE(GDalvikProcessor, g_dalvik_processor, G_TYPE_ARCH_PROCESSOR); - /****************************************************************************** * * * Paramètres : klass = classe à initialiser. * @@ -113,8 +89,6 @@ static void g_dalvik_processor_class_init(GDalvikProcessorClass *klass) proc->get_ctx = (get_processor_context_fc)g_dalvik_processor_get_context; //proc->get_dec_ctx = (get_decomp_context_fc)g_dalvik_processor_get_decomp_context; - proc->disassemble = (disass_instr_fc)g_dalvik_processor_disassemble; - } @@ -183,29 +157,6 @@ static void g_dalvik_processor_finalize(GDalvikProcessor *proc) /****************************************************************************** * * -* Paramètres : - * -* * -* Description : Crée le support de l'architecture Dalvik. * -* * -* Retour : Architecture mise en place. * -* * -* Remarques : - * -* * -******************************************************************************/ - -GArchProcessor *g_dalvik_processor_new(void) -{ - GArchProcessor *result; /* Structure à retourner */ - - result = g_object_new(G_TYPE_DALVIK_PROCESSOR, NULL); - - return result; - -} - - -/****************************************************************************** -* * * Paramètres : proc = architecture, spectatrice ici. * * * * Description : Fournit un contexte pour l'exécution du processeur Dalvik. * @@ -245,282 +196,6 @@ static GDalvikDContext *g_dalvik_processor_get_decomp_context(const GDalvikProce /****************************************************************************** * * -* Paramètres : proc = architecture visée par la procédure. * -* ctx = contexte lié à l'exécution du processeur. * -* content = flux de données à analyser. * -* pos = position courante dans ce flux. [OUT] * -* format = format du fichier contenant le code. * -* * -* Description : Désassemble une instruction dans un flux de données. * -* * -* Retour : Instruction mise en place ou NULL en cas d'échec. * -* * -* Remarques : - * -* * -******************************************************************************/ - -static GArchInstruction *g_dalvik_processor_disassemble(const GArchProcessor *proc, GDalvikContext *ctx, const GBinContent *content, vmpa2t *pos, GExeFormat *format) -{ - GArchInstruction *result; /* Instruction à renvoyer */ - uint8_t raw8; /* Donnée de 8 bits à analyser */ - DalvikOpcodes id; /* Identifiant d'instruction */ - - static const disass_instr_fc decodings[DOP_COUNT] = { - - [DOP_NOP] = dalvik_read_instr_nop, - [DOP_MOVE] = dalvik_read_instr_move, - [DOP_MOVE_FROM_16] = dalvik_read_instr_move_from16, - [DOP_MOVE_16] = dalvik_read_instr_move_16, - [DOP_MOVE_WIDE] = dalvik_read_instr_move_wide, - [DOP_MOVE_WIDE_FROM_16] = dalvik_read_instr_move_wide_from16, - [DOP_MOVE_WIDE_16] = dalvik_read_instr_move_wide_16, - [DOP_MOVE_OBJECT] = dalvik_read_instr_move_object, - [DOP_MOVE_OBJECT_FROM_16] = dalvik_read_instr_move_object_from16, - [DOP_MOVE_OBJECT_16] = dalvik_read_instr_move_object_16, - [DOP_MOVE_RESULT] = dalvik_read_instr_move_result, - [DOP_MOVE_RESULT_WIDE] = dalvik_read_instr_move_result_wide, - [DOP_MOVE_RESULT_OBJECT] = dalvik_read_instr_move_result_object, - [DOP_MOVE_EXCEPTION] = dalvik_read_instr_move_exception, - [DOP_RETURN_VOID] = dalvik_read_instr_return_void, - [DOP_RETURN] = dalvik_read_instr_return, - [DOP_RETURN_WIDE] = dalvik_read_instr_return_wide, - [DOP_RETURN_OBJECT] = dalvik_read_instr_return_object, - [DOP_CONST_4] = dalvik_read_instr_const_4, - [DOP_CONST_16] = dalvik_read_instr_const_16, - [DOP_CONST] = dalvik_read_instr_const, - [DOP_CONST_HIGH16] = dalvik_read_instr_const_high16, - [DOP_CONST_WIDE_16] = dalvik_read_instr_const_wide_16, - [DOP_CONST_WIDE_32] = dalvik_read_instr_const_wide_32, - [DOP_CONST_WIDE] = dalvik_read_instr_const_wide, - [DOP_CONST_WIDE_HIGH16] = dalvik_read_instr_const_wide_high16, - [DOP_CONST_STRING] = dalvik_read_instr_const_string, - [DOP_CONST_STRING_JUMBO] = dalvik_read_instr_const_string_jumbo, - [DOP_CONST_CLASS] = dalvik_read_instr_const_class, - [DOP_MONITOR_ENTER] = dalvik_read_instr_monitor_enter, - [DOP_MONITOR_EXIT] = dalvik_read_instr_monitor_exit, - [DOP_CHECK_CAST] = dalvik_read_instr_check_cast, - [DOP_INSTANCE_OF] = dalvik_read_instr_instance_of, - [DOP_ARRAY_LENGTH] = dalvik_read_instr_array_length, - [DOP_NEW_INSTANCE] = dalvik_read_instr_new_instance, - [DOP_NEW_ARRAY] = dalvik_read_instr_new_array, - [DOP_FILLED_NEW_ARRAY] = dalvik_read_instr_filled_new_array, - [DOP_FILLED_NEW_ARRAY_RANGE]= dalvik_read_instr_filled_new_array_range, - [DOP_FILL_ARRAY_DATA] = dalvik_read_instr_fill_array_data, - [DOP_THROW] = dalvik_read_instr_throw, - [DOP_GOTO] = dalvik_read_instr_goto, - [DOP_GOTO_16] = dalvik_read_instr_goto_16, - [DOP_GOTO_32] = dalvik_read_instr_goto_32, - [DOP_PACKED_SWITCH] = dalvik_read_instr_packed_switch, - [DOP_SPARSE_SWITCH] = dalvik_read_instr_sparse_switch, - [DOP_CMPL_FLOAT] = dalvik_read_instr_cmpl_float, - [DOP_CMPG_FLOAT] = dalvik_read_instr_cmpg_float, - [DOP_CMPL_DOUBLE] = dalvik_read_instr_cmpl_double, - [DOP_CMPG_DOUBLE] = dalvik_read_instr_cmpg_double, - [DOP_CMP_LONG] = dalvik_read_instr_cmp_long, - [DOP_IF_EQ] = dalvik_read_instr_if_eq, - [DOP_IF_NE] = dalvik_read_instr_if_ne, - [DOP_IF_LT] = dalvik_read_instr_if_lt, - [DOP_IF_GE] = dalvik_read_instr_if_ge, - [DOP_IF_GT] = dalvik_read_instr_if_gt, - [DOP_IF_LE] = dalvik_read_instr_if_le, - [DOP_IF_EQZ] = dalvik_read_instr_if_eqz, - [DOP_IF_NEZ] = dalvik_read_instr_if_nez, - [DOP_IF_LTZ] = dalvik_read_instr_if_ltz, - [DOP_IF_GEZ] = dalvik_read_instr_if_gez, - [DOP_IF_GTZ] = dalvik_read_instr_if_gtz, - [DOP_IF_LEZ] = dalvik_read_instr_if_lez, - [DOP_AGET] = dalvik_read_instr_aget, - [DOP_AGET_WIDE] = dalvik_read_instr_aget_wide, - [DOP_AGET_OBJECT] = dalvik_read_instr_aget_object, - [DOP_AGET_BOOLEAN] = dalvik_read_instr_aget_boolean, - [DOP_AGET_BYTE] = dalvik_read_instr_aget_byte, - [DOP_AGET_CHAR] = dalvik_read_instr_aget_char, - [DOP_AGET_SHORT] = dalvik_read_instr_aget_short, - [DOP_APUT] = dalvik_read_instr_aput, - [DOP_APUT_WIDE] = dalvik_read_instr_aput_wide, - [DOP_APUT_OBJECT] = dalvik_read_instr_aput_object, - [DOP_APUT_BOOLEAN] = dalvik_read_instr_aput_boolean, - [DOP_APUT_BYTE] = dalvik_read_instr_aput_byte, - [DOP_APUT_CHAR] = dalvik_read_instr_aput_char, - [DOP_APUT_SHORT] = dalvik_read_instr_aput_short, - [DOP_IGET] = dalvik_read_instr_iget, - [DOP_IGET_WIDE] = dalvik_read_instr_iget_wide, - [DOP_IGET_OBJECT] = dalvik_read_instr_iget_object, - [DOP_IGET_BOOLEAN] = dalvik_read_instr_iget_boolean, - [DOP_IGET_BYTE] = dalvik_read_instr_iget_byte, - [DOP_IGET_CHAR] = dalvik_read_instr_iget_char, - [DOP_IGET_SHORT] = dalvik_read_instr_iget_short, - [DOP_IPUT] = dalvik_read_instr_iput, - [DOP_IPUT_WIDE] = dalvik_read_instr_iput_wide, - [DOP_IPUT_OBJECT] = dalvik_read_instr_iput_object, - [DOP_IPUT_BOOLEAN] = dalvik_read_instr_iput_boolean, - [DOP_IPUT_BYTE] = dalvik_read_instr_iput_byte, - [DOP_IPUT_CHAR] = dalvik_read_instr_iput_char, - [DOP_IPUT_SHORT] = dalvik_read_instr_iput_short, - [DOP_SGET] = dalvik_read_instr_sget, - [DOP_SGET_WIDE] = dalvik_read_instr_sget_wide, - [DOP_SGET_OBJECT] = dalvik_read_instr_sget_object, - [DOP_SGET_BOOLEAN] = dalvik_read_instr_sget_boolean, - [DOP_SGET_BYTE] = dalvik_read_instr_sget_byte, - [DOP_SGET_CHAR] = dalvik_read_instr_sget_char, - [DOP_SGET_SHORT] = dalvik_read_instr_sget_short, - [DOP_SPUT] = dalvik_read_instr_sput, - [DOP_SPUT_WIDE] = dalvik_read_instr_sput_wide, - [DOP_SPUT_OBJECT] = dalvik_read_instr_sput_object, - [DOP_SPUT_BOOLEAN] = dalvik_read_instr_sput_boolean, - [DOP_SPUT_BYTE] = dalvik_read_instr_sput_byte, - [DOP_SPUT_CHAR] = dalvik_read_instr_sput_char, - [DOP_SPUT_SHORT] = dalvik_read_instr_sput_short, - [DOP_INVOKE_VIRTUAL] = dalvik_read_instr_invoke_virtual, - [DOP_INVOKE_SUPER] = dalvik_read_instr_invoke_super, - [DOP_INVOKE_DIRECT] = dalvik_read_instr_invoke_direct, - [DOP_INVOKE_STATIC] = dalvik_read_instr_invoke_static, - [DOP_INVOKE_INTERFACE] = dalvik_read_instr_invoke_interface, - [DOP_INVOKE_VIRTUAL_RANGE] = dalvik_read_instr_invoke_virtual_range, - [DOP_INVOKE_SUPER_RANGE] = dalvik_read_instr_invoke_super_range, - [DOP_INVOKE_DIRECT_RANGE] = dalvik_read_instr_invoke_direct_range, - [DOP_INVOKE_STATIC_RANGE] = dalvik_read_instr_invoke_static_range, - [DOP_INVOKE_INTERFACE_RANGE]= dalvik_read_instr_invoke_interface_range, - [DOP_NEG_INT] = dalvik_read_instr_neg_int, - [DOP_NOT_INT] = dalvik_read_instr_not_int, - [DOP_NEG_LONG] = dalvik_read_instr_neg_long, - [DOP_NOT_LONG] = dalvik_read_instr_not_long, - [DOP_NEG_FLOAT] = dalvik_read_instr_neg_float, - [DOP_NEG_DOUBLE] = dalvik_read_instr_neg_double, - [DOP_TO_INT_LONG] = dalvik_read_instr_int_to_long, - [DOP_TO_INT_FLOAT] = dalvik_read_instr_int_to_float, - [DOP_TO_INT_DOUBLE] = dalvik_read_instr_int_to_double, - [DOP_TO_LONG_INT] = dalvik_read_instr_long_to_int, - [DOP_TO_LONG_FLOAT] = dalvik_read_instr_long_to_float, - [DOP_TO_LONG_DOUBLE] = dalvik_read_instr_long_to_double, - [DOP_TO_FLOAT_INT] = dalvik_read_instr_float_to_int, - [DOP_TO_FLOAT_LONG] = dalvik_read_instr_float_to_long, - [DOP_TO_FLOAT_DOUBLE] = dalvik_read_instr_float_to_double, - [DOP_TO_DOUBLE_INT] = dalvik_read_instr_double_to_int, - [DOP_TO_DOUBLE_LONG] = dalvik_read_instr_double_to_long, - [DOP_TO_DOUBLE_FLOAT] = dalvik_read_instr_double_to_float, - [DOP_TO_INT_BYTE] = dalvik_read_instr_int_to_byte, - [DOP_TO_INT_CHAR] = dalvik_read_instr_int_to_char, - [DOP_TO_INT_SHORT] = dalvik_read_instr_int_to_short, - [DOP_ADD_INT] = dalvik_read_instr_add_int, - [DOP_SUB_INT] = dalvik_read_instr_sub_int, - [DOP_MUL_INT] = dalvik_read_instr_mul_int, - [DOP_DIV_INT] = dalvik_read_instr_div_int, - [DOP_REM_INT] = dalvik_read_instr_rem_int, - [DOP_AND_INT] = dalvik_read_instr_and_int, - [DOP_OR_INT] = dalvik_read_instr_or_int, - [DOP_XOR_INT] = dalvik_read_instr_xor_int, - [DOP_SHL_INT] = dalvik_read_instr_shl_int, - [DOP_SHR_INT] = dalvik_read_instr_shr_int, - [DOP_USHR_INT] = dalvik_read_instr_ushr_int, - [DOP_ADD_LONG] = dalvik_read_instr_add_long, - [DOP_SUB_LONG] = dalvik_read_instr_sub_long, - [DOP_MUL_LONG] = dalvik_read_instr_mul_long, - [DOP_DIV_LONG] = dalvik_read_instr_div_long, - [DOP_REM_LONG] = dalvik_read_instr_rem_long, - [DOP_AND_LONG] = dalvik_read_instr_and_long, - [DOP_OR_LONG] = dalvik_read_instr_or_long, - [DOP_XOR_LONG] = dalvik_read_instr_xor_long, - [DOP_SHL_LONG] = dalvik_read_instr_shl_long, - [DOP_SHR_LONG] = dalvik_read_instr_shr_long, - [DOP_USHR_LONG] = dalvik_read_instr_ushr_long, - [DOP_ADD_FLOAT] = dalvik_read_instr_add_float, - [DOP_SUB_FLOAT] = dalvik_read_instr_sub_float, - [DOP_MUL_FLOAT] = dalvik_read_instr_mul_float, - [DOP_DIV_FLOAT] = dalvik_read_instr_div_float, - [DOP_REM_FLOAT] = dalvik_read_instr_rem_float, - [DOP_ADD_DOUBLE] = dalvik_read_instr_add_double, - [DOP_SUB_DOUBLE] = dalvik_read_instr_sub_double, - [DOP_MUL_DOUBLE] = dalvik_read_instr_mul_double, - [DOP_DIV_DOUBLE] = dalvik_read_instr_div_double, - [DOP_REM_DOUBLE] = dalvik_read_instr_rem_double, - [DOP_ADD_INT_2ADDR] = dalvik_read_instr_add_int_2addr, - [DOP_SUB_INT_2ADDR] = dalvik_read_instr_sub_int_2addr, - [DOP_MUL_INT_2ADDR] = dalvik_read_instr_mul_int_2addr, - [DOP_DIV_INT_2ADDR] = dalvik_read_instr_div_int_2addr, - [DOP_REM_INT_2ADDR] = dalvik_read_instr_rem_int_2addr, - [DOP_AND_INT_2ADDR] = dalvik_read_instr_and_int_2addr, - [DOP_OR_INT_2ADDR] = dalvik_read_instr_or_int_2addr, - [DOP_XOR_INT_2ADDR] = dalvik_read_instr_xor_int_2addr, - [DOP_SHL_INT_2ADDR] = dalvik_read_instr_shl_int_2addr, - [DOP_SHR_INT_2ADDR] = dalvik_read_instr_shr_int_2addr, - [DOP_USHR_INT_2ADDR] = dalvik_read_instr_ushr_int_2addr, - [DOP_ADD_LONG_2ADDR] = dalvik_read_instr_add_long_2addr, - [DOP_SUB_LONG_2ADDR] = dalvik_read_instr_sub_long_2addr, - [DOP_MUL_LONG_2ADDR] = dalvik_read_instr_mul_long_2addr, - [DOP_DIV_LONG_2ADDR] = dalvik_read_instr_div_long_2addr, - [DOP_REM_LONG_2ADDR] = dalvik_read_instr_rem_long_2addr, - [DOP_AND_LONG_2ADDR] = dalvik_read_instr_and_long_2addr, - [DOP_OR_LONG_2ADDR] = dalvik_read_instr_or_long_2addr, - [DOP_XOR_LONG_2ADDR] = dalvik_read_instr_xor_long_2addr, - [DOP_SHL_LONG_2ADDR] = dalvik_read_instr_shl_long_2addr, - [DOP_SHR_LONG_2ADDR] = dalvik_read_instr_shr_long_2addr, - [DOP_USHR_LONG_2ADDR] = dalvik_read_instr_ushr_long_2addr, - [DOP_ADD_FLOAT_2ADDR] = dalvik_read_instr_add_float_2addr, - [DOP_SUB_FLOAT_2ADDR] = dalvik_read_instr_sub_float_2addr, - [DOP_MUL_FLOAT_2ADDR] = dalvik_read_instr_mul_float_2addr, - [DOP_DIV_FLOAT_2ADDR] = dalvik_read_instr_div_float_2addr, - [DOP_REM_FLOAT_2ADDR] = dalvik_read_instr_rem_float_2addr, - [DOP_ADD_DOUBLE_2ADDR] = dalvik_read_instr_add_double_2addr, - [DOP_SUB_DOUBLE_2ADDR] = dalvik_read_instr_sub_double_2addr, - [DOP_MUL_DOUBLE_2ADDR] = dalvik_read_instr_mul_double_2addr, - [DOP_DIV_DOUBLE_2ADDR] = dalvik_read_instr_div_double_2addr, - [DOP_REM_DOUBLE_2ADDR] = dalvik_read_instr_rem_double_2addr, - [DOP_ADD_INT_LIT16] = dalvik_read_instr_add_int_lit16, - [DOP_RSUB_INT] = dalvik_read_instr_rsub_int, - [DOP_MUL_INT_LIT16] = dalvik_read_instr_mul_int_lit16, - [DOP_DIV_INT_LIT16] = dalvik_read_instr_div_int_lit16, - [DOP_REM_INT_LIT16] = dalvik_read_instr_rem_int_lit16, - [DOP_AND_INT_LIT16] = dalvik_read_instr_and_int_lit16, - [DOP_OR_INT_LIT16] = dalvik_read_instr_or_int_lit16, - [DOP_XOR_INT_LIT16] = dalvik_read_instr_xor_int_lit16, - [DOP_ADD_INT_LIT8] = dalvik_read_instr_add_int_lit8, - [DOP_RSUB_INT_LIT8] = dalvik_read_instr_rsub_int_lit8, - [DOP_MUL_INT_LIT8] = dalvik_read_instr_mul_int_lit8, - [DOP_DIV_INT_LIT8] = dalvik_read_instr_div_int_lit8, - [DOP_REM_INT_LIT8] = dalvik_read_instr_rem_int_lit8, - [DOP_AND_INT_LIT8] = dalvik_read_instr_and_int_lit8, - [DOP_OR_INT_LIT8] = dalvik_read_instr_or_int_lit8, - [DOP_XOR_INT_LIT8] = dalvik_read_instr_xor_int_lit8, - [DOP_SHL_INT_LIT8] = dalvik_read_instr_shl_int_lit8, - [DOP_SHR_INT_LIT8] = dalvik_read_instr_shr_int_lit8, - [DOP_USHR_INT_LIT8] = dalvik_read_instr_ushr_int_lit8 - - }; - - /* Données brutes associées à une instruction ? */ - - result = g_dalvik_context_get_raw_data(ctx, content, pos); - - if (result != NULL) goto gdpd_done; - - /* Pseudo-instruction... */ - - if (!g_binary_content_read_u8(content, pos, &raw8)) - return NULL; - - result = g_dalvik_processor_disassemble_pseudo(proc, ctx, content, pos, raw8); - - if (result != NULL) goto gdpd_done; - - /* ... ou instruction classique */ - - assert(raw8 < DOP_COUNT); - - id = (DalvikOpcodes)raw8; - - if (decodings[id] != NULL) - result = decodings[id](proc, G_PROC_CONTEXT(ctx), content, pos, format); - - gdpd_done: - - return result; - -} - - -/****************************************************************************** -* * * Paramètres : proc = architecture visée par la procédure. * * data = flux de données à analyser. * * pos = position courante dans ce flux. [OUT] * @@ -536,7 +211,7 @@ static GArchInstruction *g_dalvik_processor_disassemble(const GArchProcessor *pr * * ******************************************************************************/ -static GArchInstruction *g_dalvik_processor_disassemble_pseudo(const GArchProcessor *proc, GDalvikContext *ctx, const GBinContent *content, vmpa2t *pos, uint8_t low8) +GArchInstruction *g_dalvik_processor_disassemble_pseudo(const GArchProcessor *proc, GDalvikContext *ctx, const GBinContent *content, vmpa2t *pos, uint8_t low8) { GArchInstruction *result; /* Instruction à renvoyer */ vmpa2t tmp; /* Position modifiable */ diff --git a/plugins/dalvik/processor.h b/plugins/dalvik/processor.h index c6c1278..ffddb2a 100644 --- a/plugins/dalvik/processor.h +++ b/plugins/dalvik/processor.h @@ -21,8 +21,8 @@ */ -#ifndef _ARCH_DALVIK_PROCESSOR_H -#define _ARCH_DALVIK_PROCESSOR_H +#ifndef _PLUGINS_DALVIK_PROCESSOR_H +#define _PLUGINS_DALVIK_PROCESSOR_H #include <arch/processor.h> @@ -45,9 +45,6 @@ typedef struct _GDalvikProcessorClass GDalvikProcessorClass; /* Indique le type défini par la GLib pour le processeur Dalvik. */ GType g_dalvik_processor_get_type(void); -/* Crée le support de l'architecture Dalvik. */ -GArchProcessor *g_dalvik_processor_new(void); - -#endif /* _ARCH_DALVIK_PROCESSOR_H */ +#endif /* _PLUGINS_DALVIK_PROCESSOR_H */ diff --git a/plugins/dalvik/pseudo/fill.c b/plugins/dalvik/pseudo/fill.c index dc5683c..5c86a80 100644 --- a/plugins/dalvik/pseudo/fill.c +++ b/plugins/dalvik/pseudo/fill.c @@ -28,6 +28,7 @@ #include <string.h> +#include "identifiers.h" #include "../instruction-int.h" @@ -63,6 +64,9 @@ static void g_dalvik_fill_instr_dispose(GDalvikFillInstr *); /* Procède à la libération totale de la mémoire. */ static void g_dalvik_fill_instr_finalize(GDalvikFillInstr *); +/* Fournit le nom humain de l'instruction manipulée. */ +static const char *g_dalvik_fill_instruction_get_keyword(const GDalvikFillInstr *, AsmSyntax); + /* Indique le type défini pour une pseudo-instruction Dalvik de remplissage. */ @@ -84,12 +88,17 @@ G_DEFINE_TYPE(GDalvikFillInstr, g_dalvik_fill_instr, G_TYPE_DALVIK_INSTRUCTION); static void g_dalvik_fill_instr_class_init(GDalvikFillInstrClass *klass) { GObjectClass *object; /* Autre version de la classe */ + GArchInstructionClass *instr; /* Encore une autre vision... */ object = G_OBJECT_CLASS(klass); object->dispose = (GObjectFinalizeFunc/* ! */)g_dalvik_fill_instr_dispose; object->finalize = (GObjectFinalizeFunc)g_dalvik_fill_instr_finalize; + instr = G_ARCH_INSTRUCTION_CLASS(klass); + + instr->get_keyword = (get_instruction_keyword_fc)g_dalvik_fill_instruction_get_keyword; + } @@ -107,7 +116,6 @@ static void g_dalvik_fill_instr_class_init(GDalvikFillInstrClass *klass) static void g_dalvik_fill_instr_init(GDalvikFillInstr *instr) { - G_DALVIK_INSTRUCTION(instr)->keyword = "array-data"; } @@ -174,7 +182,7 @@ GArchInstruction *g_dalvik_fill_instr_new(uint16_t ident, GDalvikContext *ctx, c result = g_object_new(G_TYPE_DALVIK_FILL_INSTR, NULL); - G_DALVIK_INSTRUCTION(result)->ptype = ident; + G_ARCH_INSTRUCTION(result)->uid = DPO_FILL_ARRAY_DATA; if (!g_binary_content_read_u16(content, pos, SRE_LITTLE, &result->item_width)) goto gdfin_bad; @@ -196,3 +204,27 @@ GArchInstruction *g_dalvik_fill_instr_new(uint16_t ident, GDalvikContext *ctx, c return NULL; } + + +/****************************************************************************** +* * +* Paramètres : instr = instruction d'assemblage à consulter. * +* syntax = type de représentation demandée. * +* * +* Description : Fournit le nom humain de l'instruction manipulée. * +* * +* Retour : Mot clef de bas niveau. * +* * +* Remarques : - * +* * +******************************************************************************/ + +static const char *g_dalvik_fill_instruction_get_keyword(const GDalvikFillInstr *instr, AsmSyntax syntax) +{ + const char *result; /* Désignation à retourner */ + + result = "array-data"; + + return result; + +} diff --git a/plugins/dalvik/pseudo/fill.h b/plugins/dalvik/pseudo/fill.h index 2a63df9..a022ed2 100644 --- a/plugins/dalvik/pseudo/fill.h +++ b/plugins/dalvik/pseudo/fill.h @@ -21,8 +21,8 @@ */ -#ifndef _ARCH_DALVIK_PSEUDO_FILL_H -#define _ARCH_DALVIK_PSEUDO_FILL_H +#ifndef _PLUGINS_DALVIK_PSEUDO_FILL_H +#define _PLUGINS_DALVIK_PSEUDO_FILL_H #include "../context.h" @@ -57,4 +57,4 @@ GArchInstruction *g_dalvik_fill_instr_new(uint16_t, GDalvikContext *, const GBin -#endif /* _ARCH_DALVIK_PSEUDO_FILL_H */ +#endif /* _PLUGINS_DALVIK_PSEUDO_FILL_H */ diff --git a/plugins/dalvik/pseudo/identifiers.h b/plugins/dalvik/pseudo/identifiers.h new file mode 100644 index 0000000..e1ab8fc --- /dev/null +++ b/plugins/dalvik/pseudo/identifiers.h @@ -0,0 +1,39 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * identifiers.h - définition d'identifiants uniques pour Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Chrysalide. If not, see <http://www.gnu.org/licenses/>. + */ + + +#ifndef _PLUGINS_DALVIK_PSEUDO_IDENTIFIERS_H +#define _PLUGINS_DALVIK_PSEUDO_IDENTIFIERS_H + + +/* Enumération de tous les pseudo-opcodes */ +typedef enum _DalvikPseudoOpcodes +{ + DPO_PACKED_SWITCH = 0x0100, /* Switch aux clefs compactes */ + DPO_SPARSE_SWITCH = 0x0200, /* Switch aux clefs éclatées */ + DPO_FILL_ARRAY_DATA = 0x0300 /* Contenu de tableau */ + +} DalvikPseudoOpcodes; + + + +#endif /* _PLUGINS_DALVIK_PSEUDO_IDENTIFIERS_H */ diff --git a/plugins/dalvik/pseudo/switch.c b/plugins/dalvik/pseudo/switch.c index 90cff87..d6d255c 100644 --- a/plugins/dalvik/pseudo/switch.c +++ b/plugins/dalvik/pseudo/switch.c @@ -28,6 +28,7 @@ #include <malloc.h> +#include "identifiers.h" #include "../instruction-int.h" @@ -68,6 +69,9 @@ static void g_dalvik_switch_instr_finalize(GDalvikSwitchInstr *); /* Lit toutes les valeurs associés aux branchements. */ static bool g_dalvik_switch_decode_data(GDalvikSwitchInstr *, const GBinContent *, const vmpa2t *); +/* Fournit le nom humain de l'instruction manipulée. */ +static const char *g_dalvik_switch_instruction_get_keyword(const GDalvikSwitchInstr *, AsmSyntax); + /* Indique le type défini pour une pseudo-instruction Dalvik de remplissage. */ @@ -89,12 +93,17 @@ G_DEFINE_TYPE(GDalvikSwitchInstr, g_dalvik_switch_instr, G_TYPE_DALVIK_INSTRUCTI static void g_dalvik_switch_instr_class_init(GDalvikSwitchInstrClass *klass) { GObjectClass *object; /* Autre version de la classe */ + GArchInstructionClass *instr; /* Encore une autre vision... */ object = G_OBJECT_CLASS(klass); object->dispose = (GObjectFinalizeFunc/* ! */)g_dalvik_switch_instr_dispose; object->finalize = (GObjectFinalizeFunc)g_dalvik_switch_instr_finalize; + instr = G_ARCH_INSTRUCTION_CLASS(klass); + + instr->get_keyword = (get_instruction_keyword_fc)g_dalvik_switch_instruction_get_keyword; + } @@ -112,7 +121,6 @@ static void g_dalvik_switch_instr_class_init(GDalvikSwitchInstrClass *klass) static void g_dalvik_switch_instr_init(GDalvikSwitchInstr *instr) { - G_DALVIK_INSTRUCTION(instr)->keyword = "switch-data"; } @@ -185,7 +193,7 @@ GArchInstruction *g_dalvik_switch_instr_new(uint16_t ident, GDalvikContext *ctx, result = g_object_new(G_TYPE_DALVIK_SWITCH_INSTR, NULL); - G_DALVIK_INSTRUCTION(result)->ptype = ident; + G_ARCH_INSTRUCTION(result)->uid = ident; if (!g_binary_content_read_u16(content, pos, SRE_LITTLE, &result->switch_size)) goto gdsin_bad; @@ -237,7 +245,7 @@ static bool g_dalvik_switch_decode_data(GDalvikSwitchInstr *instr, const GBinCon copy_vmpa(&iter, pos); - if (G_DALVIK_INSTRUCTION(instr)->ptype == DPO_PACKED_SWITCH) + if (G_ARCH_INSTRUCTION(instr)->uid == DPO_PACKED_SWITCH) { if (!g_binary_content_read_s32(content, &iter, SRE_LITTLE, &first_key)) goto gdsdd_bad; @@ -276,6 +284,30 @@ static bool g_dalvik_switch_decode_data(GDalvikSwitchInstr *instr, const GBinCon /****************************************************************************** * * +* Paramètres : instr = instruction d'assemblage à consulter. * +* syntax = type de représentation demandée. * +* * +* Description : Fournit le nom humain de l'instruction manipulée. * +* * +* Retour : Mot clef de bas niveau. * +* * +* Remarques : - * +* * +******************************************************************************/ + +static const char *g_dalvik_switch_instruction_get_keyword(const GDalvikSwitchInstr *instr, AsmSyntax syntax) +{ + const char *result; /* Désignation à retourner */ + + result = "switch-data"; + + return result; + +} + + +/****************************************************************************** +* * * Paramètres : instr = instruction d'assemblage à compléter. * * keys = tableau renseignant les conditions de saut. [OUT] * * targets = tableau renseignant les sauts relatifs. [OUT] * diff --git a/plugins/dalvik/pseudo/switch.h b/plugins/dalvik/pseudo/switch.h index d672f86..b17a9c9 100644 --- a/plugins/dalvik/pseudo/switch.h +++ b/plugins/dalvik/pseudo/switch.h @@ -21,8 +21,8 @@ */ -#ifndef _ARCH_DALVIK_PSEUDO_SWITCH_H -#define _ARCH_DALVIK_PSEUDO_SWITCH_H +#ifndef _PLUGINS_DALVIK_PSEUDO_SWITCH_H +#define _PLUGINS_DALVIK_PSEUDO_SWITCH_H #include "../context.h" @@ -60,4 +60,4 @@ uint16_t g_dalvik_switch_get_data(GDalvikSwitchInstr *, const int32_t **, const -#endif /* _ARCH_DALVIK_PSEUDO_SWITCH_H */ +#endif /* _PLUGINS_DALVIK_PSEUDO_SWITCH_H */ diff --git a/plugins/dalvik/register.h b/plugins/dalvik/register.h index de5efe5..d678bfd 100644 --- a/plugins/dalvik/register.h +++ b/plugins/dalvik/register.h @@ -21,8 +21,8 @@ */ -#ifndef _ARCH_DALVIK_REGISTERS_H -#define _ARCH_DALVIK_REGISTERS_H +#ifndef _PLUGINS_DALVIK_REGISTERS_H +#define _PLUGINS_DALVIK_REGISTERS_H #include <glib-object.h> @@ -73,4 +73,4 @@ void clean_dalvik_register_cache(void); -#endif /* _ARCH_DALVIK_REGISTERS_H */ +#endif /* _PLUGINS_DALVIK_REGISTERS_H */ diff --git a/plugins/dalvik/v35/Makefile.am b/plugins/dalvik/v35/Makefile.am new file mode 100644 index 0000000..a29d4a5 --- /dev/null +++ b/plugins/dalvik/v35/Makefile.am @@ -0,0 +1,20 @@ + +lib_LTLIBRARIES = libdalvik35.la + +libdalvik35_la_SOURCES = \ + instruction.h instruction.c \ + operand.h \ + processor.h processor.c + +libdalvik35_la_LIBADD = \ + opcodes/libdalvik35opcodes.la + +libdalvik35_la_CFLAGS = $(AM_CFLAGS) + + +AM_CPPFLAGS = $(LIBGTK_CFLAGS) $(LIBPYTHON_CFLAGS) $(LIBPYGOBJECT_CFLAGS) $(LIBXML_CFLAGS) -I$(top_srcdir)/src + +AM_CFLAGS = $(DEBUG_CFLAGS) $(WARNING_FLAGS) $(COMPLIANCE_FLAGS) + + +SUBDIRS = opdefs opcodes diff --git a/plugins/dalvik/v35/instruction.c b/plugins/dalvik/v35/instruction.c new file mode 100644 index 0000000..99d51d0 --- /dev/null +++ b/plugins/dalvik/v35/instruction.c @@ -0,0 +1,267 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * instruction.c - gestion des instructions de la VM Dalvik v35 + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +#include "instruction.h" + + +#include <assert.h> + + +#include "opcodes/descriptions.h" +#include "opcodes/keywords.h" +#include "../instruction-int.h" + + + +/* Définition générique d'une instruction d'architecture Dalvik v35 (instance) */ +struct _GDalvik35Instruction +{ + GDalvikInstruction parent; /* A laisser en premier */ + +}; + +/* Définition générique d'une instruction d'architecture Dalvik v35 (classe) */ +struct _GDalvik35InstructionClass +{ + GDalvikInstructionClass parent; /* A laisser en premier */ + +}; + + +/* Initialise la classe des instructions pour Dalvik v35. */ +static void g_dalvik35_instruction_class_init(GDalvik35InstructionClass *); + +/* Initialise une instance d'opérande d'architecture Dalvik. */ +static void g_dalvik35_instruction_init(GDalvik35Instruction *); + +/* Supprime toutes les références externes. */ +static void g_dalvik35_instruction_dispose(GDalvik35Instruction *); + +/* Procède à la libération totale de la mémoire. */ +static void g_dalvik35_instruction_finalize(GDalvik35Instruction *); + +/* Indique l'encodage d'une instruction de façon détaillée. */ +static const char *g_dalvik35_instruction_get_encoding(const GDalvik35Instruction *); + +/* Fournit le nom humain de l'instruction manipulée. */ +static const char *g_dalvik35_instruction_get_keyword(const GDalvik35Instruction *, AsmSyntax); + +/* Fournit une description pour l'instruction manipulée. */ +static const char *g_dalvik35_instruction_get_description(const GDalvik35Instruction *); + + + +/* Indique le type défini pour une instruction d'architecture Dalvik v35. */ +G_DEFINE_TYPE(GDalvik35Instruction, g_dalvik35_instruction, G_TYPE_DALVIK_INSTRUCTION); + + +/****************************************************************************** +* * +* Paramètres : klass = classe à initialiser. * +* * +* Description : Initialise la classe des instructions pour Dalvik v35. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +static void g_dalvik35_instruction_class_init(GDalvik35InstructionClass *klass) +{ + GObjectClass *object; /* Autre version de la classe */ + GArchInstructionClass *instr; /* Encore une autre vision... */ + + object = G_OBJECT_CLASS(klass); + + object->dispose = (GObjectFinalizeFunc/* ! */)g_dalvik35_instruction_dispose; + object->finalize = (GObjectFinalizeFunc)g_dalvik35_instruction_finalize; + + instr = G_ARCH_INSTRUCTION_CLASS(klass); + + instr->get_encoding = (get_instruction_encoding_fc)g_dalvik35_instruction_get_encoding; + instr->get_keyword = (get_instruction_keyword_fc)g_dalvik35_instruction_get_keyword; + instr->get_desc = (get_instruction_desc_fc)g_dalvik35_instruction_get_description; + +} + + +/****************************************************************************** +* * +* Paramètres : instr = instance à initialiser. * +* * +* Description : Initialise une instance d'instruction d'architecture Dalvik. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +static void g_dalvik35_instruction_init(GDalvik35Instruction *instr) +{ + +} + + +/****************************************************************************** +* * +* Paramètres : instr = instance d'objet GLib à traiter. * +* * +* Description : Supprime toutes les références externes. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +static void g_dalvik35_instruction_dispose(GDalvik35Instruction *instr) +{ + G_OBJECT_CLASS(g_dalvik35_instruction_parent_class)->dispose(G_OBJECT(instr)); + +} + + +/****************************************************************************** +* * +* Paramètres : instr = instance d'objet GLib à traiter. * +* * +* Description : Procède à la libération totale de la mémoire. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +static void g_dalvik35_instruction_finalize(GDalvik35Instruction *instr) +{ + G_OBJECT_CLASS(g_dalvik35_instruction_parent_class)->finalize(G_OBJECT(instr)); + +} + + +/****************************************************************************** +* * +* Paramètres : keyword = définition du nom humaine de l'instruction. * +* * +* Description : Crée une instruction pour l'architecture Dalvik v35. * +* * +* Retour : Adresse de la structure mise en place. * +* * +* Remarques : - * +* * +******************************************************************************/ + +GArchInstruction *g_dalvik35_instruction_new(itid_t uid) +{ + GArchInstruction *result; /* Structure à retourner */ + + result = g_object_new(G_TYPE_DALVIK35_INSTRUCTION, NULL); + + G_ARCH_INSTRUCTION(result)->uid = uid; + + return result; + +} + + +/****************************************************************************** +* * +* Paramètres : instr = instruction quelconque à consulter. * +* * +* Description : Indique l'encodage d'une instruction de façon détaillée. * +* * +* Retour : Description humaine de l'encodage utilisé. * +* * +* Remarques : - * +* * +******************************************************************************/ + +static const char *g_dalvik35_instruction_get_encoding(const GDalvik35Instruction *instr) +{ + const char *result; /* Description à retourner */ + + result = "Dalvik v35"; + + return result; + +} + + +/****************************************************************************** +* * +* Paramètres : instr = instruction d'assemblage à consulter. * +* syntax = type de représentation demandée. * +* * +* Description : Fournit le nom humain de l'instruction manipulée. * +* * +* Retour : Mot clef de bas niveau. * +* * +* Remarques : - * +* * +******************************************************************************/ + +static const char *g_dalvik35_instruction_get_keyword(const GDalvik35Instruction *instr, AsmSyntax syntax) +{ + const char *result; /* Désignation à retourner */ + itid_t uid; /* Accès simplifié */ + + uid = G_ARCH_INSTRUCTION(instr)->uid; + + assert(uid < DOP35_COUNT); + + result = _dalvik35_keywords[uid]; + + return result; + +} + + +/****************************************************************************** +* * +* Paramètres : instr = instruction d'assemblage à consulter. * +* * +* Description : Fournit une description pour l'instruction manipulée. * +* * +* Retour : Chaîne de caractères avec balises éventuelles. * +* * +* Remarques : - * +* * +******************************************************************************/ + +static const char *g_dalvik35_instruction_get_description(const GDalvik35Instruction *instr) +{ + const char *result; /* Description à retourner */ + itid_t uid; /* Accès simplifié */ + + uid = G_ARCH_INSTRUCTION(instr)->uid; + + assert(uid < DOP35_COUNT); + + result = _dalvik35_descriptions[uid]; + + return result; + +} diff --git a/plugins/dalvik/v35/instruction.h b/plugins/dalvik/v35/instruction.h new file mode 100644 index 0000000..152c224 --- /dev/null +++ b/plugins/dalvik/v35/instruction.h @@ -0,0 +1,55 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * instruction.h - prototypes pour la gestion des instructions de la VM Dalvik v35 + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +#ifndef _PLUGINS_DALVIK_V35_INSTRUCTION_H +#define _PLUGINS_DALVIK_V35_INSTRUCTION_H + + +#include <arch/instruction.h> + + + +#define G_TYPE_DALVIK35_INSTRUCTION g_dalvik35_instruction_get_type() +#define G_DALVIK35_INSTRUCTION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), G_TYPE_DALVIK35_INSTRUCTION, GDalvik35Instruction)) +#define G_IS_DALVIK35_INSTRUCTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), G_TYPE_DALVIK35_INSTRUCTION)) +#define G_DALVIK35_INSTRUCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_DALVIK35_INSTRUCTION, GDalvik35InstructionClass)) +#define G_IS_DALVIK35_INSTRUCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_DALVIK35_INSTRUCTION)) +#define G_DALVIK35_INSTRUCTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_DALVIK35_INSTRUCTION, GDalvik35InstructionClass)) + + +/* Définition générique d'une instruction d'architecture Dalvik v35 (instance) */ +typedef struct _GDalvik35Instruction GDalvik35Instruction; + +/* Définition générique d'une instruction d'architecture Dalvik v35 (classe) */ +typedef struct _GDalvik35InstructionClass GDalvik35InstructionClass; + + +/* Indique le type défini pour une instruction d'architecture Dalvik v35. */ +GType g_dalvik35_instruction_get_type(void); + +/* Crée une instruction pour l'architecture Dalvik v35. */ +GArchInstruction *g_dalvik35_instruction_new(itid_t); + + + +#endif /* _PLUGINS_DALVIK_V35_INSTRUCTION_H */ diff --git a/plugins/dalvik/opcodes/Makefile.am b/plugins/dalvik/v35/opcodes/Makefile.am index 9889cfa..4746f5c 100644 --- a/plugins/dalvik/opcodes/Makefile.am +++ b/plugins/dalvik/v35/opcodes/Makefile.am @@ -9,15 +9,18 @@ am__depfiles_maybe = depfiles include gencode.mk -noinst_LTLIBRARIES = libdalvikopcodes.la +noinst_LTLIBRARIES = libdalvik35opcodes.la -libdalvikopcodes_la_SOURCES = $(GENERATED_FILES) +libdalvik35opcodes_la_SOURCES = $(GENERATED_FILES) -libdalvikopcodes_la_LIBADD = +libdalvik35opcodes_la_LIBADD = -libdalvikopcodes_la_CFLAGS = $(AM_CFLAGS) +libdalvik35opcodes_la_CFLAGS = $(AM_CFLAGS) AM_CPPFLAGS = $(LIBGTK_CFLAGS) $(LIBXML_CFLAGS) -I$(top_srcdir)/src AM_CFLAGS = $(DEBUG_CFLAGS) $(WARNING_FLAGS) $(COMPLIANCE_FLAGS) + + +CLEANFILES = $(GENERATED_FILES) diff --git a/plugins/dalvik/opdefs/Makefile.am b/plugins/dalvik/v35/opdefs/Makefile.am index fed398f..f660e3d 100644 --- a/plugins/dalvik/opdefs/Makefile.am +++ b/plugins/dalvik/v35/opdefs/Makefile.am @@ -5,44 +5,44 @@ include $(top_srcdir)/tools/d2c/d2c.mk D2C_BIN = $(top_srcdir)/tools/d2c/d2c GEN_BIN = $(top_srcdir)/tools/d2c/d2c_genmakefile.sh -D2C_TYPE = format -D2C_OUTDIR = $(PWD)/.. +D2C_OUTDIR = $(PWD)/../opcodes/ + +D2C_TYPE = format -D2C_ARCH = dalvik -D2C_HEADER = _ARCH_DALVIK -D2C_PREFIX = DALVIK_OPT_ +D2C_ARCH = "Dalvik v35" +D2C_ARCH_CN = Dalvik35 +D2C_GUARD = PLUGINS_DALVIK_V35_OPCODES D2C_ENCODINGS = \ -e none -D2C_MACROS = \ - -M SetInsFlag=g_arch_instruction_set_flag +D2C_ID_PREFIX = DOP35 +D2C_ID_COUNT = 255 + +D2C_SPECIFIC = --op-prefix=DALVIK_OPT_ -FIXED_C_INCLUDES = \ - \n\#include \<stdint.h\> \ - \n \ - \n\#include <analysis\/content.h> \ - \n\#include <arch/context.h> \ - \n\#include <format\/executable.h> \ - \n \ - \n\#include \"..\/fetch.h\" \ - \n\#include \"..\/helpers.h\" \ - \n\#include \"..\/instruction.h\" \ - \n\#include \"..\/link.h\" \ - \n\#include \"..\/post.h\" \ - \n\#include \"..\/processor.h\" \ - \n\n -FIXED_H_INCLUDES = \ - \#include <stdint.h> \ - \n \ - \n\#include <arch/context.h> \ - \n\#include <analysis/content.h> \ - \n\#include <format/executable.h> \ - \n \ +FIXED_C_INCLUDES = \ + \#include <stdint.h> \ + \n \ + \n\#include "../instruction.h" \ + \n\#include "../operand.h" \ + \n\#include "../../fetch.h" \ + \n\#include "../../helpers.h" \ + \n\#include "../../link.h" \ + \n\#include "../../post.h" + +FIXED_H_INCLUDES = \ + \#include <stdint.h> \ + \n \ + \n\#include <analysis/content.h> \ + \n\#include <arch/context.h> \ + \n\#include <format/executable.h> \ + \n \ \n\#include "../processor.h" + # for (( i = 0; i < 256; i++)); do def=$(ls `printf "*_%02x.d" $i` 2> /dev/null); test -z "$def" || echo -e "\t$def\t\t\t\t\t\t\t\\" ; done DALVIK_DEFS = \ nop_00.d \ @@ -107,6 +107,12 @@ DALVIK_DEFS = \ if_3b.d \ if_3c.d \ if_3d.d \ + unused_3e.d \ + unused_3f.d \ + unused_40.d \ + unused_41.d \ + unused_42.d \ + unused_43.d \ aget_44.d \ aget_45.d \ aget_46.d \ @@ -154,11 +160,14 @@ DALVIK_DEFS = \ invoke_70.d \ invoke_71.d \ invoke_72.d \ + unused_73.d \ invoke_74.d \ invoke_75.d \ invoke_76.d \ invoke_77.d \ invoke_78.d \ + unused_79.d \ + unused_7a.d \ neg_7b.d \ not_7c.d \ neg_7d.d \ @@ -262,7 +271,37 @@ DALVIK_DEFS = \ xor_df.d \ shl_e0.d \ shr_e1.d \ - ushr_e2.d + ushr_e2.d \ + unused_e3.d \ + unused_e4.d \ + unused_e5.d \ + unused_e6.d \ + unused_e7.d \ + unused_e8.d \ + unused_e9.d \ + unused_ea.d \ + unused_eb.d \ + unused_ec.d \ + unused_ed.d \ + unused_ee.d \ + unused_ef.d \ + unused_f0.d \ + unused_f1.d \ + unused_f2.d \ + unused_f3.d \ + unused_f4.d \ + unused_f5.d \ + unused_f6.d \ + unused_f7.d \ + unused_f8.d \ + unused_f9.d \ + unused_fa.d \ + unused_fb.d \ + unused_fc.d \ + unused_fd.d \ + unused_fe.d \ + unused_ff.d + # make dist procède répertoire par répertoire. Or le répertoire opcodes utilise # le contenu du répertoire opdefs. Il faut donc générer les fichiers nécessaires @@ -279,7 +318,7 @@ dist-hook: all: $(DALVIK_DEFS:.d=.g) fmk.done d2c_final_rules fmk.done: $(DALVIK_DEFS) - $(GEN_BIN) ../opcodes/ ../opdefs/.gen $(top_srcdir)/tools/d2c/globalgen.mk - + $(GEN_BIN) $(D2C_OUTDIR) - touch $@ clean: diff --git a/plugins/dalvik/v35/opdefs/add_90.d b/plugins/dalvik/v35/opdefs/add_90.d new file mode 100644 index 0000000..a4eae0d --- /dev/null +++ b/plugins/dalvik/v35/opdefs/add_90.d @@ -0,0 +1,40 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title add-int + +@id 144 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the destination register. + +<b>Note:</b> Contrary to other <b>-long</b> mathematical operations (which take register pairs for both their first and their second source), <b>shl-long</b>, <b>shr-long</b>, and <b>ushr-long</b> take a register pair for their first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + +@encoding() { + + @format 23x + +} diff --git a/plugins/dalvik/v35/opdefs/add_9b.d b/plugins/dalvik/v35/opdefs/add_9b.d new file mode 100644 index 0000000..c26a453 --- /dev/null +++ b/plugins/dalvik/v35/opdefs/add_9b.d @@ -0,0 +1,40 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title add-long + +@id 155 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the destination register. + +<b>Note:</b> Contrary to other <b>-long</b> mathematical operations (which take register pairs for both their first and their second source), <b>shl-long</b>, <b>shr-long</b>, and <b>ushr-long</b> take a register pair for their first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + +@encoding() { + + @format 23x + +} diff --git a/plugins/dalvik/v35/opdefs/add_a6.d b/plugins/dalvik/v35/opdefs/add_a6.d new file mode 100644 index 0000000..16b95f1 --- /dev/null +++ b/plugins/dalvik/v35/opdefs/add_a6.d @@ -0,0 +1,40 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title add-float + +@id 166 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the destination register. + +<b>Note:</b> Contrary to other <b>-long</b> mathematical operations (which take register pairs for both their first and their second source), <b>shl-long</b>, <b>shr-long</b>, and <b>ushr-long</b> take a register pair for their first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + +@encoding() { + + @format 23x + +} diff --git a/plugins/dalvik/v35/opdefs/add_ab.d b/plugins/dalvik/v35/opdefs/add_ab.d new file mode 100644 index 0000000..20670ad --- /dev/null +++ b/plugins/dalvik/v35/opdefs/add_ab.d @@ -0,0 +1,40 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title add-double + +@id 171 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the destination register. + +<b>Note:</b> Contrary to other <b>-long</b> mathematical operations (which take register pairs for both their first and their second source), <b>shl-long</b>, <b>shr-long</b>, and <b>ushr-long</b> take a register pair for their first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + +@encoding() { + + @format 23x + +} diff --git a/plugins/dalvik/opdefs/add_b0.d b/plugins/dalvik/v35/opdefs/add_b0.d index 9c5605e..11a415e 100644 --- a/plugins/dalvik/opdefs/add_b0.d +++ b/plugins/dalvik/v35/opdefs/add_b0.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title add-int/2addr +@id 176 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the first source register. + +<b>Note:</b> Contrary to other <b>-long/2addr</b> mathematical operations (which take register pairs for both their destination/first source and their second source), <b>shl-long/2addr</b>, <b>shr-long/2addr</b>, and <b>ushr-long/2addr</b> take a register pair for their destination/first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/add_bb.d b/plugins/dalvik/v35/opdefs/add_bb.d index aba27f3..05f471d 100644 --- a/plugins/dalvik/opdefs/add_bb.d +++ b/plugins/dalvik/v35/opdefs/add_bb.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title add-long/2addr +@id 187 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the first source register. + +<b>Note:</b> Contrary to other <b>-long/2addr</b> mathematical operations (which take register pairs for both their destination/first source and their second source), <b>shl-long/2addr</b>, <b>shr-long/2addr</b>, and <b>ushr-long/2addr</b> take a register pair for their destination/first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/add_c6.d b/plugins/dalvik/v35/opdefs/add_c6.d index 3394b92..46a5025 100644 --- a/plugins/dalvik/opdefs/add_c6.d +++ b/plugins/dalvik/v35/opdefs/add_c6.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title add-float/2addr +@id 198 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the first source register. + +<b>Note:</b> Contrary to other <b>-long/2addr</b> mathematical operations (which take register pairs for both their destination/first source and their second source), <b>shl-long/2addr</b>, <b>shr-long/2addr</b>, and <b>ushr-long/2addr</b> take a register pair for their destination/first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/add_cb.d b/plugins/dalvik/v35/opdefs/add_cb.d index 896f614..4b12d63 100644 --- a/plugins/dalvik/opdefs/add_cb.d +++ b/plugins/dalvik/v35/opdefs/add_cb.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title add-double/2addr +@id 203 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the first source register. + +<b>Note:</b> Contrary to other <b>-long/2addr</b> mathematical operations (which take register pairs for both their destination/first source and their second source), <b>shl-long/2addr</b>, <b>shr-long/2addr</b>, and <b>ushr-long/2addr</b> take a register pair for their destination/first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/add_d0.d b/plugins/dalvik/v35/opdefs/add_d0.d index f6f4324..383d25c 100644 --- a/plugins/dalvik/opdefs/add_d0.d +++ b/plugins/dalvik/v35/opdefs/add_d0.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title add-int/lit16 +@id 208 + +@desc { + + Perform the indicated binary op on the indicated register (first argument) and literal value (second argument), storing the result in the destination register. + +<b>Note:</b> <b>rsub-int</b> does not have a suffix since this version is the main opb of its family. Also, see below for details on its semantics. + +} + @encoding() { @format 22s diff --git a/plugins/dalvik/opdefs/add_d8.d b/plugins/dalvik/v35/opdefs/add_d8.d index ec4ee01..e88a5c9 100644 --- a/plugins/dalvik/opdefs/add_d8.d +++ b/plugins/dalvik/v35/opdefs/add_d8.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title add-int/lit8 +@id 216 + +@desc { + + Perform the indicated binary op on the indicated register (first argument) and literal value (second argument), storing the result in the destination register. + +<b>Note:</b> See below for details on the semantics of <b>rsub-int</b>. + +} + @encoding() { @format 22b diff --git a/plugins/dalvik/opdefs/aget_44.d b/plugins/dalvik/v35/opdefs/aget_44.d index b3a26cb..6931af6 100644 --- a/plugins/dalvik/opdefs/aget_44.d +++ b/plugins/dalvik/v35/opdefs/aget_44.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title aget +@id 68 + +@desc { + + Perform the identified array operation at the identified index of the given array, loading or storing into the value register. + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/aget_45.d b/plugins/dalvik/v35/opdefs/aget_45.d index 184667b..9268f6f 100644 --- a/plugins/dalvik/opdefs/aget_45.d +++ b/plugins/dalvik/v35/opdefs/aget_45.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title aget-wide +@id 69 + +@desc { + + Perform the identified array operation at the identified index of the given array, loading or storing into the value register. + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/aget_46.d b/plugins/dalvik/v35/opdefs/aget_46.d index b951c09..0d2185e 100644 --- a/plugins/dalvik/opdefs/aget_46.d +++ b/plugins/dalvik/v35/opdefs/aget_46.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title aget-object +@id 70 + +@desc { + + Perform the identified array operation at the identified index of the given array, loading or storing into the value register. + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/aget_47.d b/plugins/dalvik/v35/opdefs/aget_47.d index 0a5e90b..5b75c11 100644 --- a/plugins/dalvik/opdefs/aget_47.d +++ b/plugins/dalvik/v35/opdefs/aget_47.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title aget-boolean +@id 71 + +@desc { + + Perform the identified array operation at the identified index of the given array, loading or storing into the value register. + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/aget_48.d b/plugins/dalvik/v35/opdefs/aget_48.d index c84f513..8765831 100644 --- a/plugins/dalvik/opdefs/aget_48.d +++ b/plugins/dalvik/v35/opdefs/aget_48.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title aget-byte +@id 72 + +@desc { + + Perform the identified array operation at the identified index of the given array, loading or storing into the value register. + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/aget_49.d b/plugins/dalvik/v35/opdefs/aget_49.d index 396434b..24e0fa9 100644 --- a/plugins/dalvik/opdefs/aget_49.d +++ b/plugins/dalvik/v35/opdefs/aget_49.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title aget-char +@id 73 + +@desc { + + Perform the identified array operation at the identified index of the given array, loading or storing into the value register. + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/aget_4a.d b/plugins/dalvik/v35/opdefs/aget_4a.d index ce9497f..841ec31 100644 --- a/plugins/dalvik/opdefs/aget_4a.d +++ b/plugins/dalvik/v35/opdefs/aget_4a.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title aget-short +@id 74 + +@desc { + + Perform the identified array operation at the identified index of the given array, loading or storing into the value register. + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/and_95.d b/plugins/dalvik/v35/opdefs/and_95.d index 3926c05..a75999d 100644 --- a/plugins/dalvik/opdefs/and_95.d +++ b/plugins/dalvik/v35/opdefs/and_95.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title and-int +@id 149 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the destination register. + +<b>Note:</b> Contrary to other <b>-long</b> mathematical operations (which take register pairs for both their first and their second source), <b>shl-long</b>, <b>shr-long</b>, and <b>ushr-long</b> take a register pair for their first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/and_a0.d b/plugins/dalvik/v35/opdefs/and_a0.d index b011156..488233e 100644 --- a/plugins/dalvik/opdefs/and_a0.d +++ b/plugins/dalvik/v35/opdefs/and_a0.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title and-long +@id 160 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the destination register. + +<b>Note:</b> Contrary to other <b>-long</b> mathematical operations (which take register pairs for both their first and their second source), <b>shl-long</b>, <b>shr-long</b>, and <b>ushr-long</b> take a register pair for their first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/and_b5.d b/plugins/dalvik/v35/opdefs/and_b5.d index dec2ffb..34547da 100644 --- a/plugins/dalvik/opdefs/and_b5.d +++ b/plugins/dalvik/v35/opdefs/and_b5.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title and-int/2addr +@id 181 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the first source register. + +<b>Note:</b> Contrary to other <b>-long/2addr</b> mathematical operations (which take register pairs for both their destination/first source and their second source), <b>shl-long/2addr</b>, <b>shr-long/2addr</b>, and <b>ushr-long/2addr</b> take a register pair for their destination/first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/and_c0.d b/plugins/dalvik/v35/opdefs/and_c0.d index 6fb52b6..17bf2c6 100644 --- a/plugins/dalvik/opdefs/and_c0.d +++ b/plugins/dalvik/v35/opdefs/and_c0.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title and-long/2addr +@id 192 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the first source register. + +<b>Note:</b> Contrary to other <b>-long/2addr</b> mathematical operations (which take register pairs for both their destination/first source and their second source), <b>shl-long/2addr</b>, <b>shr-long/2addr</b>, and <b>ushr-long/2addr</b> take a register pair for their destination/first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/and_d5.d b/plugins/dalvik/v35/opdefs/and_d5.d index 081c0d0..84c88c8 100644 --- a/plugins/dalvik/opdefs/and_d5.d +++ b/plugins/dalvik/v35/opdefs/and_d5.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title and-int/lit16 +@id 213 + +@desc { + + Perform the indicated binary op on the indicated register (first argument) and literal value (second argument), storing the result in the destination register. + +<b>Note:</b> <b>rsub-int</b> does not have a suffix since this version is the main opb of its family. Also, see below for details on its semantics. + +} + @encoding() { @format 22s diff --git a/plugins/dalvik/opdefs/and_dd.d b/plugins/dalvik/v35/opdefs/and_dd.d index 8adae05..0296b07 100644 --- a/plugins/dalvik/opdefs/and_dd.d +++ b/plugins/dalvik/v35/opdefs/and_dd.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title and-int/lit8 +@id 221 + +@desc { + + Perform the indicated binary op on the indicated register (first argument) and literal value (second argument), storing the result in the destination register. + +<b>Note:</b> See below for details on the semantics of <b>rsub-int</b>. + +} + @encoding() { @format 22b diff --git a/plugins/dalvik/opdefs/aput_4b.d b/plugins/dalvik/v35/opdefs/aput_4b.d index 90cc75f..dc6a820 100644 --- a/plugins/dalvik/opdefs/aput_4b.d +++ b/plugins/dalvik/v35/opdefs/aput_4b.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title aput +@id 75 + +@desc { + + Perform the identified array operation at the identified index of the given array, loading or storing into the value register. + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/aput_4c.d b/plugins/dalvik/v35/opdefs/aput_4c.d index ff545f4..83c38ac 100644 --- a/plugins/dalvik/opdefs/aput_4c.d +++ b/plugins/dalvik/v35/opdefs/aput_4c.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title aput-wide +@id 76 + +@desc { + + Perform the identified array operation at the identified index of the given array, loading or storing into the value register. + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/aput_4d.d b/plugins/dalvik/v35/opdefs/aput_4d.d index 4c9ae98..8c1a9d1 100644 --- a/plugins/dalvik/opdefs/aput_4d.d +++ b/plugins/dalvik/v35/opdefs/aput_4d.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title aput-object +@id 77 + +@desc { + + Perform the identified array operation at the identified index of the given array, loading or storing into the value register. + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/aput_4e.d b/plugins/dalvik/v35/opdefs/aput_4e.d index 1602e62..5c7c923 100644 --- a/plugins/dalvik/opdefs/aput_4e.d +++ b/plugins/dalvik/v35/opdefs/aput_4e.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title aput-boolean +@id 78 + +@desc { + + Perform the identified array operation at the identified index of the given array, loading or storing into the value register. + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/aput_4f.d b/plugins/dalvik/v35/opdefs/aput_4f.d index 3632974..29a4c70 100644 --- a/plugins/dalvik/opdefs/aput_4f.d +++ b/plugins/dalvik/v35/opdefs/aput_4f.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title aput-byte +@id 79 + +@desc { + + Perform the identified array operation at the identified index of the given array, loading or storing into the value register. + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/aput_50.d b/plugins/dalvik/v35/opdefs/aput_50.d index c295386..2c093ec 100644 --- a/plugins/dalvik/opdefs/aput_50.d +++ b/plugins/dalvik/v35/opdefs/aput_50.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title aput-char +@id 80 + +@desc { + + Perform the identified array operation at the identified index of the given array, loading or storing into the value register. + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/aput_51.d b/plugins/dalvik/v35/opdefs/aput_51.d index 11ad5b2..aeb9dd6 100644 --- a/plugins/dalvik/opdefs/aput_51.d +++ b/plugins/dalvik/v35/opdefs/aput_51.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title aput-short +@id 81 + +@desc { + + Perform the identified array operation at the identified index of the given array, loading or storing into the value register. + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/array_21.d b/plugins/dalvik/v35/opdefs/array_21.d index e0ca860..56f5c4f 100644 --- a/plugins/dalvik/opdefs/array_21.d +++ b/plugins/dalvik/v35/opdefs/array_21.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title array-length +@id 33 + +@desc { + + Store in the given destination register the length of the indicated array, in entries + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/array_24.d b/plugins/dalvik/v35/opdefs/array_24.d index 00b7896..5c5be4f 100644 --- a/plugins/dalvik/opdefs/array_24.d +++ b/plugins/dalvik/v35/opdefs/array_24.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title filled-new-array +@id 36 + +@desc { + + Construct an array of the given type and size, filling it with the supplied contents. The type must be an array type. The array's contents must be single-word (that is, no arrays of <b>long</b> or <b>double</b>, but reference types are acceptable). The constructed instance is stored as a "result" in the same way that the method invocation instructions store their results, so the constructed instance must be moved to a register with an immediately subsequent <b>move-result-object</b> instruction (if it is to be used). + +} + @encoding() { @format 35c | pool_type diff --git a/plugins/dalvik/opdefs/array_26.d b/plugins/dalvik/v35/opdefs/array_26.d index f57afd1..adceb24 100644 --- a/plugins/dalvik/opdefs/array_26.d +++ b/plugins/dalvik/v35/opdefs/array_26.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title fill-array-data +@id 38 + +@desc { + + Fill the given array with the indicated data. The reference must be to an array of primitives, and the data table must match it in type and must contain no more elements than will fit in the array. That is, the array may be larger than the table, and if so, only the initial elements of the array are set, leaving the remainder alone. + +} + @encoding() { @format 31t diff --git a/plugins/dalvik/opdefs/check_1f.d b/plugins/dalvik/v35/opdefs/check_1f.d index 0f59ba7..4be9fef 100644 --- a/plugins/dalvik/opdefs/check_1f.d +++ b/plugins/dalvik/v35/opdefs/check_1f.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title check-cast +@id 31 + +@desc { + + Throw a <b>ClassCastException</b> if the reference in the given register cannot be cast to the indicated type. + +<b>Note:</b> Since <b>A</b> must always be a reference (and not a primitive value), this will necessarily fail at runtime (that is, it will throw an exception) if <b>B</b> refers to a primitive type. + +} + @encoding() { @format 21c | pool_type diff --git a/plugins/dalvik/opdefs/cmp_31.d b/plugins/dalvik/v35/opdefs/cmp_31.d index baedee6..aeea00a 100644 --- a/plugins/dalvik/opdefs/cmp_31.d +++ b/plugins/dalvik/v35/opdefs/cmp_31.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title cmp-long +@id 49 + +@desc { + + Perform the indicated floating point or <b>long</b> comparison, setting <b>a</b> to <b>0</b> if <b>b == c</b>, <b>1</b> if <b>b > c</b>, or <b>-1</b> if <b>b < c</b>. The "bias" listed for the floating point operations indicates how <b>NaN</b> comparisons are treated: "gt bias" instructions return <b>1</b> for <b>NaN</b> comparisons, and "lt bias" instructions return <b>-1</b>. + +For example, to check to see if floating point <b>x < y</b> it is advisable to use <b>cmpg-float</b>; a result of <b>-1</b> indicates that the test was true, and the other values indicate it was false either due to a valid comparison or because one of the values was <b>NaN</b>. + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/cmpg_2e.d b/plugins/dalvik/v35/opdefs/cmpg_2e.d index 296337c..c06be47 100644 --- a/plugins/dalvik/opdefs/cmpg_2e.d +++ b/plugins/dalvik/v35/opdefs/cmpg_2e.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title cmpg-float +@id 46 + +@desc { + + Perform the indicated floating point or <b>long</b> comparison, setting <b>a</b> to <b>0</b> if <b>b == c</b>, <b>1</b> if <b>b > c</b>, or <b>-1</b> if <b>b < c</b>. The "bias" listed for the floating point operations indicates how <b>NaN</b> comparisons are treated: "gt bias" instructions return <b>1</b> for <b>NaN</b> comparisons, and "lt bias" instructions return <b>-1</b>. + +For example, to check to see if floating point <b>x < y</b> it is advisable to use <b>cmpg-float</b>; a result of <b>-1</b> indicates that the test was true, and the other values indicate it was false either due to a valid comparison or because one of the values was <b>NaN</b>. + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/cmpg_30.d b/plugins/dalvik/v35/opdefs/cmpg_30.d index dbb66ae..40917d4 100644 --- a/plugins/dalvik/opdefs/cmpg_30.d +++ b/plugins/dalvik/v35/opdefs/cmpg_30.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title cmpg-double +@id 48 + +@desc { + + Perform the indicated floating point or <b>long</b> comparison, setting <b>a</b> to <b>0</b> if <b>b == c</b>, <b>1</b> if <b>b > c</b>, or <b>-1</b> if <b>b < c</b>. The "bias" listed for the floating point operations indicates how <b>NaN</b> comparisons are treated: "gt bias" instructions return <b>1</b> for <b>NaN</b> comparisons, and "lt bias" instructions return <b>-1</b>. + +For example, to check to see if floating point <b>x < y</b> it is advisable to use <b>cmpg-float</b>; a result of <b>-1</b> indicates that the test was true, and the other values indicate it was false either due to a valid comparison or because one of the values was <b>NaN</b>. + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/cmpl_2d.d b/plugins/dalvik/v35/opdefs/cmpl_2d.d index b76b73e..9b9e883 100644 --- a/plugins/dalvik/opdefs/cmpl_2d.d +++ b/plugins/dalvik/v35/opdefs/cmpl_2d.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title cmpl-float +@id 45 + +@desc { + + Perform the indicated floating point or <b>long</b> comparison, setting <b>a</b> to <b>0</b> if <b>b == c</b>, <b>1</b> if <b>b > c</b>, or <b>-1</b> if <b>b < c</b>. The "bias" listed for the floating point operations indicates how <b>NaN</b> comparisons are treated: "gt bias" instructions return <b>1</b> for <b>NaN</b> comparisons, and "lt bias" instructions return <b>-1</b>. + +For example, to check to see if floating point <b>x < y</b> it is advisable to use <b>cmpg-float</b>; a result of <b>-1</b> indicates that the test was true, and the other values indicate it was false either due to a valid comparison or because one of the values was <b>NaN</b>. + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/cmpl_2f.d b/plugins/dalvik/v35/opdefs/cmpl_2f.d index cebd732..4429977 100644 --- a/plugins/dalvik/opdefs/cmpl_2f.d +++ b/plugins/dalvik/v35/opdefs/cmpl_2f.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title cmpl-double +@id 47 + +@desc { + + Perform the indicated floating point or <b>long</b> comparison, setting <b>a</b> to <b>0</b> if <b>b == c</b>, <b>1</b> if <b>b > c</b>, or <b>-1</b> if <b>b < c</b>. The "bias" listed for the floating point operations indicates how <b>NaN</b> comparisons are treated: "gt bias" instructions return <b>1</b> for <b>NaN</b> comparisons, and "lt bias" instructions return <b>-1</b>. + +For example, to check to see if floating point <b>x < y</b> it is advisable to use <b>cmpg-float</b>; a result of <b>-1</b> indicates that the test was true, and the other values indicate it was false either due to a valid comparison or because one of the values was <b>NaN</b>. + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/const_12.d b/plugins/dalvik/v35/opdefs/const_12.d index bc4e4f8..963738a 100644 --- a/plugins/dalvik/opdefs/const_12.d +++ b/plugins/dalvik/v35/opdefs/const_12.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title const/4 +@id 18 + +@desc { + + Move the given literal value (sign-extended to 32 bits) into the specified register. + +} + @encoding() { @format 11n diff --git a/plugins/dalvik/opdefs/const_13.d b/plugins/dalvik/v35/opdefs/const_13.d index 9b65ba4..32c09df 100644 --- a/plugins/dalvik/opdefs/const_13.d +++ b/plugins/dalvik/v35/opdefs/const_13.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title const/16 +@id 19 + +@desc { + + Move the given literal value (sign-extended to 32 bits) into the specified register. + +} + @encoding() { @format 21s diff --git a/plugins/dalvik/opdefs/const_14.d b/plugins/dalvik/v35/opdefs/const_14.d index 039d372..402a889 100644 --- a/plugins/dalvik/opdefs/const_14.d +++ b/plugins/dalvik/v35/opdefs/const_14.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title const +@id 20 + +@desc { + + Move the given literal value into the specified register. + +} + @encoding() { @format 31i diff --git a/plugins/dalvik/opdefs/const_15.d b/plugins/dalvik/v35/opdefs/const_15.d index add0673..a9d6f98 100644 --- a/plugins/dalvik/opdefs/const_15.d +++ b/plugins/dalvik/v35/opdefs/const_15.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title const/high16 +@id 21 + +@desc { + + Move the given literal value (right-zero-extended to 32 bits) into the specified register. + +} + @encoding() { @format 21h diff --git a/plugins/dalvik/opdefs/const_16.d b/plugins/dalvik/v35/opdefs/const_16.d index cb1ce25..3dcc25a 100644 --- a/plugins/dalvik/opdefs/const_16.d +++ b/plugins/dalvik/v35/opdefs/const_16.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title const-wide/16 +@id 22 + +@desc { + + Move the given literal value (sign-extended to 64 bits) into the specified register-pair. + +} + @encoding() { @format 21s diff --git a/plugins/dalvik/opdefs/const_17.d b/plugins/dalvik/v35/opdefs/const_17.d index 88a9f0c..093f6d6 100644 --- a/plugins/dalvik/opdefs/const_17.d +++ b/plugins/dalvik/v35/opdefs/const_17.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title const-wide/32 +@id 23 + +@desc { + + Move the given literal value (sign-extended to 64 bits) into the specified register-pair. + +} + @encoding() { @format 31i diff --git a/plugins/dalvik/opdefs/const_18.d b/plugins/dalvik/v35/opdefs/const_18.d index d792add..b77fad9 100644 --- a/plugins/dalvik/opdefs/const_18.d +++ b/plugins/dalvik/v35/opdefs/const_18.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title const-wide +@id 24 + +@desc { + + Move the given literal value into the specified register-pair. + +} + @encoding() { @format 51l diff --git a/plugins/dalvik/opdefs/const_19.d b/plugins/dalvik/v35/opdefs/const_19.d index 577eaf3..731797c 100644 --- a/plugins/dalvik/opdefs/const_19.d +++ b/plugins/dalvik/v35/opdefs/const_19.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title const-wide/high16 +@id 25 + +@desc { + + Move the given literal value (right-zero-extended to 64 bits) into the specified register-pair. + +} + @encoding() { @format 21h diff --git a/plugins/dalvik/opdefs/const_1a.d b/plugins/dalvik/v35/opdefs/const_1a.d index 22c11ae..a019a08 100644 --- a/plugins/dalvik/opdefs/const_1a.d +++ b/plugins/dalvik/v35/opdefs/const_1a.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title const-string +@id 26 + +@desc { + + Move a reference to the string specified by the given index into the specified register. + +} + @encoding() { @format 21c | pool_string diff --git a/plugins/dalvik/opdefs/const_1b.d b/plugins/dalvik/v35/opdefs/const_1b.d index 699cef6..65323bc 100644 --- a/plugins/dalvik/opdefs/const_1b.d +++ b/plugins/dalvik/v35/opdefs/const_1b.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title const-string/jumbo +@id 27 + +@desc { + + Move a reference to the string specified by the given index into the specified register. + +} + @encoding() { @format 31c | pool_string diff --git a/plugins/dalvik/opdefs/const_1c.d b/plugins/dalvik/v35/opdefs/const_1c.d index c539ee9..ff7d1ae 100644 --- a/plugins/dalvik/opdefs/const_1c.d +++ b/plugins/dalvik/v35/opdefs/const_1c.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title const-class +@id 28 + +@desc { + + Move a reference to the class specified by the given index into the specified register. In the case where the indicated type is primitive, this will store a reference to the primitive type's degenerate class. + +} + @encoding() { @format 21c | pool_type diff --git a/plugins/dalvik/opdefs/div_93.d b/plugins/dalvik/v35/opdefs/div_93.d index cfb7f34..096a084 100644 --- a/plugins/dalvik/opdefs/div_93.d +++ b/plugins/dalvik/v35/opdefs/div_93.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title div-int +@id 147 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the destination register. + +<b>Note:</b> Contrary to other <b>-long</b> mathematical operations (which take register pairs for both their first and their second source), <b>shl-long</b>, <b>shr-long</b>, and <b>ushr-long</b> take a register pair for their first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/div_9e.d b/plugins/dalvik/v35/opdefs/div_9e.d index b12ebd1..cbe850a 100644 --- a/plugins/dalvik/opdefs/div_9e.d +++ b/plugins/dalvik/v35/opdefs/div_9e.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title div-long +@id 158 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the destination register. + +<b>Note:</b> Contrary to other <b>-long</b> mathematical operations (which take register pairs for both their first and their second source), <b>shl-long</b>, <b>shr-long</b>, and <b>ushr-long</b> take a register pair for their first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/div_a9.d b/plugins/dalvik/v35/opdefs/div_a9.d index f7ce52e..728eec5 100644 --- a/plugins/dalvik/opdefs/div_a9.d +++ b/plugins/dalvik/v35/opdefs/div_a9.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title div-float +@id 169 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the destination register. + +<b>Note:</b> Contrary to other <b>-long</b> mathematical operations (which take register pairs for both their first and their second source), <b>shl-long</b>, <b>shr-long</b>, and <b>ushr-long</b> take a register pair for their first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/div_ae.d b/plugins/dalvik/v35/opdefs/div_ae.d index fae8164..aaf9952 100644 --- a/plugins/dalvik/opdefs/div_ae.d +++ b/plugins/dalvik/v35/opdefs/div_ae.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title div-double +@id 174 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the destination register. + +<b>Note:</b> Contrary to other <b>-long</b> mathematical operations (which take register pairs for both their first and their second source), <b>shl-long</b>, <b>shr-long</b>, and <b>ushr-long</b> take a register pair for their first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/div_b3.d b/plugins/dalvik/v35/opdefs/div_b3.d index d1cf5d9..30c3092 100644 --- a/plugins/dalvik/opdefs/div_b3.d +++ b/plugins/dalvik/v35/opdefs/div_b3.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title div-int/2addr +@id 179 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the first source register. + +<b>Note:</b> Contrary to other <b>-long/2addr</b> mathematical operations (which take register pairs for both their destination/first source and their second source), <b>shl-long/2addr</b>, <b>shr-long/2addr</b>, and <b>ushr-long/2addr</b> take a register pair for their destination/first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/div_be.d b/plugins/dalvik/v35/opdefs/div_be.d index a146c29..3506db1 100644 --- a/plugins/dalvik/opdefs/div_be.d +++ b/plugins/dalvik/v35/opdefs/div_be.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title div-long/2addr +@id 190 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the first source register. + +<b>Note:</b> Contrary to other <b>-long/2addr</b> mathematical operations (which take register pairs for both their destination/first source and their second source), <b>shl-long/2addr</b>, <b>shr-long/2addr</b>, and <b>ushr-long/2addr</b> take a register pair for their destination/first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/div_c9.d b/plugins/dalvik/v35/opdefs/div_c9.d index 541ed90..9585edf 100644 --- a/plugins/dalvik/opdefs/div_c9.d +++ b/plugins/dalvik/v35/opdefs/div_c9.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title div-float/2addr +@id 201 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the first source register. + +<b>Note:</b> Contrary to other <b>-long/2addr</b> mathematical operations (which take register pairs for both their destination/first source and their second source), <b>shl-long/2addr</b>, <b>shr-long/2addr</b>, and <b>ushr-long/2addr</b> take a register pair for their destination/first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/div_ce.d b/plugins/dalvik/v35/opdefs/div_ce.d index 2c735e4..96e7196 100644 --- a/plugins/dalvik/opdefs/div_ce.d +++ b/plugins/dalvik/v35/opdefs/div_ce.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title div-double/2addr +@id 206 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the first source register. + +<b>Note:</b> Contrary to other <b>-long/2addr</b> mathematical operations (which take register pairs for both their destination/first source and their second source), <b>shl-long/2addr</b>, <b>shr-long/2addr</b>, and <b>ushr-long/2addr</b> take a register pair for their destination/first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/div_d3.d b/plugins/dalvik/v35/opdefs/div_d3.d index 9dde5bd..a669a66 100644 --- a/plugins/dalvik/opdefs/div_d3.d +++ b/plugins/dalvik/v35/opdefs/div_d3.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title div-int/lit16 +@id 211 + +@desc { + + Perform the indicated binary op on the indicated register (first argument) and literal value (second argument), storing the result in the destination register. + +<b>Note:</b> <b>rsub-int</b> does not have a suffix since this version is the main opb of its family. Also, see below for details on its semantics. + +} + @encoding() { @format 22s diff --git a/plugins/dalvik/opdefs/div_db.d b/plugins/dalvik/v35/opdefs/div_db.d index 6754ed8..6c6ee91 100644 --- a/plugins/dalvik/opdefs/div_db.d +++ b/plugins/dalvik/v35/opdefs/div_db.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title div-int/lit8 +@id 219 + +@desc { + + Perform the indicated binary op on the indicated register (first argument) and literal value (second argument), storing the result in the destination register. + +<b>Note:</b> See below for details on the semantics of <b>rsub-int</b>. + +} + @encoding() { @format 22b diff --git a/plugins/dalvik/opdefs/filled_25.d b/plugins/dalvik/v35/opdefs/filled_25.d index cf31e09..aabc19f 100644 --- a/plugins/dalvik/opdefs/filled_25.d +++ b/plugins/dalvik/v35/opdefs/filled_25.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title filled-new-array/range +@id 37 + +@desc { + + Construct an array of the given type and size, filling it with the supplied contents. Clarifications and restrictions are the same as <b>filled-new-array</b>, described above. + +} + @encoding() { @format 3rc | pool_type diff --git a/plugins/dalvik/opdefs/goto_28.d b/plugins/dalvik/v35/opdefs/goto_28.d index a9c12d1..1d99514 100644 --- a/plugins/dalvik/opdefs/goto_28.d +++ b/plugins/dalvik/v35/opdefs/goto_28.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title goto +@id 40 + +@desc { + + Unconditionally jump to the indicated instruction. + +<b>Note:</b> The branch offset must not be <b>0</b>. (A spin loop may be legally constructed either with <b>goto/32</b> or by including a <b>nop</b> as a target before the branch.) + +} + @encoding() { @format 10t diff --git a/plugins/dalvik/opdefs/goto_29.d b/plugins/dalvik/v35/opdefs/goto_29.d index 8272a7d..6a19c84 100644 --- a/plugins/dalvik/opdefs/goto_29.d +++ b/plugins/dalvik/v35/opdefs/goto_29.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title goto/16 +@id 41 + +@desc { + + Unconditionally jump to the indicated instruction. + +<b>Note:</b> The branch offset must not be <b>0</b>. (A spin loop may be legally constructed either with <b>goto/32</b> or by including a <b>nop</b> as a target before the branch.) + +} + @encoding() { @format 20t diff --git a/plugins/dalvik/opdefs/goto_2a.d b/plugins/dalvik/v35/opdefs/goto_2a.d index 937b10d..f9108ea 100644 --- a/plugins/dalvik/opdefs/goto_2a.d +++ b/plugins/dalvik/v35/opdefs/goto_2a.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title goto/32 +@id 42 + +@desc { + + Unconditionally jump to the indicated instruction. + +} + @encoding() { @format 30t diff --git a/plugins/dalvik/opdefs/if_32.d b/plugins/dalvik/v35/opdefs/if_32.d index f88098a..5fe3e80 100644 --- a/plugins/dalvik/opdefs/if_32.d +++ b/plugins/dalvik/v35/opdefs/if_32.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title if-eq +@id 50 + +@desc { + + Branch to the given destination if the given two registers' values compare as specified. + +<b>Note:</b> The branch offset must not be <b>0</b>. (A spin loop may be legally constructed either by branching around a backward <b>goto</b> or by including a <b>nop</b> as a target before the branch.) + +} + @encoding() { @format 22t diff --git a/plugins/dalvik/opdefs/if_33.d b/plugins/dalvik/v35/opdefs/if_33.d index f655f67..de20c7f 100644 --- a/plugins/dalvik/opdefs/if_33.d +++ b/plugins/dalvik/v35/opdefs/if_33.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title if-ne +@id 51 + +@desc { + + Branch to the given destination if the given two registers' values compare as specified. + +<b>Note:</b> The branch offset must not be <b>0</b>. (A spin loop may be legally constructed either by branching around a backward <b>goto</b> or by including a <b>nop</b> as a target before the branch.) + +} + @encoding() { @format 22t diff --git a/plugins/dalvik/opdefs/if_34.d b/plugins/dalvik/v35/opdefs/if_34.d index 1146980..d571c47 100644 --- a/plugins/dalvik/opdefs/if_34.d +++ b/plugins/dalvik/v35/opdefs/if_34.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title if-lt +@id 52 + +@desc { + + Branch to the given destination if the given two registers' values compare as specified. + +<b>Note:</b> The branch offset must not be <b>0</b>. (A spin loop may be legally constructed either by branching around a backward <b>goto</b> or by including a <b>nop</b> as a target before the branch.) + +} + @encoding() { @format 22t diff --git a/plugins/dalvik/opdefs/if_35.d b/plugins/dalvik/v35/opdefs/if_35.d index b11b243..2467a6d 100644 --- a/plugins/dalvik/opdefs/if_35.d +++ b/plugins/dalvik/v35/opdefs/if_35.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title if-ge +@id 53 + +@desc { + + Branch to the given destination if the given two registers' values compare as specified. + +<b>Note:</b> The branch offset must not be <b>0</b>. (A spin loop may be legally constructed either by branching around a backward <b>goto</b> or by including a <b>nop</b> as a target before the branch.) + +} + @encoding() { @format 22t diff --git a/plugins/dalvik/opdefs/if_36.d b/plugins/dalvik/v35/opdefs/if_36.d index 7436901..d4142d8 100644 --- a/plugins/dalvik/opdefs/if_36.d +++ b/plugins/dalvik/v35/opdefs/if_36.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title if-gt +@id 54 + +@desc { + + Branch to the given destination if the given two registers' values compare as specified. + +<b>Note:</b> The branch offset must not be <b>0</b>. (A spin loop may be legally constructed either by branching around a backward <b>goto</b> or by including a <b>nop</b> as a target before the branch.) + +} + @encoding() { @format 22t diff --git a/plugins/dalvik/opdefs/if_37.d b/plugins/dalvik/v35/opdefs/if_37.d index 9ecbd84..8097bff 100644 --- a/plugins/dalvik/opdefs/if_37.d +++ b/plugins/dalvik/v35/opdefs/if_37.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title if-le +@id 55 + +@desc { + + Branch to the given destination if the given two registers' values compare as specified. + +<b>Note:</b> The branch offset must not be <b>0</b>. (A spin loop may be legally constructed either by branching around a backward <b>goto</b> or by including a <b>nop</b> as a target before the branch.) + +} + @encoding() { @format 22t diff --git a/plugins/dalvik/opdefs/if_38.d b/plugins/dalvik/v35/opdefs/if_38.d index ff21f2b..54680c2 100644 --- a/plugins/dalvik/opdefs/if_38.d +++ b/plugins/dalvik/v35/opdefs/if_38.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title if-eqz +@id 56 + +@desc { + + Branch to the given destination if the given register's value compares with 0 as specified. + +<b>Note:</b> The branch offset must not be <b>0</b>. (A spin loop may be legally constructed either by branching around a backward <b>goto</b> or by including a <b>nop</b> as a target before the branch.) + +} + @encoding() { @format 21t diff --git a/plugins/dalvik/opdefs/if_39.d b/plugins/dalvik/v35/opdefs/if_39.d index 0dbba57..d74191e 100644 --- a/plugins/dalvik/opdefs/if_39.d +++ b/plugins/dalvik/v35/opdefs/if_39.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title if-nez +@id 57 + +@desc { + + Branch to the given destination if the given register's value compares with 0 as specified. + +<b>Note:</b> The branch offset must not be <b>0</b>. (A spin loop may be legally constructed either by branching around a backward <b>goto</b> or by including a <b>nop</b> as a target before the branch.) + +} + @encoding() { @format 21t diff --git a/plugins/dalvik/opdefs/if_3a.d b/plugins/dalvik/v35/opdefs/if_3a.d index b003824..ded0257 100644 --- a/plugins/dalvik/opdefs/if_3a.d +++ b/plugins/dalvik/v35/opdefs/if_3a.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title if-ltz +@id 58 + +@desc { + + Branch to the given destination if the given register's value compares with 0 as specified. + +<b>Note:</b> The branch offset must not be <b>0</b>. (A spin loop may be legally constructed either by branching around a backward <b>goto</b> or by including a <b>nop</b> as a target before the branch.) + +} + @encoding() { @format 21t diff --git a/plugins/dalvik/opdefs/if_3b.d b/plugins/dalvik/v35/opdefs/if_3b.d index f571d7e..bd0591f 100644 --- a/plugins/dalvik/opdefs/if_3b.d +++ b/plugins/dalvik/v35/opdefs/if_3b.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title if-gez +@id 59 + +@desc { + + Branch to the given destination if the given register's value compares with 0 as specified. + +<b>Note:</b> The branch offset must not be <b>0</b>. (A spin loop may be legally constructed either by branching around a backward <b>goto</b> or by including a <b>nop</b> as a target before the branch.) + +} + @encoding() { @format 21t diff --git a/plugins/dalvik/opdefs/if_3c.d b/plugins/dalvik/v35/opdefs/if_3c.d index 154fe2c..9f0e622 100644 --- a/plugins/dalvik/opdefs/if_3c.d +++ b/plugins/dalvik/v35/opdefs/if_3c.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title if-gtz +@id 60 + +@desc { + + Branch to the given destination if the given register's value compares with 0 as specified. + +<b>Note:</b> The branch offset must not be <b>0</b>. (A spin loop may be legally constructed either by branching around a backward <b>goto</b> or by including a <b>nop</b> as a target before the branch.) + +} + @encoding() { @format 21t diff --git a/plugins/dalvik/opdefs/if_3d.d b/plugins/dalvik/v35/opdefs/if_3d.d index 2aa5f87..92eaeb9 100644 --- a/plugins/dalvik/opdefs/if_3d.d +++ b/plugins/dalvik/v35/opdefs/if_3d.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title if-lez +@id 61 + +@desc { + + Branch to the given destination if the given register's value compares with 0 as specified. + +<b>Note:</b> The branch offset must not be <b>0</b>. (A spin loop may be legally constructed either by branching around a backward <b>goto</b> or by including a <b>nop</b> as a target before the branch.) + +} + @encoding() { @format 21t diff --git a/plugins/dalvik/opdefs/iget_52.d b/plugins/dalvik/v35/opdefs/iget_52.d index ca5c140..b88bb18 100644 --- a/plugins/dalvik/opdefs/iget_52.d +++ b/plugins/dalvik/v35/opdefs/iget_52.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title iget +@id 82 + +@desc { + + Perform the identified object instance field operation with the identified field, loading or storing into the value register. + +<b>Note:</b> These opbs are reasonable candidates for static linking, altering the field argument to be a more direct offset. + +} + @encoding() { @format 22c | pool_field diff --git a/plugins/dalvik/opdefs/iget_53.d b/plugins/dalvik/v35/opdefs/iget_53.d index 3d458d9..878a108 100644 --- a/plugins/dalvik/opdefs/iget_53.d +++ b/plugins/dalvik/v35/opdefs/iget_53.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title iget-wide +@id 83 + +@desc { + + Perform the identified object instance field operation with the identified field, loading or storing into the value register. + +<b>Note:</b> These opbs are reasonable candidates for static linking, altering the field argument to be a more direct offset. + +} + @encoding() { @format 22c | pool_field diff --git a/plugins/dalvik/opdefs/iget_54.d b/plugins/dalvik/v35/opdefs/iget_54.d index 343accc..6eb1235 100644 --- a/plugins/dalvik/opdefs/iget_54.d +++ b/plugins/dalvik/v35/opdefs/iget_54.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title iget-object +@id 84 + +@desc { + + Perform the identified object instance field operation with the identified field, loading or storing into the value register. + +<b>Note:</b> These opbs are reasonable candidates for static linking, altering the field argument to be a more direct offset. + +} + @encoding() { @format 22c | pool_field diff --git a/plugins/dalvik/opdefs/iget_55.d b/plugins/dalvik/v35/opdefs/iget_55.d index dc9d7a4..fa65812 100644 --- a/plugins/dalvik/opdefs/iget_55.d +++ b/plugins/dalvik/v35/opdefs/iget_55.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title iget-boolean +@id 85 + +@desc { + + Perform the identified object instance field operation with the identified field, loading or storing into the value register. + +<b>Note:</b> These opbs are reasonable candidates for static linking, altering the field argument to be a more direct offset. + +} + @encoding() { @format 22c | pool_field diff --git a/plugins/dalvik/opdefs/iget_56.d b/plugins/dalvik/v35/opdefs/iget_56.d index 92e4d6c..d77ef24 100644 --- a/plugins/dalvik/opdefs/iget_56.d +++ b/plugins/dalvik/v35/opdefs/iget_56.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title iget-byte +@id 86 + +@desc { + + Perform the identified object instance field operation with the identified field, loading or storing into the value register. + +<b>Note:</b> These opbs are reasonable candidates for static linking, altering the field argument to be a more direct offset. + +} + @encoding() { @format 22c | pool_field diff --git a/plugins/dalvik/opdefs/iget_57.d b/plugins/dalvik/v35/opdefs/iget_57.d index b8864c7..acde802 100644 --- a/plugins/dalvik/opdefs/iget_57.d +++ b/plugins/dalvik/v35/opdefs/iget_57.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title iget-char +@id 87 + +@desc { + + Perform the identified object instance field operation with the identified field, loading or storing into the value register. + +<b>Note:</b> These opbs are reasonable candidates for static linking, altering the field argument to be a more direct offset. + +} + @encoding() { @format 22c | pool_field diff --git a/plugins/dalvik/opdefs/iget_58.d b/plugins/dalvik/v35/opdefs/iget_58.d index 85a3fb8..7a0ac96 100644 --- a/plugins/dalvik/opdefs/iget_58.d +++ b/plugins/dalvik/v35/opdefs/iget_58.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title iget-short +@id 88 + +@desc { + + Perform the identified object instance field operation with the identified field, loading or storing into the value register. + +<b>Note:</b> These opbs are reasonable candidates for static linking, altering the field argument to be a more direct offset. + +} + @encoding() { @format 22c | pool_field diff --git a/plugins/dalvik/opdefs/instanceof_20.d b/plugins/dalvik/v35/opdefs/instanceof_20.d index 7652c56..3e84fb7 100644 --- a/plugins/dalvik/opdefs/instanceof_20.d +++ b/plugins/dalvik/v35/opdefs/instanceof_20.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title instance-of +@id 32 + +@desc { + + Store in the given destination register <b>1</b> if the indicated reference is an instance of the given type, or <b>0</b> if not. + +<b>Note:</b> Since <b>B</b> must always be a reference (and not a primitive value), this will always result in <b>0</b> being stored if <b>C</b> refers to a primitive type. + +} + @encoding() { @format 22c | pool_type diff --git a/plugins/dalvik/v35/opdefs/invoke_6e.d b/plugins/dalvik/v35/opdefs/invoke_6e.d new file mode 100644 index 0000000..a045be8 --- /dev/null +++ b/plugins/dalvik/v35/opdefs/invoke_6e.d @@ -0,0 +1,52 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title invoke-virtual + +@id 110 + +@desc { + + Call the indicated method. The result (if any) may be stored with an appropriate <b>move-result*</b> variant as the immediately subsequent instruction. + +<b>invoke-virtual</b> is used to invoke a normal virtual method (a method that is not <b>private</b>, <b>static</b>, or <b>final</b>, and is also not a constructor). + +When the <b>method_id</b> references a method of a non-interface class, <b>invoke-super</b> is used to invoke the closest superclass's virtual method (as opposed to the one with the same <b>method_id</b> in the calling class). The same method restrictions hold as for <b>invoke-virtual</b>. + +In Dex files version <b>037</b> or later, if the <b>method_id</b> refers to an interface method, <b>invoke-super</b> is used to invoke the most specific, non-overridden version of that method defined on that interface. The same method restrictions hold as for <b>invoke-virtual</b>. In Dex files prior to version <b>037</b>, having an interface <b>method_id</b> is illegal and undefined. + +<b>invoke-direct</b> is used to invoke a non-<b>static</b> direct method (that is, an instance method that is by its nature non-overridable, namely either a <b>private</b> instance method or a constructor). + +<b>invoke-static</b> is used to invoke a <b>static</b> method (which is always considered a direct method). + +<b>invoke-interface</b> is used to invoke an <b>interface</b> method, that is, on an object whose concrete class isn't known, using a <b>method_id</b> that refers to an <b>interface</b>. + +<b>Note:</b> These opbs are reasonable candidates for static linking, altering the method argument to be a more direct offset (or pair thereof). + +} + +@encoding() { + + @format 35c | pool_meth + +} diff --git a/plugins/dalvik/v35/opdefs/invoke_6f.d b/plugins/dalvik/v35/opdefs/invoke_6f.d new file mode 100644 index 0000000..804f2d1 --- /dev/null +++ b/plugins/dalvik/v35/opdefs/invoke_6f.d @@ -0,0 +1,52 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title invoke-super + +@id 111 + +@desc { + + Call the indicated method. The result (if any) may be stored with an appropriate <b>move-result*</b> variant as the immediately subsequent instruction. + +<b>invoke-virtual</b> is used to invoke a normal virtual method (a method that is not <b>private</b>, <b>static</b>, or <b>final</b>, and is also not a constructor). + +When the <b>method_id</b> references a method of a non-interface class, <b>invoke-super</b> is used to invoke the closest superclass's virtual method (as opposed to the one with the same <b>method_id</b> in the calling class). The same method restrictions hold as for <b>invoke-virtual</b>. + +In Dex files version <b>037</b> or later, if the <b>method_id</b> refers to an interface method, <b>invoke-super</b> is used to invoke the most specific, non-overridden version of that method defined on that interface. The same method restrictions hold as for <b>invoke-virtual</b>. In Dex files prior to version <b>037</b>, having an interface <b>method_id</b> is illegal and undefined. + +<b>invoke-direct</b> is used to invoke a non-<b>static</b> direct method (that is, an instance method that is by its nature non-overridable, namely either a <b>private</b> instance method or a constructor). + +<b>invoke-static</b> is used to invoke a <b>static</b> method (which is always considered a direct method). + +<b>invoke-interface</b> is used to invoke an <b>interface</b> method, that is, on an object whose concrete class isn't known, using a <b>method_id</b> that refers to an <b>interface</b>. + +<b>Note:</b> These opbs are reasonable candidates for static linking, altering the method argument to be a more direct offset (or pair thereof). + +} + +@encoding() { + + @format 35c | pool_meth + +} diff --git a/plugins/dalvik/v35/opdefs/invoke_70.d b/plugins/dalvik/v35/opdefs/invoke_70.d new file mode 100644 index 0000000..f383427 --- /dev/null +++ b/plugins/dalvik/v35/opdefs/invoke_70.d @@ -0,0 +1,52 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title invoke-direct + +@id 112 + +@desc { + + Call the indicated method. The result (if any) may be stored with an appropriate <b>move-result*</b> variant as the immediately subsequent instruction. + +<b>invoke-virtual</b> is used to invoke a normal virtual method (a method that is not <b>private</b>, <b>static</b>, or <b>final</b>, and is also not a constructor). + +When the <b>method_id</b> references a method of a non-interface class, <b>invoke-super</b> is used to invoke the closest superclass's virtual method (as opposed to the one with the same <b>method_id</b> in the calling class). The same method restrictions hold as for <b>invoke-virtual</b>. + +In Dex files version <b>037</b> or later, if the <b>method_id</b> refers to an interface method, <b>invoke-super</b> is used to invoke the most specific, non-overridden version of that method defined on that interface. The same method restrictions hold as for <b>invoke-virtual</b>. In Dex files prior to version <b>037</b>, having an interface <b>method_id</b> is illegal and undefined. + +<b>invoke-direct</b> is used to invoke a non-<b>static</b> direct method (that is, an instance method that is by its nature non-overridable, namely either a <b>private</b> instance method or a constructor). + +<b>invoke-static</b> is used to invoke a <b>static</b> method (which is always considered a direct method). + +<b>invoke-interface</b> is used to invoke an <b>interface</b> method, that is, on an object whose concrete class isn't known, using a <b>method_id</b> that refers to an <b>interface</b>. + +<b>Note:</b> These opbs are reasonable candidates for static linking, altering the method argument to be a more direct offset (or pair thereof). + +} + +@encoding() { + + @format 35c | pool_meth + +} diff --git a/plugins/dalvik/v35/opdefs/invoke_71.d b/plugins/dalvik/v35/opdefs/invoke_71.d new file mode 100644 index 0000000..b21eca3 --- /dev/null +++ b/plugins/dalvik/v35/opdefs/invoke_71.d @@ -0,0 +1,52 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title invoke-static + +@id 113 + +@desc { + + Call the indicated method. The result (if any) may be stored with an appropriate <b>move-result*</b> variant as the immediately subsequent instruction. + +<b>invoke-virtual</b> is used to invoke a normal virtual method (a method that is not <b>private</b>, <b>static</b>, or <b>final</b>, and is also not a constructor). + +When the <b>method_id</b> references a method of a non-interface class, <b>invoke-super</b> is used to invoke the closest superclass's virtual method (as opposed to the one with the same <b>method_id</b> in the calling class). The same method restrictions hold as for <b>invoke-virtual</b>. + +In Dex files version <b>037</b> or later, if the <b>method_id</b> refers to an interface method, <b>invoke-super</b> is used to invoke the most specific, non-overridden version of that method defined on that interface. The same method restrictions hold as for <b>invoke-virtual</b>. In Dex files prior to version <b>037</b>, having an interface <b>method_id</b> is illegal and undefined. + +<b>invoke-direct</b> is used to invoke a non-<b>static</b> direct method (that is, an instance method that is by its nature non-overridable, namely either a <b>private</b> instance method or a constructor). + +<b>invoke-static</b> is used to invoke a <b>static</b> method (which is always considered a direct method). + +<b>invoke-interface</b> is used to invoke an <b>interface</b> method, that is, on an object whose concrete class isn't known, using a <b>method_id</b> that refers to an <b>interface</b>. + +<b>Note:</b> These opbs are reasonable candidates for static linking, altering the method argument to be a more direct offset (or pair thereof). + +} + +@encoding() { + + @format 35c | pool_meth + +} diff --git a/plugins/dalvik/v35/opdefs/invoke_72.d b/plugins/dalvik/v35/opdefs/invoke_72.d new file mode 100644 index 0000000..74cca2b --- /dev/null +++ b/plugins/dalvik/v35/opdefs/invoke_72.d @@ -0,0 +1,52 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title invoke-interface + +@id 114 + +@desc { + + Call the indicated method. The result (if any) may be stored with an appropriate <b>move-result*</b> variant as the immediately subsequent instruction. + +<b>invoke-virtual</b> is used to invoke a normal virtual method (a method that is not <b>private</b>, <b>static</b>, or <b>final</b>, and is also not a constructor). + +When the <b>method_id</b> references a method of a non-interface class, <b>invoke-super</b> is used to invoke the closest superclass's virtual method (as opposed to the one with the same <b>method_id</b> in the calling class). The same method restrictions hold as for <b>invoke-virtual</b>. + +In Dex files version <b>037</b> or later, if the <b>method_id</b> refers to an interface method, <b>invoke-super</b> is used to invoke the most specific, non-overridden version of that method defined on that interface. The same method restrictions hold as for <b>invoke-virtual</b>. In Dex files prior to version <b>037</b>, having an interface <b>method_id</b> is illegal and undefined. + +<b>invoke-direct</b> is used to invoke a non-<b>static</b> direct method (that is, an instance method that is by its nature non-overridable, namely either a <b>private</b> instance method or a constructor). + +<b>invoke-static</b> is used to invoke a <b>static</b> method (which is always considered a direct method). + +<b>invoke-interface</b> is used to invoke an <b>interface</b> method, that is, on an object whose concrete class isn't known, using a <b>method_id</b> that refers to an <b>interface</b>. + +<b>Note:</b> These opbs are reasonable candidates for static linking, altering the method argument to be a more direct offset (or pair thereof). + +} + +@encoding() { + + @format 35c | pool_meth + +} diff --git a/plugins/dalvik/opdefs/invoke_74.d b/plugins/dalvik/v35/opdefs/invoke_74.d index 77b68de..e8275fc 100644 --- a/plugins/dalvik/opdefs/invoke_74.d +++ b/plugins/dalvik/v35/opdefs/invoke_74.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title invoke-virtual/range +@id 116 + +@desc { + + Call the indicated method. See first <b>invoke-<i>kind</i></b> description above for details, caveats, and suggestions. + +} + @encoding() { @format 3rc | pool_meth diff --git a/plugins/dalvik/opdefs/invoke_75.d b/plugins/dalvik/v35/opdefs/invoke_75.d index e886dad..5802f05 100644 --- a/plugins/dalvik/opdefs/invoke_75.d +++ b/plugins/dalvik/v35/opdefs/invoke_75.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title invoke-super/range +@id 117 + +@desc { + + Call the indicated method. See first <b>invoke-<i>kind</i></b> description above for details, caveats, and suggestions. + +} + @encoding() { @format 3rc | pool_meth diff --git a/plugins/dalvik/opdefs/invoke_76.d b/plugins/dalvik/v35/opdefs/invoke_76.d index 8156689..ac1a7b0 100644 --- a/plugins/dalvik/opdefs/invoke_76.d +++ b/plugins/dalvik/v35/opdefs/invoke_76.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title invoke-direct/range +@id 118 + +@desc { + + Call the indicated method. See first <b>invoke-<i>kind</i></b> description above for details, caveats, and suggestions. + +} + @encoding() { @format 3rc | pool_meth diff --git a/plugins/dalvik/opdefs/invoke_77.d b/plugins/dalvik/v35/opdefs/invoke_77.d index b5707e2..64d6075 100644 --- a/plugins/dalvik/opdefs/invoke_77.d +++ b/plugins/dalvik/v35/opdefs/invoke_77.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title invoke-static/range +@id 119 + +@desc { + + Call the indicated method. See first <b>invoke-<i>kind</i></b> description above for details, caveats, and suggestions. + +} + @encoding() { @format 3rc | pool_meth diff --git a/plugins/dalvik/opdefs/invoke_78.d b/plugins/dalvik/v35/opdefs/invoke_78.d index 5589b38..f3e8839 100644 --- a/plugins/dalvik/opdefs/invoke_78.d +++ b/plugins/dalvik/v35/opdefs/invoke_78.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title invoke-interface/range +@id 120 + +@desc { + + Call the indicated method. See first <b>invoke-<i>kind</i></b> description above for details, caveats, and suggestions. + +} + @encoding() { @format 3rc | pool_meth diff --git a/plugins/dalvik/opdefs/iput_59.d b/plugins/dalvik/v35/opdefs/iput_59.d index fd17db4..b11da8b 100644 --- a/plugins/dalvik/opdefs/iput_59.d +++ b/plugins/dalvik/v35/opdefs/iput_59.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title iput +@id 89 + +@desc { + + Perform the identified object instance field operation with the identified field, loading or storing into the value register. + +<b>Note:</b> These opbs are reasonable candidates for static linking, altering the field argument to be a more direct offset. + +} + @encoding() { @format 22c | pool_field diff --git a/plugins/dalvik/opdefs/iput_5a.d b/plugins/dalvik/v35/opdefs/iput_5a.d index 509868c..f2e8311 100644 --- a/plugins/dalvik/opdefs/iput_5a.d +++ b/plugins/dalvik/v35/opdefs/iput_5a.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title iput-wide +@id 90 + +@desc { + + Perform the identified object instance field operation with the identified field, loading or storing into the value register. + +<b>Note:</b> These opbs are reasonable candidates for static linking, altering the field argument to be a more direct offset. + +} + @encoding() { @format 22c | pool_field diff --git a/plugins/dalvik/opdefs/iput_5b.d b/plugins/dalvik/v35/opdefs/iput_5b.d index 9ad7500..631892c 100644 --- a/plugins/dalvik/opdefs/iput_5b.d +++ b/plugins/dalvik/v35/opdefs/iput_5b.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title iput-object +@id 91 + +@desc { + + Perform the identified object instance field operation with the identified field, loading or storing into the value register. + +<b>Note:</b> These opbs are reasonable candidates for static linking, altering the field argument to be a more direct offset. + +} + @encoding() { @format 22c | pool_field diff --git a/plugins/dalvik/opdefs/iput_5c.d b/plugins/dalvik/v35/opdefs/iput_5c.d index 9ae86fa..8cc1fb6 100644 --- a/plugins/dalvik/opdefs/iput_5c.d +++ b/plugins/dalvik/v35/opdefs/iput_5c.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title iput-boolean +@id 92 + +@desc { + + Perform the identified object instance field operation with the identified field, loading or storing into the value register. + +<b>Note:</b> These opbs are reasonable candidates for static linking, altering the field argument to be a more direct offset. + +} + @encoding() { @format 22c | pool_field diff --git a/plugins/dalvik/opdefs/iput_5d.d b/plugins/dalvik/v35/opdefs/iput_5d.d index 8a3830e..93edb58 100644 --- a/plugins/dalvik/opdefs/iput_5d.d +++ b/plugins/dalvik/v35/opdefs/iput_5d.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title iput-byte +@id 93 + +@desc { + + Perform the identified object instance field operation with the identified field, loading or storing into the value register. + +<b>Note:</b> These opbs are reasonable candidates for static linking, altering the field argument to be a more direct offset. + +} + @encoding() { @format 22c | pool_field diff --git a/plugins/dalvik/opdefs/iput_5e.d b/plugins/dalvik/v35/opdefs/iput_5e.d index 5120675..48cb4f6 100644 --- a/plugins/dalvik/opdefs/iput_5e.d +++ b/plugins/dalvik/v35/opdefs/iput_5e.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title iput-char +@id 94 + +@desc { + + Perform the identified object instance field operation with the identified field, loading or storing into the value register. + +<b>Note:</b> These opbs are reasonable candidates for static linking, altering the field argument to be a more direct offset. + +} + @encoding() { @format 22c | pool_field diff --git a/plugins/dalvik/opdefs/iput_5f.d b/plugins/dalvik/v35/opdefs/iput_5f.d index 7fe2d80..9bbd72a 100644 --- a/plugins/dalvik/opdefs/iput_5f.d +++ b/plugins/dalvik/v35/opdefs/iput_5f.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title iput-short +@id 95 + +@desc { + + Perform the identified object instance field operation with the identified field, loading or storing into the value register. + +<b>Note:</b> These opbs are reasonable candidates for static linking, altering the field argument to be a more direct offset. + +} + @encoding() { @format 22c | pool_field diff --git a/plugins/dalvik/opdefs/monitor_1d.d b/plugins/dalvik/v35/opdefs/monitor_1d.d index ab7ce5f..101ffad 100644 --- a/plugins/dalvik/opdefs/monitor_1d.d +++ b/plugins/dalvik/v35/opdefs/monitor_1d.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title monitor-enter +@id 29 + +@desc { + + Acquire the monitor for the indicated object. + +} + @encoding() { @format 11x diff --git a/plugins/dalvik/opdefs/monitor_1e.d b/plugins/dalvik/v35/opdefs/monitor_1e.d index b5b0d20..b54af35 100644 --- a/plugins/dalvik/opdefs/monitor_1e.d +++ b/plugins/dalvik/v35/opdefs/monitor_1e.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title monitor-exit +@id 30 + +@desc { + + Release the monitor for the indicated object. + +<b>Note:</b> If this instruction needs to throw an exception, it must do so as if the pc has already advanced past the instruction. It may be useful to think of this as the instruction successfully executing (in a sense), and the exception getting thrown <i>after</i> the instruction but <i>before</i> the next one gets a chance to run. This definition makes it possible for a method to use a monitor cleanup catch-all (e.g., <b>finally</b>) block as the monitor cleanup for that block itself, as a way to handle the arbitrary exceptions that might get thrown due to the historical implementation of <b>Thread.stop()</b>, while still managing to have proper monitor hygiene. + +} + @encoding() { @format 11x diff --git a/plugins/dalvik/opdefs/move_01.d b/plugins/dalvik/v35/opdefs/move_01.d index caa2a85..788a359 100644 --- a/plugins/dalvik/opdefs/move_01.d +++ b/plugins/dalvik/v35/opdefs/move_01.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title move +@id 1 + +@desc { + + Move the contents of one non-object register to another. + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/move_02.d b/plugins/dalvik/v35/opdefs/move_02.d index c8b96bd..8453561 100644 --- a/plugins/dalvik/opdefs/move_02.d +++ b/plugins/dalvik/v35/opdefs/move_02.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title move/from16 +@id 2 + +@desc { + + Move the contents of one non-object register to another. + +} + @encoding() { @format 22x diff --git a/plugins/dalvik/opdefs/move_03.d b/plugins/dalvik/v35/opdefs/move_03.d index 6957de7..a665ccd 100644 --- a/plugins/dalvik/opdefs/move_03.d +++ b/plugins/dalvik/v35/opdefs/move_03.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title move/16 +@id 3 + +@desc { + + Move the contents of one non-object register to another. + +} + @encoding() { @format 32x diff --git a/plugins/dalvik/opdefs/move_04.d b/plugins/dalvik/v35/opdefs/move_04.d index 57196cc..d4f9395 100644 --- a/plugins/dalvik/opdefs/move_04.d +++ b/plugins/dalvik/v35/opdefs/move_04.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title move-wide +@id 4 + +@desc { + + Move the contents of one register-pair to another. + +<b>Note:</b> It is legal to move from <b>v<i>N</i></b> to either <b>v<i>N-1</i></b> or <b>v<i>N+1</i></b>, so implementations must arrange for both halves of a register pair to be read before anything is written. + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/move_05.d b/plugins/dalvik/v35/opdefs/move_05.d index 2b974bb..36b276c 100644 --- a/plugins/dalvik/opdefs/move_05.d +++ b/plugins/dalvik/v35/opdefs/move_05.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title move-wide/from16 +@id 5 + +@desc { + + Move the contents of one register-pair to another. + +<b>Note:</b> Implementation considerations are the same as <b>move-wide</b>, above. + +} + @encoding() { @format 22x diff --git a/plugins/dalvik/opdefs/move_06.d b/plugins/dalvik/v35/opdefs/move_06.d index 4acaf62..2b40adb 100644 --- a/plugins/dalvik/opdefs/move_06.d +++ b/plugins/dalvik/v35/opdefs/move_06.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title move-wide/16 +@id 6 + +@desc { + + Move the contents of one register-pair to another. + +<b>Note:</b> Implementation considerations are the same as <b>move-wide</b>, above. + +} + @encoding() { @format 32x diff --git a/plugins/dalvik/opdefs/move_07.d b/plugins/dalvik/v35/opdefs/move_07.d index cde3102..8d982e5 100644 --- a/plugins/dalvik/opdefs/move_07.d +++ b/plugins/dalvik/v35/opdefs/move_07.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title move-object +@id 7 + +@desc { + + Move the contents of one object-bearing register to another. + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/move_08.d b/plugins/dalvik/v35/opdefs/move_08.d index aba0cad..d58d356 100644 --- a/plugins/dalvik/opdefs/move_08.d +++ b/plugins/dalvik/v35/opdefs/move_08.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title move-object/from16 +@id 8 + +@desc { + + Move the contents of one object-bearing register to another. + +} + @encoding() { @format 22x diff --git a/plugins/dalvik/opdefs/move_09.d b/plugins/dalvik/v35/opdefs/move_09.d index 3bf6a65..520c03e 100644 --- a/plugins/dalvik/opdefs/move_09.d +++ b/plugins/dalvik/v35/opdefs/move_09.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title move-object/16 +@id 9 + +@desc { + + Move the contents of one object-bearing register to another. + +} + @encoding() { @format 32x diff --git a/plugins/dalvik/opdefs/move_0a.d b/plugins/dalvik/v35/opdefs/move_0a.d index b6a185a..250b8fc 100644 --- a/plugins/dalvik/opdefs/move_0a.d +++ b/plugins/dalvik/v35/opdefs/move_0a.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title move-result +@id 10 + +@desc { + + Move the single-word non-object result of the most recent <b>invoke-<i>kind</i></b> into the indicated register. This must be done as the instruction immediately after an <b>invoke-<i>kind</i></b> whose (single-word, non-object) result is not to be ignored; anywhere else is invalid. + +} + @encoding() { @format 11x diff --git a/plugins/dalvik/opdefs/move_0b.d b/plugins/dalvik/v35/opdefs/move_0b.d index d266cb8..35b6270 100644 --- a/plugins/dalvik/opdefs/move_0b.d +++ b/plugins/dalvik/v35/opdefs/move_0b.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title move-result-wide +@id 11 + +@desc { + + Move the double-word result of the most recent <b>invoke-<i>kind</i></b> into the indicated register pair. This must be done as the instruction immediately after an <b>invoke-<i>kind</i></b> whose (double-word) result is not to be ignored; anywhere else is invalid. + +} + @encoding() { @format 11x diff --git a/plugins/dalvik/opdefs/move_0c.d b/plugins/dalvik/v35/opdefs/move_0c.d index 8e6f67f..4109578 100644 --- a/plugins/dalvik/opdefs/move_0c.d +++ b/plugins/dalvik/v35/opdefs/move_0c.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title move-result-object +@id 12 + +@desc { + + Move the object result of the most recent <b>invoke-<i>kind</i></b> into the indicated register. This must be done as the instruction immediately after an <b>invoke-<i>kind</i></b> or <b>filled-new-array</b> whose (object) result is not to be ignored; anywhere else is invalid. + +} + @encoding() { @format 11x diff --git a/plugins/dalvik/opdefs/move_0d.d b/plugins/dalvik/v35/opdefs/move_0d.d index f442006..155e585 100644 --- a/plugins/dalvik/opdefs/move_0d.d +++ b/plugins/dalvik/v35/opdefs/move_0d.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title move-exception +@id 13 + +@desc { + + Save a just-caught exception into the given register. This must be the first instruction of any exception handler whose caught exception is not to be ignored, and this instruction must <i>only</i> ever occur as the first instruction of an exception handler; anywhere else is invalid. + +} + @encoding() { @format 11x diff --git a/plugins/dalvik/opdefs/mul_92.d b/plugins/dalvik/v35/opdefs/mul_92.d index 83b5cac..7de6f1a 100644 --- a/plugins/dalvik/opdefs/mul_92.d +++ b/plugins/dalvik/v35/opdefs/mul_92.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title mul-int +@id 146 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the destination register. + +<b>Note:</b> Contrary to other <b>-long</b> mathematical operations (which take register pairs for both their first and their second source), <b>shl-long</b>, <b>shr-long</b>, and <b>ushr-long</b> take a register pair for their first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/mul_9d.d b/plugins/dalvik/v35/opdefs/mul_9d.d index ecc216d..0f62e22 100644 --- a/plugins/dalvik/opdefs/mul_9d.d +++ b/plugins/dalvik/v35/opdefs/mul_9d.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title mul-long +@id 157 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the destination register. + +<b>Note:</b> Contrary to other <b>-long</b> mathematical operations (which take register pairs for both their first and their second source), <b>shl-long</b>, <b>shr-long</b>, and <b>ushr-long</b> take a register pair for their first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/mul_a8.d b/plugins/dalvik/v35/opdefs/mul_a8.d index 63e51e5..0a77ac1 100644 --- a/plugins/dalvik/opdefs/mul_a8.d +++ b/plugins/dalvik/v35/opdefs/mul_a8.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title mul-float +@id 168 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the destination register. + +<b>Note:</b> Contrary to other <b>-long</b> mathematical operations (which take register pairs for both their first and their second source), <b>shl-long</b>, <b>shr-long</b>, and <b>ushr-long</b> take a register pair for their first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/mul_ad.d b/plugins/dalvik/v35/opdefs/mul_ad.d index 17f950c..8f43825 100644 --- a/plugins/dalvik/opdefs/mul_ad.d +++ b/plugins/dalvik/v35/opdefs/mul_ad.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title mul-double +@id 173 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the destination register. + +<b>Note:</b> Contrary to other <b>-long</b> mathematical operations (which take register pairs for both their first and their second source), <b>shl-long</b>, <b>shr-long</b>, and <b>ushr-long</b> take a register pair for their first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/mul_b2.d b/plugins/dalvik/v35/opdefs/mul_b2.d index a7b917c..b82d948 100644 --- a/plugins/dalvik/opdefs/mul_b2.d +++ b/plugins/dalvik/v35/opdefs/mul_b2.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title mul-int/2addr +@id 178 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the first source register. + +<b>Note:</b> Contrary to other <b>-long/2addr</b> mathematical operations (which take register pairs for both their destination/first source and their second source), <b>shl-long/2addr</b>, <b>shr-long/2addr</b>, and <b>ushr-long/2addr</b> take a register pair for their destination/first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/mul_bd.d b/plugins/dalvik/v35/opdefs/mul_bd.d index 8ce23b1..622dd61 100644 --- a/plugins/dalvik/opdefs/mul_bd.d +++ b/plugins/dalvik/v35/opdefs/mul_bd.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title mul-long/2addr +@id 189 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the first source register. + +<b>Note:</b> Contrary to other <b>-long/2addr</b> mathematical operations (which take register pairs for both their destination/first source and their second source), <b>shl-long/2addr</b>, <b>shr-long/2addr</b>, and <b>ushr-long/2addr</b> take a register pair for their destination/first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/mul_c8.d b/plugins/dalvik/v35/opdefs/mul_c8.d index 1d17cc1..04a1ac1 100644 --- a/plugins/dalvik/opdefs/mul_c8.d +++ b/plugins/dalvik/v35/opdefs/mul_c8.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title mul-float/2addr +@id 200 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the first source register. + +<b>Note:</b> Contrary to other <b>-long/2addr</b> mathematical operations (which take register pairs for both their destination/first source and their second source), <b>shl-long/2addr</b>, <b>shr-long/2addr</b>, and <b>ushr-long/2addr</b> take a register pair for their destination/first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/mul_cd.d b/plugins/dalvik/v35/opdefs/mul_cd.d index 1816780..3622c1a 100644 --- a/plugins/dalvik/opdefs/mul_cd.d +++ b/plugins/dalvik/v35/opdefs/mul_cd.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title mul-double/2addr +@id 205 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the first source register. + +<b>Note:</b> Contrary to other <b>-long/2addr</b> mathematical operations (which take register pairs for both their destination/first source and their second source), <b>shl-long/2addr</b>, <b>shr-long/2addr</b>, and <b>ushr-long/2addr</b> take a register pair for their destination/first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/mul_d2.d b/plugins/dalvik/v35/opdefs/mul_d2.d index 998ecd7..b7f44a0 100644 --- a/plugins/dalvik/opdefs/mul_d2.d +++ b/plugins/dalvik/v35/opdefs/mul_d2.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title mul-int/lit16 +@id 210 + +@desc { + + Perform the indicated binary op on the indicated register (first argument) and literal value (second argument), storing the result in the destination register. + +<b>Note:</b> <b>rsub-int</b> does not have a suffix since this version is the main opb of its family. Also, see below for details on its semantics. + +} + @encoding() { @format 22s diff --git a/plugins/dalvik/opdefs/mul_da.d b/plugins/dalvik/v35/opdefs/mul_da.d index 4c1a264..ac7fba2 100644 --- a/plugins/dalvik/opdefs/mul_da.d +++ b/plugins/dalvik/v35/opdefs/mul_da.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title mul-int/lit8 +@id 218 + +@desc { + + Perform the indicated binary op on the indicated register (first argument) and literal value (second argument), storing the result in the destination register. + +<b>Note:</b> See below for details on the semantics of <b>rsub-int</b>. + +} + @encoding() { @format 22b diff --git a/plugins/dalvik/opdefs/neg_7b.d b/plugins/dalvik/v35/opdefs/neg_7b.d index c8ec7df..1e518e2 100644 --- a/plugins/dalvik/opdefs/neg_7b.d +++ b/plugins/dalvik/v35/opdefs/neg_7b.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title neg-int +@id 123 + +@desc { + + Perform the identified unary operation on the source register, storing the result in the destination register. + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/neg_7d.d b/plugins/dalvik/v35/opdefs/neg_7d.d index 3d442c3..370aa5f 100644 --- a/plugins/dalvik/opdefs/neg_7d.d +++ b/plugins/dalvik/v35/opdefs/neg_7d.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title neg-long +@id 125 + +@desc { + + Perform the identified unary operation on the source register, storing the result in the destination register. + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/neg_7f.d b/plugins/dalvik/v35/opdefs/neg_7f.d index d30ede6..39b8dcd 100644 --- a/plugins/dalvik/opdefs/neg_7f.d +++ b/plugins/dalvik/v35/opdefs/neg_7f.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title neg-float +@id 127 + +@desc { + + Perform the identified unary operation on the source register, storing the result in the destination register. + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/neg_80.d b/plugins/dalvik/v35/opdefs/neg_80.d index 49d6bdd..e0faa70 100644 --- a/plugins/dalvik/opdefs/neg_80.d +++ b/plugins/dalvik/v35/opdefs/neg_80.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title neg-double +@id 128 + +@desc { + + Perform the identified unary operation on the source register, storing the result in the destination register. + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/new_22.d b/plugins/dalvik/v35/opdefs/new_22.d index 4af913c..f23307f 100644 --- a/plugins/dalvik/opdefs/new_22.d +++ b/plugins/dalvik/v35/opdefs/new_22.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title new-instance +@id 34 + +@desc { + + Construct a new instance of the indicated type, storing a reference to it in the destination. The type must refer to a non-array class. + +} + @encoding() { @format 21c | pool_type diff --git a/plugins/dalvik/opdefs/new_23.d b/plugins/dalvik/v35/opdefs/new_23.d index 0a6a863..7639e2c 100644 --- a/plugins/dalvik/opdefs/new_23.d +++ b/plugins/dalvik/v35/opdefs/new_23.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title new-array +@id 35 + +@desc { + + Construct a new array of the indicated type and size. The type must be an array type. + +} + @encoding() { @format 22c | pool_type diff --git a/plugins/dalvik/v35/opdefs/nop_00.d b/plugins/dalvik/v35/opdefs/nop_00.d new file mode 100644 index 0000000..b48d883 --- /dev/null +++ b/plugins/dalvik/v35/opdefs/nop_00.d @@ -0,0 +1,40 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title nop + +@id 0 + +@desc { + + Waste cycles. + +<b>Note:</b> Data-bearing pseudo-instructions are tagged with this opb, in which case the high-order byte of the opb unit indicates the nature of the data. See "<b>packed-switch-payload</b> Format", "<b>sparse-switch-payload</b> Format", and "<b>fill-array-data-payload</b> Format" below. + +} + +@encoding() { + + @format 10x + +} diff --git a/plugins/dalvik/opdefs/not_7c.d b/plugins/dalvik/v35/opdefs/not_7c.d index d52ad8c..395dcb1 100644 --- a/plugins/dalvik/opdefs/not_7c.d +++ b/plugins/dalvik/v35/opdefs/not_7c.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title not-int +@id 124 + +@desc { + + Perform the identified unary operation on the source register, storing the result in the destination register. + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/not_7e.d b/plugins/dalvik/v35/opdefs/not_7e.d index 4291d7a..0a50102 100644 --- a/plugins/dalvik/opdefs/not_7e.d +++ b/plugins/dalvik/v35/opdefs/not_7e.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title not-long +@id 126 + +@desc { + + Perform the identified unary operation on the source register, storing the result in the destination register. + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/or_96.d b/plugins/dalvik/v35/opdefs/or_96.d index 62f24a5..cbdfd0b 100644 --- a/plugins/dalvik/opdefs/or_96.d +++ b/plugins/dalvik/v35/opdefs/or_96.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title or-int +@id 150 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the destination register. + +<b>Note:</b> Contrary to other <b>-long</b> mathematical operations (which take register pairs for both their first and their second source), <b>shl-long</b>, <b>shr-long</b>, and <b>ushr-long</b> take a register pair for their first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/or_a1.d b/plugins/dalvik/v35/opdefs/or_a1.d index 2867a81..b5ec103 100644 --- a/plugins/dalvik/opdefs/or_a1.d +++ b/plugins/dalvik/v35/opdefs/or_a1.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title or-long +@id 161 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the destination register. + +<b>Note:</b> Contrary to other <b>-long</b> mathematical operations (which take register pairs for both their first and their second source), <b>shl-long</b>, <b>shr-long</b>, and <b>ushr-long</b> take a register pair for their first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/or_b6.d b/plugins/dalvik/v35/opdefs/or_b6.d index 3d56801..8dd878a 100644 --- a/plugins/dalvik/opdefs/or_b6.d +++ b/plugins/dalvik/v35/opdefs/or_b6.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title or-int/2addr +@id 182 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the first source register. + +<b>Note:</b> Contrary to other <b>-long/2addr</b> mathematical operations (which take register pairs for both their destination/first source and their second source), <b>shl-long/2addr</b>, <b>shr-long/2addr</b>, and <b>ushr-long/2addr</b> take a register pair for their destination/first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/or_c1.d b/plugins/dalvik/v35/opdefs/or_c1.d index 8d13da3..d7224a4 100644 --- a/plugins/dalvik/opdefs/or_c1.d +++ b/plugins/dalvik/v35/opdefs/or_c1.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title or-long/2addr +@id 193 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the first source register. + +<b>Note:</b> Contrary to other <b>-long/2addr</b> mathematical operations (which take register pairs for both their destination/first source and their second source), <b>shl-long/2addr</b>, <b>shr-long/2addr</b>, and <b>ushr-long/2addr</b> take a register pair for their destination/first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/or_d6.d b/plugins/dalvik/v35/opdefs/or_d6.d index 71766a3..3543093 100644 --- a/plugins/dalvik/opdefs/or_d6.d +++ b/plugins/dalvik/v35/opdefs/or_d6.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title or-int/lit16 +@id 214 + +@desc { + + Perform the indicated binary op on the indicated register (first argument) and literal value (second argument), storing the result in the destination register. + +<b>Note:</b> <b>rsub-int</b> does not have a suffix since this version is the main opb of its family. Also, see below for details on its semantics. + +} + @encoding() { @format 22s diff --git a/plugins/dalvik/opdefs/or_de.d b/plugins/dalvik/v35/opdefs/or_de.d index 1c293a5..582ed6a 100644 --- a/plugins/dalvik/opdefs/or_de.d +++ b/plugins/dalvik/v35/opdefs/or_de.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title or-int/lit8 +@id 222 + +@desc { + + Perform the indicated binary op on the indicated register (first argument) and literal value (second argument), storing the result in the destination register. + +<b>Note:</b> See below for details on the semantics of <b>rsub-int</b>. + +} + @encoding() { @format 22b diff --git a/plugins/dalvik/opdefs/rem_94.d b/plugins/dalvik/v35/opdefs/rem_94.d index 9238d14..54aeaa6 100644 --- a/plugins/dalvik/opdefs/rem_94.d +++ b/plugins/dalvik/v35/opdefs/rem_94.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title rem-int +@id 148 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the destination register. + +<b>Note:</b> Contrary to other <b>-long</b> mathematical operations (which take register pairs for both their first and their second source), <b>shl-long</b>, <b>shr-long</b>, and <b>ushr-long</b> take a register pair for their first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/rem_9f.d b/plugins/dalvik/v35/opdefs/rem_9f.d index 6aef568..1fe7291 100644 --- a/plugins/dalvik/opdefs/rem_9f.d +++ b/plugins/dalvik/v35/opdefs/rem_9f.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title rem-long +@id 159 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the destination register. + +<b>Note:</b> Contrary to other <b>-long</b> mathematical operations (which take register pairs for both their first and their second source), <b>shl-long</b>, <b>shr-long</b>, and <b>ushr-long</b> take a register pair for their first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/rem_aa.d b/plugins/dalvik/v35/opdefs/rem_aa.d index 71a0d8b..54f6f08 100644 --- a/plugins/dalvik/opdefs/rem_aa.d +++ b/plugins/dalvik/v35/opdefs/rem_aa.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title rem-float +@id 170 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the destination register. + +<b>Note:</b> Contrary to other <b>-long</b> mathematical operations (which take register pairs for both their first and their second source), <b>shl-long</b>, <b>shr-long</b>, and <b>ushr-long</b> take a register pair for their first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/rem_af.d b/plugins/dalvik/v35/opdefs/rem_af.d index dc092a1..8441dad 100644 --- a/plugins/dalvik/opdefs/rem_af.d +++ b/plugins/dalvik/v35/opdefs/rem_af.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title rem-double +@id 175 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the destination register. + +<b>Note:</b> Contrary to other <b>-long</b> mathematical operations (which take register pairs for both their first and their second source), <b>shl-long</b>, <b>shr-long</b>, and <b>ushr-long</b> take a register pair for their first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/rem_b4.d b/plugins/dalvik/v35/opdefs/rem_b4.d index fada523..8c904c7 100644 --- a/plugins/dalvik/opdefs/rem_b4.d +++ b/plugins/dalvik/v35/opdefs/rem_b4.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title rem-int/2addr +@id 180 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the first source register. + +<b>Note:</b> Contrary to other <b>-long/2addr</b> mathematical operations (which take register pairs for both their destination/first source and their second source), <b>shl-long/2addr</b>, <b>shr-long/2addr</b>, and <b>ushr-long/2addr</b> take a register pair for their destination/first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/rem_bf.d b/plugins/dalvik/v35/opdefs/rem_bf.d index b6b0997..85863b9 100644 --- a/plugins/dalvik/opdefs/rem_bf.d +++ b/plugins/dalvik/v35/opdefs/rem_bf.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title rem-long/2addr +@id 191 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the first source register. + +<b>Note:</b> Contrary to other <b>-long/2addr</b> mathematical operations (which take register pairs for both their destination/first source and their second source), <b>shl-long/2addr</b>, <b>shr-long/2addr</b>, and <b>ushr-long/2addr</b> take a register pair for their destination/first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/rem_ca.d b/plugins/dalvik/v35/opdefs/rem_ca.d index 3c6d287..6d69082 100644 --- a/plugins/dalvik/opdefs/rem_ca.d +++ b/plugins/dalvik/v35/opdefs/rem_ca.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title rem-float/2addr +@id 202 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the first source register. + +<b>Note:</b> Contrary to other <b>-long/2addr</b> mathematical operations (which take register pairs for both their destination/first source and their second source), <b>shl-long/2addr</b>, <b>shr-long/2addr</b>, and <b>ushr-long/2addr</b> take a register pair for their destination/first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/rem_cf.d b/plugins/dalvik/v35/opdefs/rem_cf.d index 1881502..502baad 100644 --- a/plugins/dalvik/opdefs/rem_cf.d +++ b/plugins/dalvik/v35/opdefs/rem_cf.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title rem-double/2addr +@id 207 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the first source register. + +<b>Note:</b> Contrary to other <b>-long/2addr</b> mathematical operations (which take register pairs for both their destination/first source and their second source), <b>shl-long/2addr</b>, <b>shr-long/2addr</b>, and <b>ushr-long/2addr</b> take a register pair for their destination/first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/rem_d4.d b/plugins/dalvik/v35/opdefs/rem_d4.d index 84d12b8..faf7390 100644 --- a/plugins/dalvik/opdefs/rem_d4.d +++ b/plugins/dalvik/v35/opdefs/rem_d4.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title rem-int/lit16 +@id 212 + +@desc { + + Perform the indicated binary op on the indicated register (first argument) and literal value (second argument), storing the result in the destination register. + +<b>Note:</b> <b>rsub-int</b> does not have a suffix since this version is the main opb of its family. Also, see below for details on its semantics. + +} + @encoding() { @format 22s diff --git a/plugins/dalvik/opdefs/rem_dc.d b/plugins/dalvik/v35/opdefs/rem_dc.d index f70f9e9..a19c7df 100644 --- a/plugins/dalvik/opdefs/rem_dc.d +++ b/plugins/dalvik/v35/opdefs/rem_dc.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title rem-int/lit8 +@id 220 + +@desc { + + Perform the indicated binary op on the indicated register (first argument) and literal value (second argument), storing the result in the destination register. + +<b>Note:</b> See below for details on the semantics of <b>rsub-int</b>. + +} + @encoding() { @format 22b diff --git a/plugins/dalvik/opdefs/return_0e.d b/plugins/dalvik/v35/opdefs/return_0e.d index 98fa1a8..7c42cb7 100644 --- a/plugins/dalvik/opdefs/return_0e.d +++ b/plugins/dalvik/v35/opdefs/return_0e.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,13 +23,25 @@ @title return-void +@id 14 + +@desc { + + Return from a <b>void</b> method. + +} + @encoding() { @format 10x - @rules { + @syntax { + + @rules { + + call g_arch_instruction_set_flag(AIF_RETURN_POINT) - call SetInsFlag(AIF_RETURN_POINT) + } } diff --git a/plugins/dalvik/opdefs/return_0f.d b/plugins/dalvik/v35/opdefs/return_0f.d index 7e681ae..2051443 100644 --- a/plugins/dalvik/opdefs/return_0f.d +++ b/plugins/dalvik/v35/opdefs/return_0f.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,13 +23,25 @@ @title return +@id 15 + +@desc { + + Return from a single-width (32-bit) non-object value-returning method. + +} + @encoding() { @format 11x - @rules { + @syntax { + + @rules { + + call g_arch_instruction_set_flag(AIF_RETURN_POINT) - call SetInsFlag(AIF_RETURN_POINT) + } } diff --git a/plugins/dalvik/opdefs/return_10.d b/plugins/dalvik/v35/opdefs/return_10.d index 644760c..7cf1ce3 100644 --- a/plugins/dalvik/opdefs/return_10.d +++ b/plugins/dalvik/v35/opdefs/return_10.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,13 +23,25 @@ @title return-wide +@id 16 + +@desc { + + Return from a double-width (64-bit) value-returning method. + +} + @encoding() { @format 11x - @rules { + @syntax { + + @rules { + + call g_arch_instruction_set_flag(AIF_RETURN_POINT) - call SetInsFlag(AIF_RETURN_POINT) + } } diff --git a/plugins/dalvik/opdefs/return_11.d b/plugins/dalvik/v35/opdefs/return_11.d index b8e4e60..4023de7 100644 --- a/plugins/dalvik/opdefs/return_11.d +++ b/plugins/dalvik/v35/opdefs/return_11.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,13 +23,25 @@ @title return-object +@id 17 + +@desc { + + Return from an object-returning method. + +} + @encoding() { @format 11x - @rules { + @syntax { + + @rules { + + call g_arch_instruction_set_flag(AIF_RETURN_POINT) - call SetInsFlag(AIF_RETURN_POINT) + } } diff --git a/plugins/dalvik/opdefs/rsub_d1.d b/plugins/dalvik/v35/opdefs/rsub_d1.d index 0d05c84..4385967 100644 --- a/plugins/dalvik/opdefs/rsub_d1.d +++ b/plugins/dalvik/v35/opdefs/rsub_d1.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title rsub-int +@id 209 + +@desc { + + Perform the indicated binary op on the indicated register (first argument) and literal value (second argument), storing the result in the destination register. + +<b>Note:</b> <b>rsub-int</b> does not have a suffix since this version is the main opb of its family. Also, see below for details on its semantics. + +} + @encoding() { @format 22s diff --git a/plugins/dalvik/opdefs/rsub_d9.d b/plugins/dalvik/v35/opdefs/rsub_d9.d index 0f2f656..890846c 100644 --- a/plugins/dalvik/opdefs/rsub_d9.d +++ b/plugins/dalvik/v35/opdefs/rsub_d9.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title rsub-int/lit8 +@id 217 + +@desc { + + Perform the indicated binary op on the indicated register (first argument) and literal value (second argument), storing the result in the destination register. + +<b>Note:</b> See below for details on the semantics of <b>rsub-int</b>. + +} + @encoding() { @format 22b diff --git a/plugins/dalvik/opdefs/sget_60.d b/plugins/dalvik/v35/opdefs/sget_60.d index 90090a2..e017ff8 100644 --- a/plugins/dalvik/opdefs/sget_60.d +++ b/plugins/dalvik/v35/opdefs/sget_60.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title sget +@id 96 + +@desc { + + Perform the identified object static field operation with the identified static field, loading or storing into the value register. + +<b>Note:</b> These opbs are reasonable candidates for static linking, altering the field argument to be a more direct offset. + +} + @encoding() { @format 21c | pool_field diff --git a/plugins/dalvik/opdefs/sget_61.d b/plugins/dalvik/v35/opdefs/sget_61.d index c3f132c..faa94e4 100644 --- a/plugins/dalvik/opdefs/sget_61.d +++ b/plugins/dalvik/v35/opdefs/sget_61.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title sget-wide +@id 97 + +@desc { + + Perform the identified object static field operation with the identified static field, loading or storing into the value register. + +<b>Note:</b> These opbs are reasonable candidates for static linking, altering the field argument to be a more direct offset. + +} + @encoding() { @format 21c | pool_field diff --git a/plugins/dalvik/opdefs/sget_62.d b/plugins/dalvik/v35/opdefs/sget_62.d index 97d41d9..310c7a1 100644 --- a/plugins/dalvik/opdefs/sget_62.d +++ b/plugins/dalvik/v35/opdefs/sget_62.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title sget-object +@id 98 + +@desc { + + Perform the identified object static field operation with the identified static field, loading or storing into the value register. + +<b>Note:</b> These opbs are reasonable candidates for static linking, altering the field argument to be a more direct offset. + +} + @encoding() { @format 21c | pool_field diff --git a/plugins/dalvik/opdefs/sget_63.d b/plugins/dalvik/v35/opdefs/sget_63.d index 0dca873..3027a44 100644 --- a/plugins/dalvik/opdefs/sget_63.d +++ b/plugins/dalvik/v35/opdefs/sget_63.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title sget-boolean +@id 99 + +@desc { + + Perform the identified object static field operation with the identified static field, loading or storing into the value register. + +<b>Note:</b> These opbs are reasonable candidates for static linking, altering the field argument to be a more direct offset. + +} + @encoding() { @format 21c | pool_field diff --git a/plugins/dalvik/opdefs/sget_64.d b/plugins/dalvik/v35/opdefs/sget_64.d index 507420e..307572d 100644 --- a/plugins/dalvik/opdefs/sget_64.d +++ b/plugins/dalvik/v35/opdefs/sget_64.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title sget-byte +@id 100 + +@desc { + + Perform the identified object static field operation with the identified static field, loading or storing into the value register. + +<b>Note:</b> These opbs are reasonable candidates for static linking, altering the field argument to be a more direct offset. + +} + @encoding() { @format 21c | pool_field diff --git a/plugins/dalvik/opdefs/sget_65.d b/plugins/dalvik/v35/opdefs/sget_65.d index 5236314..488c1ab 100644 --- a/plugins/dalvik/opdefs/sget_65.d +++ b/plugins/dalvik/v35/opdefs/sget_65.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title sget-char +@id 101 + +@desc { + + Perform the identified object static field operation with the identified static field, loading or storing into the value register. + +<b>Note:</b> These opbs are reasonable candidates for static linking, altering the field argument to be a more direct offset. + +} + @encoding() { @format 21c | pool_field diff --git a/plugins/dalvik/opdefs/sget_66.d b/plugins/dalvik/v35/opdefs/sget_66.d index 9f8b4fa..fb0f2ab 100644 --- a/plugins/dalvik/opdefs/sget_66.d +++ b/plugins/dalvik/v35/opdefs/sget_66.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title sget-short +@id 102 + +@desc { + + Perform the identified object static field operation with the identified static field, loading or storing into the value register. + +<b>Note:</b> These opbs are reasonable candidates for static linking, altering the field argument to be a more direct offset. + +} + @encoding() { @format 21c | pool_field diff --git a/plugins/dalvik/opdefs/shl_98.d b/plugins/dalvik/v35/opdefs/shl_98.d index bfb92bd..ed1ec68 100644 --- a/plugins/dalvik/opdefs/shl_98.d +++ b/plugins/dalvik/v35/opdefs/shl_98.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title shl-int +@id 152 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the destination register. + +<b>Note:</b> Contrary to other <b>-long</b> mathematical operations (which take register pairs for both their first and their second source), <b>shl-long</b>, <b>shr-long</b>, and <b>ushr-long</b> take a register pair for their first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/shl_a3.d b/plugins/dalvik/v35/opdefs/shl_a3.d index c3772b0..bc485a4 100644 --- a/plugins/dalvik/opdefs/shl_a3.d +++ b/plugins/dalvik/v35/opdefs/shl_a3.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title shl-long +@id 163 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the destination register. + +<b>Note:</b> Contrary to other <b>-long</b> mathematical operations (which take register pairs for both their first and their second source), <b>shl-long</b>, <b>shr-long</b>, and <b>ushr-long</b> take a register pair for their first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/shl_b8.d b/plugins/dalvik/v35/opdefs/shl_b8.d index 70f99e1..800398a 100644 --- a/plugins/dalvik/opdefs/shl_b8.d +++ b/plugins/dalvik/v35/opdefs/shl_b8.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title shl-int/2addr +@id 184 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the first source register. + +<b>Note:</b> Contrary to other <b>-long/2addr</b> mathematical operations (which take register pairs for both their destination/first source and their second source), <b>shl-long/2addr</b>, <b>shr-long/2addr</b>, and <b>ushr-long/2addr</b> take a register pair for their destination/first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/shl_c3.d b/plugins/dalvik/v35/opdefs/shl_c3.d index 94d35e5..3b07705 100644 --- a/plugins/dalvik/opdefs/shl_c3.d +++ b/plugins/dalvik/v35/opdefs/shl_c3.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title shl-long/2addr +@id 195 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the first source register. + +<b>Note:</b> Contrary to other <b>-long/2addr</b> mathematical operations (which take register pairs for both their destination/first source and their second source), <b>shl-long/2addr</b>, <b>shr-long/2addr</b>, and <b>ushr-long/2addr</b> take a register pair for their destination/first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/shl_e0.d b/plugins/dalvik/v35/opdefs/shl_e0.d index c5c8d50..a419946 100644 --- a/plugins/dalvik/opdefs/shl_e0.d +++ b/plugins/dalvik/v35/opdefs/shl_e0.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title shl-int/lit8 +@id 224 + +@desc { + + Perform the indicated binary op on the indicated register (first argument) and literal value (second argument), storing the result in the destination register. + +<b>Note:</b> See below for details on the semantics of <b>rsub-int</b>. + +} + @encoding() { @format 22b diff --git a/plugins/dalvik/opdefs/shr_99.d b/plugins/dalvik/v35/opdefs/shr_99.d index 203e4d5..d8658bc 100644 --- a/plugins/dalvik/opdefs/shr_99.d +++ b/plugins/dalvik/v35/opdefs/shr_99.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title shr-int +@id 153 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the destination register. + +<b>Note:</b> Contrary to other <b>-long</b> mathematical operations (which take register pairs for both their first and their second source), <b>shl-long</b>, <b>shr-long</b>, and <b>ushr-long</b> take a register pair for their first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/shr_a4.d b/plugins/dalvik/v35/opdefs/shr_a4.d index 16e07a6..d12821b 100644 --- a/plugins/dalvik/opdefs/shr_a4.d +++ b/plugins/dalvik/v35/opdefs/shr_a4.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title shr-long +@id 164 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the destination register. + +<b>Note:</b> Contrary to other <b>-long</b> mathematical operations (which take register pairs for both their first and their second source), <b>shl-long</b>, <b>shr-long</b>, and <b>ushr-long</b> take a register pair for their first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/shr_b9.d b/plugins/dalvik/v35/opdefs/shr_b9.d index 5f48795..55c3e77 100644 --- a/plugins/dalvik/opdefs/shr_b9.d +++ b/plugins/dalvik/v35/opdefs/shr_b9.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title shr-int/2addr +@id 185 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the first source register. + +<b>Note:</b> Contrary to other <b>-long/2addr</b> mathematical operations (which take register pairs for both their destination/first source and their second source), <b>shl-long/2addr</b>, <b>shr-long/2addr</b>, and <b>ushr-long/2addr</b> take a register pair for their destination/first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/shr_c4.d b/plugins/dalvik/v35/opdefs/shr_c4.d index 80cbfee..6f6862f 100644 --- a/plugins/dalvik/opdefs/shr_c4.d +++ b/plugins/dalvik/v35/opdefs/shr_c4.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title shr-long/2addr +@id 196 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the first source register. + +<b>Note:</b> Contrary to other <b>-long/2addr</b> mathematical operations (which take register pairs for both their destination/first source and their second source), <b>shl-long/2addr</b>, <b>shr-long/2addr</b>, and <b>ushr-long/2addr</b> take a register pair for their destination/first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/shr_e1.d b/plugins/dalvik/v35/opdefs/shr_e1.d index 38a30dc..728798a 100644 --- a/plugins/dalvik/opdefs/shr_e1.d +++ b/plugins/dalvik/v35/opdefs/shr_e1.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title shr-int/lit8 +@id 225 + +@desc { + + Perform the indicated binary op on the indicated register (first argument) and literal value (second argument), storing the result in the destination register. + +<b>Note:</b> See below for details on the semantics of <b>rsub-int</b>. + +} + @encoding() { @format 22b diff --git a/plugins/dalvik/opdefs/sput_67.d b/plugins/dalvik/v35/opdefs/sput_67.d index 149337a..11c3faa 100644 --- a/plugins/dalvik/opdefs/sput_67.d +++ b/plugins/dalvik/v35/opdefs/sput_67.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title sput +@id 103 + +@desc { + + Perform the identified object static field operation with the identified static field, loading or storing into the value register. + +<b>Note:</b> These opbs are reasonable candidates for static linking, altering the field argument to be a more direct offset. + +} + @encoding() { @format 21c | pool_field diff --git a/plugins/dalvik/opdefs/sput_68.d b/plugins/dalvik/v35/opdefs/sput_68.d index 3709445..4009b2f 100644 --- a/plugins/dalvik/opdefs/sput_68.d +++ b/plugins/dalvik/v35/opdefs/sput_68.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title sput-wide +@id 104 + +@desc { + + Perform the identified object static field operation with the identified static field, loading or storing into the value register. + +<b>Note:</b> These opbs are reasonable candidates for static linking, altering the field argument to be a more direct offset. + +} + @encoding() { @format 21c | pool_field diff --git a/plugins/dalvik/opdefs/sput_69.d b/plugins/dalvik/v35/opdefs/sput_69.d index 89302eb..323a72e 100644 --- a/plugins/dalvik/opdefs/sput_69.d +++ b/plugins/dalvik/v35/opdefs/sput_69.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title sput-object +@id 105 + +@desc { + + Perform the identified object static field operation with the identified static field, loading or storing into the value register. + +<b>Note:</b> These opbs are reasonable candidates for static linking, altering the field argument to be a more direct offset. + +} + @encoding() { @format 21c | pool_field diff --git a/plugins/dalvik/opdefs/sput_6a.d b/plugins/dalvik/v35/opdefs/sput_6a.d index 91f5f4f..62a0aa6 100644 --- a/plugins/dalvik/opdefs/sput_6a.d +++ b/plugins/dalvik/v35/opdefs/sput_6a.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title sput-boolean +@id 106 + +@desc { + + Perform the identified object static field operation with the identified static field, loading or storing into the value register. + +<b>Note:</b> These opbs are reasonable candidates for static linking, altering the field argument to be a more direct offset. + +} + @encoding() { @format 21c | pool_field diff --git a/plugins/dalvik/opdefs/sput_6b.d b/plugins/dalvik/v35/opdefs/sput_6b.d index 72338a0..104e75e 100644 --- a/plugins/dalvik/opdefs/sput_6b.d +++ b/plugins/dalvik/v35/opdefs/sput_6b.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title sput-byte +@id 107 + +@desc { + + Perform the identified object static field operation with the identified static field, loading or storing into the value register. + +<b>Note:</b> These opbs are reasonable candidates for static linking, altering the field argument to be a more direct offset. + +} + @encoding() { @format 21c | pool_field diff --git a/plugins/dalvik/opdefs/sput_6c.d b/plugins/dalvik/v35/opdefs/sput_6c.d index 1f0a7c5..26814c5 100644 --- a/plugins/dalvik/opdefs/sput_6c.d +++ b/plugins/dalvik/v35/opdefs/sput_6c.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title sput-char +@id 108 + +@desc { + + Perform the identified object static field operation with the identified static field, loading or storing into the value register. + +<b>Note:</b> These opbs are reasonable candidates for static linking, altering the field argument to be a more direct offset. + +} + @encoding() { @format 21c | pool_field diff --git a/plugins/dalvik/opdefs/sput_6d.d b/plugins/dalvik/v35/opdefs/sput_6d.d index d164858..ab9f6ee 100644 --- a/plugins/dalvik/opdefs/sput_6d.d +++ b/plugins/dalvik/v35/opdefs/sput_6d.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title sput-short +@id 109 + +@desc { + + Perform the identified object static field operation with the identified static field, loading or storing into the value register. + +<b>Note:</b> These opbs are reasonable candidates for static linking, altering the field argument to be a more direct offset. + +} + @encoding() { @format 21c | pool_field diff --git a/plugins/dalvik/opdefs/sub_91.d b/plugins/dalvik/v35/opdefs/sub_91.d index 34fd476..1c64a8e 100644 --- a/plugins/dalvik/opdefs/sub_91.d +++ b/plugins/dalvik/v35/opdefs/sub_91.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title sub-int +@id 145 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the destination register. + +<b>Note:</b> Contrary to other <b>-long</b> mathematical operations (which take register pairs for both their first and their second source), <b>shl-long</b>, <b>shr-long</b>, and <b>ushr-long</b> take a register pair for their first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/sub_9c.d b/plugins/dalvik/v35/opdefs/sub_9c.d index 566cb80..98c4032 100644 --- a/plugins/dalvik/opdefs/sub_9c.d +++ b/plugins/dalvik/v35/opdefs/sub_9c.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title sub-long +@id 156 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the destination register. + +<b>Note:</b> Contrary to other <b>-long</b> mathematical operations (which take register pairs for both their first and their second source), <b>shl-long</b>, <b>shr-long</b>, and <b>ushr-long</b> take a register pair for their first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/sub_a7.d b/plugins/dalvik/v35/opdefs/sub_a7.d index 22851c6..eb148cd 100644 --- a/plugins/dalvik/opdefs/sub_a7.d +++ b/plugins/dalvik/v35/opdefs/sub_a7.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title sub-float +@id 167 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the destination register. + +<b>Note:</b> Contrary to other <b>-long</b> mathematical operations (which take register pairs for both their first and their second source), <b>shl-long</b>, <b>shr-long</b>, and <b>ushr-long</b> take a register pair for their first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/sub_ac.d b/plugins/dalvik/v35/opdefs/sub_ac.d index c818423..9af3ef9 100644 --- a/plugins/dalvik/opdefs/sub_ac.d +++ b/plugins/dalvik/v35/opdefs/sub_ac.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title sub-double +@id 172 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the destination register. + +<b>Note:</b> Contrary to other <b>-long</b> mathematical operations (which take register pairs for both their first and their second source), <b>shl-long</b>, <b>shr-long</b>, and <b>ushr-long</b> take a register pair for their first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/sub_b1.d b/plugins/dalvik/v35/opdefs/sub_b1.d index 4102367..a6edde2 100644 --- a/plugins/dalvik/opdefs/sub_b1.d +++ b/plugins/dalvik/v35/opdefs/sub_b1.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title sub-int/2addr +@id 177 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the first source register. + +<b>Note:</b> Contrary to other <b>-long/2addr</b> mathematical operations (which take register pairs for both their destination/first source and their second source), <b>shl-long/2addr</b>, <b>shr-long/2addr</b>, and <b>ushr-long/2addr</b> take a register pair for their destination/first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/sub_bc.d b/plugins/dalvik/v35/opdefs/sub_bc.d index b0a22ae..62a7f80 100644 --- a/plugins/dalvik/opdefs/sub_bc.d +++ b/plugins/dalvik/v35/opdefs/sub_bc.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title sub-long/2addr +@id 188 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the first source register. + +<b>Note:</b> Contrary to other <b>-long/2addr</b> mathematical operations (which take register pairs for both their destination/first source and their second source), <b>shl-long/2addr</b>, <b>shr-long/2addr</b>, and <b>ushr-long/2addr</b> take a register pair for their destination/first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/sub_c7.d b/plugins/dalvik/v35/opdefs/sub_c7.d index dc8fd47..072f960 100644 --- a/plugins/dalvik/opdefs/sub_c7.d +++ b/plugins/dalvik/v35/opdefs/sub_c7.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title sub-float/2addr +@id 199 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the first source register. + +<b>Note:</b> Contrary to other <b>-long/2addr</b> mathematical operations (which take register pairs for both their destination/first source and their second source), <b>shl-long/2addr</b>, <b>shr-long/2addr</b>, and <b>ushr-long/2addr</b> take a register pair for their destination/first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/sub_cc.d b/plugins/dalvik/v35/opdefs/sub_cc.d index d24b702..6d68bf1 100644 --- a/plugins/dalvik/opdefs/sub_cc.d +++ b/plugins/dalvik/v35/opdefs/sub_cc.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title sub-double/2addr +@id 204 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the first source register. + +<b>Note:</b> Contrary to other <b>-long/2addr</b> mathematical operations (which take register pairs for both their destination/first source and their second source), <b>shl-long/2addr</b>, <b>shr-long/2addr</b>, and <b>ushr-long/2addr</b> take a register pair for their destination/first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/switch_2b.d b/plugins/dalvik/v35/opdefs/switch_2b.d index 2ff6b33..21111d7 100644 --- a/plugins/dalvik/opdefs/switch_2b.d +++ b/plugins/dalvik/v35/opdefs/switch_2b.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title packed-switch +@id 43 + +@desc { + + Jump to a new instruction based on the value in the given register, using a table of offsets corresponding to each value in a particular integral range, or fall through to the next instruction if there is no match. + +} + @encoding() { @format 31t diff --git a/plugins/dalvik/opdefs/switch_2c.d b/plugins/dalvik/v35/opdefs/switch_2c.d index 0a4d248..66b6052 100644 --- a/plugins/dalvik/opdefs/switch_2c.d +++ b/plugins/dalvik/v35/opdefs/switch_2c.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title sparse-switch +@id 44 + +@desc { + + Jump to a new instruction based on the value in the given register, using an ordered table of value-offset pairs, or fall through to the next instruction if there is no match. + +} + @encoding() { @format 31t diff --git a/plugins/dalvik/opdefs/throw_27.d b/plugins/dalvik/v35/opdefs/throw_27.d index 79c71dd..91c176f 100644 --- a/plugins/dalvik/opdefs/throw_27.d +++ b/plugins/dalvik/v35/opdefs/throw_27.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,13 +23,25 @@ @title throw +@id 39 + +@desc { + + Throw the indicated exception. + +} + @encoding() { @format 11x - @rules { + @syntax { + + @rules { + + call g_arch_instruction_set_flag(AIF_RETURN_POINT) - call SetInsFlag(AIF_RETURN_POINT) + } } diff --git a/plugins/dalvik/opdefs/to_81.d b/plugins/dalvik/v35/opdefs/to_81.d index e1b45b3..6e87d13 100644 --- a/plugins/dalvik/opdefs/to_81.d +++ b/plugins/dalvik/v35/opdefs/to_81.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title int-to-long +@id 129 + +@desc { + + Perform the identified unary operation on the source register, storing the result in the destination register. + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/to_82.d b/plugins/dalvik/v35/opdefs/to_82.d index 4d5e667..a0c2500 100644 --- a/plugins/dalvik/opdefs/to_82.d +++ b/plugins/dalvik/v35/opdefs/to_82.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title int-to-float +@id 130 + +@desc { + + Perform the identified unary operation on the source register, storing the result in the destination register. + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/to_83.d b/plugins/dalvik/v35/opdefs/to_83.d index 6f764c1..81931e4 100644 --- a/plugins/dalvik/opdefs/to_83.d +++ b/plugins/dalvik/v35/opdefs/to_83.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title int-to-double +@id 131 + +@desc { + + Perform the identified unary operation on the source register, storing the result in the destination register. + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/to_84.d b/plugins/dalvik/v35/opdefs/to_84.d index f3076ae..2694224 100644 --- a/plugins/dalvik/opdefs/to_84.d +++ b/plugins/dalvik/v35/opdefs/to_84.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title long-to-int +@id 132 + +@desc { + + Perform the identified unary operation on the source register, storing the result in the destination register. + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/to_85.d b/plugins/dalvik/v35/opdefs/to_85.d index 3ac252c..81a572b 100644 --- a/plugins/dalvik/opdefs/to_85.d +++ b/plugins/dalvik/v35/opdefs/to_85.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title long-to-float +@id 133 + +@desc { + + Perform the identified unary operation on the source register, storing the result in the destination register. + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/to_86.d b/plugins/dalvik/v35/opdefs/to_86.d index 80e9a28..34df6de 100644 --- a/plugins/dalvik/opdefs/to_86.d +++ b/plugins/dalvik/v35/opdefs/to_86.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title long-to-double +@id 134 + +@desc { + + Perform the identified unary operation on the source register, storing the result in the destination register. + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/to_87.d b/plugins/dalvik/v35/opdefs/to_87.d index 55028e3..06fb58f 100644 --- a/plugins/dalvik/opdefs/to_87.d +++ b/plugins/dalvik/v35/opdefs/to_87.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title float-to-int +@id 135 + +@desc { + + Perform the identified unary operation on the source register, storing the result in the destination register. + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/to_88.d b/plugins/dalvik/v35/opdefs/to_88.d index 2eaa85b..c0d2306 100644 --- a/plugins/dalvik/opdefs/to_88.d +++ b/plugins/dalvik/v35/opdefs/to_88.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title float-to-long +@id 136 + +@desc { + + Perform the identified unary operation on the source register, storing the result in the destination register. + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/to_89.d b/plugins/dalvik/v35/opdefs/to_89.d index 147f280..5f6a64c 100644 --- a/plugins/dalvik/opdefs/to_89.d +++ b/plugins/dalvik/v35/opdefs/to_89.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title float-to-double +@id 137 + +@desc { + + Perform the identified unary operation on the source register, storing the result in the destination register. + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/to_8a.d b/plugins/dalvik/v35/opdefs/to_8a.d index c089942..263c51d 100644 --- a/plugins/dalvik/opdefs/to_8a.d +++ b/plugins/dalvik/v35/opdefs/to_8a.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title double-to-int +@id 138 + +@desc { + + Perform the identified unary operation on the source register, storing the result in the destination register. + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/to_8b.d b/plugins/dalvik/v35/opdefs/to_8b.d index e60ba2f..def5dc1 100644 --- a/plugins/dalvik/opdefs/to_8b.d +++ b/plugins/dalvik/v35/opdefs/to_8b.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title double-to-long +@id 139 + +@desc { + + Perform the identified unary operation on the source register, storing the result in the destination register. + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/to_8c.d b/plugins/dalvik/v35/opdefs/to_8c.d index b7ee496..4af8de3 100644 --- a/plugins/dalvik/opdefs/to_8c.d +++ b/plugins/dalvik/v35/opdefs/to_8c.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title double-to-float +@id 140 + +@desc { + + Perform the identified unary operation on the source register, storing the result in the destination register. + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/to_8d.d b/plugins/dalvik/v35/opdefs/to_8d.d index 28a194e..fb70951 100644 --- a/plugins/dalvik/opdefs/to_8d.d +++ b/plugins/dalvik/v35/opdefs/to_8d.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title int-to-byte +@id 141 + +@desc { + + Perform the identified unary operation on the source register, storing the result in the destination register. + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/to_8e.d b/plugins/dalvik/v35/opdefs/to_8e.d index c8b2598..bea9c71 100644 --- a/plugins/dalvik/opdefs/to_8e.d +++ b/plugins/dalvik/v35/opdefs/to_8e.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title int-to-char +@id 142 + +@desc { + + Perform the identified unary operation on the source register, storing the result in the destination register. + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/to_8f.d b/plugins/dalvik/v35/opdefs/to_8f.d index 697c102..82e25d1 100644 --- a/plugins/dalvik/opdefs/to_8f.d +++ b/plugins/dalvik/v35/opdefs/to_8f.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,14 @@ @title int-to-short +@id 143 + +@desc { + + Perform the identified unary operation on the source register, storing the result in the destination register. + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/add_90.d b/plugins/dalvik/v35/opdefs/unused_3e.d index 04168ab..2833fbb 100644 --- a/plugins/dalvik/opdefs/add_90.d +++ b/plugins/dalvik/v35/opdefs/unused_3e.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -21,10 +21,12 @@ */ -@title add-int +@title unused-3e + +@id 62 @encoding() { - @format 23x + @unused 10x } diff --git a/plugins/dalvik/opdefs/add_a6.d b/plugins/dalvik/v35/opdefs/unused_3f.d index 055358b..5f6a66d 100644 --- a/plugins/dalvik/opdefs/add_a6.d +++ b/plugins/dalvik/v35/opdefs/unused_3f.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -21,10 +21,12 @@ */ -@title add-float +@title unused-3f + +@id 63 @encoding() { - @format 23x + @unused 10x } diff --git a/plugins/dalvik/opdefs/add_9b.d b/plugins/dalvik/v35/opdefs/unused_40.d index fc40b13..3c93565 100644 --- a/plugins/dalvik/opdefs/add_9b.d +++ b/plugins/dalvik/v35/opdefs/unused_40.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -21,10 +21,12 @@ */ -@title add-long +@title unused-40 + +@id 64 @encoding() { - @format 23x + @unused 10x } diff --git a/plugins/dalvik/opdefs/add_ab.d b/plugins/dalvik/v35/opdefs/unused_41.d index 1506483..cad2943 100644 --- a/plugins/dalvik/opdefs/add_ab.d +++ b/plugins/dalvik/v35/opdefs/unused_41.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -21,10 +21,12 @@ */ -@title add-double +@title unused-41 + +@id 65 @encoding() { - @format 23x + @unused 10x } diff --git a/plugins/dalvik/v35/opdefs/unused_42.d b/plugins/dalvik/v35/opdefs/unused_42.d new file mode 100644 index 0000000..5e4b2c0 --- /dev/null +++ b/plugins/dalvik/v35/opdefs/unused_42.d @@ -0,0 +1,32 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title unused-42 + +@id 66 + +@encoding() { + + @unused 10x + +} diff --git a/plugins/dalvik/v35/opdefs/unused_43.d b/plugins/dalvik/v35/opdefs/unused_43.d new file mode 100644 index 0000000..c339cec --- /dev/null +++ b/plugins/dalvik/v35/opdefs/unused_43.d @@ -0,0 +1,32 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title unused-43 + +@id 67 + +@encoding() { + + @unused 10x + +} diff --git a/plugins/dalvik/v35/opdefs/unused_73.d b/plugins/dalvik/v35/opdefs/unused_73.d new file mode 100644 index 0000000..09caa65 --- /dev/null +++ b/plugins/dalvik/v35/opdefs/unused_73.d @@ -0,0 +1,32 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title unused-73 + +@id 115 + +@encoding() { + + @unused 10x + +} diff --git a/plugins/dalvik/v35/opdefs/unused_79.d b/plugins/dalvik/v35/opdefs/unused_79.d new file mode 100644 index 0000000..063bbfb --- /dev/null +++ b/plugins/dalvik/v35/opdefs/unused_79.d @@ -0,0 +1,32 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title unused-79 + +@id 121 + +@encoding() { + + @unused 10x + +} diff --git a/plugins/dalvik/v35/opdefs/unused_7a.d b/plugins/dalvik/v35/opdefs/unused_7a.d new file mode 100644 index 0000000..50f2d95 --- /dev/null +++ b/plugins/dalvik/v35/opdefs/unused_7a.d @@ -0,0 +1,32 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title unused-7a + +@id 122 + +@encoding() { + + @unused 10x + +} diff --git a/plugins/dalvik/v35/opdefs/unused_e3.d b/plugins/dalvik/v35/opdefs/unused_e3.d new file mode 100644 index 0000000..e27f926 --- /dev/null +++ b/plugins/dalvik/v35/opdefs/unused_e3.d @@ -0,0 +1,32 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title unused-e3 + +@id 227 + +@encoding() { + + @unused 10x + +} diff --git a/plugins/dalvik/v35/opdefs/unused_e4.d b/plugins/dalvik/v35/opdefs/unused_e4.d new file mode 100644 index 0000000..4c90e6a --- /dev/null +++ b/plugins/dalvik/v35/opdefs/unused_e4.d @@ -0,0 +1,32 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title unused-e4 + +@id 228 + +@encoding() { + + @unused 10x + +} diff --git a/plugins/dalvik/v35/opdefs/unused_e5.d b/plugins/dalvik/v35/opdefs/unused_e5.d new file mode 100644 index 0000000..e780c20 --- /dev/null +++ b/plugins/dalvik/v35/opdefs/unused_e5.d @@ -0,0 +1,32 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title unused-e5 + +@id 229 + +@encoding() { + + @unused 10x + +} diff --git a/plugins/dalvik/v35/opdefs/unused_e6.d b/plugins/dalvik/v35/opdefs/unused_e6.d new file mode 100644 index 0000000..44d6e29 --- /dev/null +++ b/plugins/dalvik/v35/opdefs/unused_e6.d @@ -0,0 +1,32 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title unused-e6 + +@id 230 + +@encoding() { + + @unused 10x + +} diff --git a/plugins/dalvik/v35/opdefs/unused_e7.d b/plugins/dalvik/v35/opdefs/unused_e7.d new file mode 100644 index 0000000..6d3fff7 --- /dev/null +++ b/plugins/dalvik/v35/opdefs/unused_e7.d @@ -0,0 +1,32 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title unused-e7 + +@id 231 + +@encoding() { + + @unused 10x + +} diff --git a/plugins/dalvik/v35/opdefs/unused_e8.d b/plugins/dalvik/v35/opdefs/unused_e8.d new file mode 100644 index 0000000..f91c2e9 --- /dev/null +++ b/plugins/dalvik/v35/opdefs/unused_e8.d @@ -0,0 +1,32 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title unused-e8 + +@id 232 + +@encoding() { + + @unused 10x + +} diff --git a/plugins/dalvik/v35/opdefs/unused_e9.d b/plugins/dalvik/v35/opdefs/unused_e9.d new file mode 100644 index 0000000..6304670 --- /dev/null +++ b/plugins/dalvik/v35/opdefs/unused_e9.d @@ -0,0 +1,32 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title unused-e9 + +@id 233 + +@encoding() { + + @unused 10x + +} diff --git a/plugins/dalvik/v35/opdefs/unused_ea.d b/plugins/dalvik/v35/opdefs/unused_ea.d new file mode 100644 index 0000000..055a5e0 --- /dev/null +++ b/plugins/dalvik/v35/opdefs/unused_ea.d @@ -0,0 +1,32 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title unused-ea + +@id 234 + +@encoding() { + + @unused 10x + +} diff --git a/plugins/dalvik/v35/opdefs/unused_eb.d b/plugins/dalvik/v35/opdefs/unused_eb.d new file mode 100644 index 0000000..12cfd34 --- /dev/null +++ b/plugins/dalvik/v35/opdefs/unused_eb.d @@ -0,0 +1,32 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title unused-eb + +@id 235 + +@encoding() { + + @unused 10x + +} diff --git a/plugins/dalvik/v35/opdefs/unused_ec.d b/plugins/dalvik/v35/opdefs/unused_ec.d new file mode 100644 index 0000000..b00c7bf --- /dev/null +++ b/plugins/dalvik/v35/opdefs/unused_ec.d @@ -0,0 +1,32 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title unused-ec + +@id 236 + +@encoding() { + + @unused 10x + +} diff --git a/plugins/dalvik/v35/opdefs/unused_ed.d b/plugins/dalvik/v35/opdefs/unused_ed.d new file mode 100644 index 0000000..94e7627 --- /dev/null +++ b/plugins/dalvik/v35/opdefs/unused_ed.d @@ -0,0 +1,32 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title unused-ed + +@id 237 + +@encoding() { + + @unused 10x + +} diff --git a/plugins/dalvik/v35/opdefs/unused_ee.d b/plugins/dalvik/v35/opdefs/unused_ee.d new file mode 100644 index 0000000..580cbe8 --- /dev/null +++ b/plugins/dalvik/v35/opdefs/unused_ee.d @@ -0,0 +1,32 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title unused-ee + +@id 238 + +@encoding() { + + @unused 10x + +} diff --git a/plugins/dalvik/v35/opdefs/unused_ef.d b/plugins/dalvik/v35/opdefs/unused_ef.d new file mode 100644 index 0000000..a04663b --- /dev/null +++ b/plugins/dalvik/v35/opdefs/unused_ef.d @@ -0,0 +1,32 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title unused-ef + +@id 239 + +@encoding() { + + @unused 10x + +} diff --git a/plugins/dalvik/v35/opdefs/unused_f0.d b/plugins/dalvik/v35/opdefs/unused_f0.d new file mode 100644 index 0000000..c238d44 --- /dev/null +++ b/plugins/dalvik/v35/opdefs/unused_f0.d @@ -0,0 +1,32 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title unused-f0 + +@id 240 + +@encoding() { + + @unused 10x + +} diff --git a/plugins/dalvik/v35/opdefs/unused_f1.d b/plugins/dalvik/v35/opdefs/unused_f1.d new file mode 100644 index 0000000..405a792 --- /dev/null +++ b/plugins/dalvik/v35/opdefs/unused_f1.d @@ -0,0 +1,32 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title unused-f1 + +@id 241 + +@encoding() { + + @unused 10x + +} diff --git a/plugins/dalvik/v35/opdefs/unused_f2.d b/plugins/dalvik/v35/opdefs/unused_f2.d new file mode 100644 index 0000000..58df50c --- /dev/null +++ b/plugins/dalvik/v35/opdefs/unused_f2.d @@ -0,0 +1,32 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title unused-f2 + +@id 242 + +@encoding() { + + @unused 10x + +} diff --git a/plugins/dalvik/v35/opdefs/unused_f3.d b/plugins/dalvik/v35/opdefs/unused_f3.d new file mode 100644 index 0000000..51280d7 --- /dev/null +++ b/plugins/dalvik/v35/opdefs/unused_f3.d @@ -0,0 +1,32 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title unused-f3 + +@id 243 + +@encoding() { + + @unused 10x + +} diff --git a/plugins/dalvik/v35/opdefs/unused_f4.d b/plugins/dalvik/v35/opdefs/unused_f4.d new file mode 100644 index 0000000..015d988 --- /dev/null +++ b/plugins/dalvik/v35/opdefs/unused_f4.d @@ -0,0 +1,32 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title unused-f4 + +@id 244 + +@encoding() { + + @unused 10x + +} diff --git a/plugins/dalvik/v35/opdefs/unused_f5.d b/plugins/dalvik/v35/opdefs/unused_f5.d new file mode 100644 index 0000000..63c6fd1 --- /dev/null +++ b/plugins/dalvik/v35/opdefs/unused_f5.d @@ -0,0 +1,32 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title unused-f5 + +@id 245 + +@encoding() { + + @unused 10x + +} diff --git a/plugins/dalvik/v35/opdefs/unused_f6.d b/plugins/dalvik/v35/opdefs/unused_f6.d new file mode 100644 index 0000000..405c363 --- /dev/null +++ b/plugins/dalvik/v35/opdefs/unused_f6.d @@ -0,0 +1,32 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title unused-f6 + +@id 246 + +@encoding() { + + @unused 10x + +} diff --git a/plugins/dalvik/v35/opdefs/unused_f7.d b/plugins/dalvik/v35/opdefs/unused_f7.d new file mode 100644 index 0000000..67ded78 --- /dev/null +++ b/plugins/dalvik/v35/opdefs/unused_f7.d @@ -0,0 +1,32 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title unused-f7 + +@id 247 + +@encoding() { + + @unused 10x + +} diff --git a/plugins/dalvik/v35/opdefs/unused_f8.d b/plugins/dalvik/v35/opdefs/unused_f8.d new file mode 100644 index 0000000..aadd8a8 --- /dev/null +++ b/plugins/dalvik/v35/opdefs/unused_f8.d @@ -0,0 +1,32 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title unused-f8 + +@id 248 + +@encoding() { + + @unused 10x + +} diff --git a/plugins/dalvik/v35/opdefs/unused_f9.d b/plugins/dalvik/v35/opdefs/unused_f9.d new file mode 100644 index 0000000..84c8855 --- /dev/null +++ b/plugins/dalvik/v35/opdefs/unused_f9.d @@ -0,0 +1,32 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title unused-f9 + +@id 249 + +@encoding() { + + @unused 10x + +} diff --git a/plugins/dalvik/v35/opdefs/unused_fa.d b/plugins/dalvik/v35/opdefs/unused_fa.d new file mode 100644 index 0000000..66053c7 --- /dev/null +++ b/plugins/dalvik/v35/opdefs/unused_fa.d @@ -0,0 +1,32 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title unused-fa + +@id 250 + +@encoding() { + + @unused 10x + +} diff --git a/plugins/dalvik/v35/opdefs/unused_fb.d b/plugins/dalvik/v35/opdefs/unused_fb.d new file mode 100644 index 0000000..e0521e6 --- /dev/null +++ b/plugins/dalvik/v35/opdefs/unused_fb.d @@ -0,0 +1,32 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title unused-fb + +@id 251 + +@encoding() { + + @unused 10x + +} diff --git a/plugins/dalvik/v35/opdefs/unused_fc.d b/plugins/dalvik/v35/opdefs/unused_fc.d new file mode 100644 index 0000000..3b58e64 --- /dev/null +++ b/plugins/dalvik/v35/opdefs/unused_fc.d @@ -0,0 +1,32 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title unused-fc + +@id 252 + +@encoding() { + + @unused 10x + +} diff --git a/plugins/dalvik/v35/opdefs/unused_fd.d b/plugins/dalvik/v35/opdefs/unused_fd.d new file mode 100644 index 0000000..7c2a0f2 --- /dev/null +++ b/plugins/dalvik/v35/opdefs/unused_fd.d @@ -0,0 +1,32 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title unused-fd + +@id 253 + +@encoding() { + + @unused 10x + +} diff --git a/plugins/dalvik/v35/opdefs/unused_fe.d b/plugins/dalvik/v35/opdefs/unused_fe.d new file mode 100644 index 0000000..e470bae --- /dev/null +++ b/plugins/dalvik/v35/opdefs/unused_fe.d @@ -0,0 +1,32 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title unused-fe + +@id 254 + +@encoding() { + + @unused 10x + +} diff --git a/plugins/dalvik/v35/opdefs/unused_ff.d b/plugins/dalvik/v35/opdefs/unused_ff.d new file mode 100644 index 0000000..ef0126d --- /dev/null +++ b/plugins/dalvik/v35/opdefs/unused_ff.d @@ -0,0 +1,32 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * ##FILE## - traduction d'instructions Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +@title unused-ff + +@id 255 + +@encoding() { + + @unused 10x + +} diff --git a/plugins/dalvik/opdefs/ushr_9a.d b/plugins/dalvik/v35/opdefs/ushr_9a.d index d3f48ba..234ad7b 100644 --- a/plugins/dalvik/opdefs/ushr_9a.d +++ b/plugins/dalvik/v35/opdefs/ushr_9a.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title ushr-int +@id 154 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the destination register. + +<b>Note:</b> Contrary to other <b>-long</b> mathematical operations (which take register pairs for both their first and their second source), <b>shl-long</b>, <b>shr-long</b>, and <b>ushr-long</b> take a register pair for their first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/ushr_a5.d b/plugins/dalvik/v35/opdefs/ushr_a5.d index 11578c3..8ada091 100644 --- a/plugins/dalvik/opdefs/ushr_a5.d +++ b/plugins/dalvik/v35/opdefs/ushr_a5.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title ushr-long +@id 165 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the destination register. + +<b>Note:</b> Contrary to other <b>-long</b> mathematical operations (which take register pairs for both their first and their second source), <b>shl-long</b>, <b>shr-long</b>, and <b>ushr-long</b> take a register pair for their first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/ushr_ba.d b/plugins/dalvik/v35/opdefs/ushr_ba.d index d9c0ab7..f5061e2 100644 --- a/plugins/dalvik/opdefs/ushr_ba.d +++ b/plugins/dalvik/v35/opdefs/ushr_ba.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title ushr-int/2addr +@id 186 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the first source register. + +<b>Note:</b> Contrary to other <b>-long/2addr</b> mathematical operations (which take register pairs for both their destination/first source and their second source), <b>shl-long/2addr</b>, <b>shr-long/2addr</b>, and <b>ushr-long/2addr</b> take a register pair for their destination/first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/ushr_c5.d b/plugins/dalvik/v35/opdefs/ushr_c5.d index b0117a7..322591b 100644 --- a/plugins/dalvik/opdefs/ushr_c5.d +++ b/plugins/dalvik/v35/opdefs/ushr_c5.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title ushr-long/2addr +@id 197 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the first source register. + +<b>Note:</b> Contrary to other <b>-long/2addr</b> mathematical operations (which take register pairs for both their destination/first source and their second source), <b>shl-long/2addr</b>, <b>shr-long/2addr</b>, and <b>ushr-long/2addr</b> take a register pair for their destination/first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/ushr_e2.d b/plugins/dalvik/v35/opdefs/ushr_e2.d index 5ade4f7..06fcdc7 100644 --- a/plugins/dalvik/opdefs/ushr_e2.d +++ b/plugins/dalvik/v35/opdefs/ushr_e2.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title ushr-int/lit8 +@id 226 + +@desc { + + Perform the indicated binary op on the indicated register (first argument) and literal value (second argument), storing the result in the destination register. + +<b>Note:</b> See below for details on the semantics of <b>rsub-int</b>. + +} + @encoding() { @format 22b diff --git a/plugins/dalvik/opdefs/xor_97.d b/plugins/dalvik/v35/opdefs/xor_97.d index 3bdfc05..c813a50 100644 --- a/plugins/dalvik/opdefs/xor_97.d +++ b/plugins/dalvik/v35/opdefs/xor_97.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title xor-int +@id 151 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the destination register. + +<b>Note:</b> Contrary to other <b>-long</b> mathematical operations (which take register pairs for both their first and their second source), <b>shl-long</b>, <b>shr-long</b>, and <b>ushr-long</b> take a register pair for their first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/xor_a2.d b/plugins/dalvik/v35/opdefs/xor_a2.d index d651f66..045aa47 100644 --- a/plugins/dalvik/opdefs/xor_a2.d +++ b/plugins/dalvik/v35/opdefs/xor_a2.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title xor-long +@id 162 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the destination register. + +<b>Note:</b> Contrary to other <b>-long</b> mathematical operations (which take register pairs for both their first and their second source), <b>shl-long</b>, <b>shr-long</b>, and <b>ushr-long</b> take a register pair for their first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 23x diff --git a/plugins/dalvik/opdefs/xor_b7.d b/plugins/dalvik/v35/opdefs/xor_b7.d index b42da76..0425e1d 100644 --- a/plugins/dalvik/opdefs/xor_b7.d +++ b/plugins/dalvik/v35/opdefs/xor_b7.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title xor-int/2addr +@id 183 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the first source register. + +<b>Note:</b> Contrary to other <b>-long/2addr</b> mathematical operations (which take register pairs for both their destination/first source and their second source), <b>shl-long/2addr</b>, <b>shr-long/2addr</b>, and <b>ushr-long/2addr</b> take a register pair for their destination/first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/xor_c2.d b/plugins/dalvik/v35/opdefs/xor_c2.d index 3fd2660..76b6a05 100644 --- a/plugins/dalvik/opdefs/xor_c2.d +++ b/plugins/dalvik/v35/opdefs/xor_c2.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title xor-long/2addr +@id 194 + +@desc { + + Perform the identified binary operation on the two source registers, storing the result in the first source register. + +<b>Note:</b> Contrary to other <b>-long/2addr</b> mathematical operations (which take register pairs for both their destination/first source and their second source), <b>shl-long/2addr</b>, <b>shr-long/2addr</b>, and <b>ushr-long/2addr</b> take a register pair for their destination/first source (the value to be shifted), but a single register for their second source (the shifting distance). + +} + @encoding() { @format 12x diff --git a/plugins/dalvik/opdefs/xor_d7.d b/plugins/dalvik/v35/opdefs/xor_d7.d index 2351a21..5b2c637 100644 --- a/plugins/dalvik/opdefs/xor_d7.d +++ b/plugins/dalvik/v35/opdefs/xor_d7.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title xor-int/lit16 +@id 215 + +@desc { + + Perform the indicated binary op on the indicated register (first argument) and literal value (second argument), storing the result in the destination register. + +<b>Note:</b> <b>rsub-int</b> does not have a suffix since this version is the main opb of its family. Also, see below for details on its semantics. + +} + @encoding() { @format 22s diff --git a/plugins/dalvik/opdefs/xor_df.d b/plugins/dalvik/v35/opdefs/xor_df.d index 04443f7..cd0d5d3 100644 --- a/plugins/dalvik/opdefs/xor_df.d +++ b/plugins/dalvik/v35/opdefs/xor_df.d @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * ##FILE## - traduction d'instructions Dalvik * - * Copyright (C) 2015 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -23,6 +23,16 @@ @title xor-int/lit8 +@id 223 + +@desc { + + Perform the indicated binary op on the indicated register (first argument) and literal value (second argument), storing the result in the destination register. + +<b>Note:</b> See below for details on the semantics of <b>rsub-int</b>. + +} + @encoding() { @format 22b diff --git a/plugins/arm/v7/opdefs/subs_B9320.d b/plugins/dalvik/v35/operand.h index 335e614..e2bc5e3 100644 --- a/plugins/arm/v7/opdefs/subs_B9320.d +++ b/plugins/dalvik/v35/operand.h @@ -1,8 +1,8 @@ /* Chrysalide - Outil d'analyse de fichiers binaires - * ##FILE## - traduction d'instructions ARMv7 + * operand.h - prototypes pour l'aide à la création d'opérandes Dalvik v35 * - * Copyright (C) 2014 Cyrille Bagard + * Copyright (C) 2018 Cyrille Bagard * * This file is part of Chrysalide. * @@ -21,24 +21,17 @@ */ -@title SUBS PC, LR and related instructions (ARM) +#ifndef _PLUGINS_DALVIK_V35_OPERAND_H +#define _PLUGINS_DALVIK_V35_OPERAND_H -@encoding(A1) { - @word cond(4) 0 0 1 opcode(4) 1 Rn(4) 1 1 1 1 imm12(12) +#include "../operand.h" - @syntax {c} <Rn> <#const> - @conv { - c = Condition(cond) - Rn = Register(Rn) - const = ExpandImmC32(imm12) +/* Procède à la lecture d'opérandes pour une instruction. */ +#define dalvik35_read_operands dalvik_read_operands - } - @rules { - } - -} +#endif /* _PLUGINS_DALVIK_V35_OPERAND_H */ diff --git a/plugins/dalvik/v35/processor.c b/plugins/dalvik/v35/processor.c new file mode 100644 index 0000000..17d447a --- /dev/null +++ b/plugins/dalvik/v35/processor.c @@ -0,0 +1,494 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * processor.c - manipulation du processeur de la VM Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +#include "processor.h" + + +#include <assert.h> + + +#include "instruction.h" +#include "opcodes/identifiers.h" +#include "opcodes/opcodes.h" +#include "../processor-int.h" +#include "../pseudo/fill.h" +#include "../pseudo/switch.h" + + + +/* Définition du processeur de la VM Dalvik v35 (instance) */ +struct _GDalvik35Processor +{ + GDalvikProcessor parent; /* Instance parente */ + +}; + + +/* Définition du processeur de la VM Dalvik v35 (classe) */ +struct _GDalvik35ProcessorClass +{ + GDalvikProcessorClass parent; /* Classe parente */ + +}; + + +/* Initialise la classe des processeurs de VM Dalvik v35. */ +static void g_dalvik35_processor_class_init(GDalvik35ProcessorClass *); + +/* Initialise une instance de processeur de VM Dalvik v35. */ +static void g_dalvik35_processor_init(GDalvik35Processor *); + +/* Supprime toutes les références externes. */ +static void g_dalvik35_processor_dispose(GDalvik35Processor *); + +/* Procède à la libération totale de la mémoire. */ +static void g_dalvik35_processor_finalize(GDalvik35Processor *); + +/* Décode une instruction dans un flux de données. */ +static GArchInstruction *g_dalvik35_processor_disassemble(const GArchProcessor *, GDalvikContext *, const GBinContent *, vmpa2t *, GExeFormat *); + + + +/* Indique le type défini par la GLib pour le processeur Dalvik v35. */ +G_DEFINE_TYPE(GDalvik35Processor, g_dalvik35_processor, G_TYPE_DALVIK_PROCESSOR); + + +/****************************************************************************** +* * +* Paramètres : klass = classe à initialiser. * +* * +* Description : Initialise la classe des processeurs de VM Dalvik v35. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +static void g_dalvik35_processor_class_init(GDalvik35ProcessorClass *klass) +{ + GObjectClass *object; /* Autre version de la classe */ + GArchProcessorClass *proc; /* Encore une autre vision... */ + + object = G_OBJECT_CLASS(klass); + + object->dispose = (GObjectFinalizeFunc/* ! */)g_dalvik35_processor_dispose; + object->finalize = (GObjectFinalizeFunc)g_dalvik35_processor_finalize; + + proc = G_ARCH_PROCESSOR_CLASS(klass); + + proc->disassemble = (disass_instr_fc)g_dalvik35_processor_disassemble; + +} + + +/****************************************************************************** +* * +* Paramètres : proc = instance à initialiser. * +* * +* Description : Initialise une instance de processeur de VM Dalvik v35. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +static void g_dalvik35_processor_init(GDalvik35Processor *proc) +{ + +} + + +/****************************************************************************** +* * +* Paramètres : proc = instance d'objet GLib à traiter. * +* * +* Description : Supprime toutes les références externes. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +static void g_dalvik35_processor_dispose(GDalvik35Processor *proc) +{ + G_OBJECT_CLASS(g_dalvik35_processor_parent_class)->dispose(G_OBJECT(proc)); + +} + + +/****************************************************************************** +* * +* Paramètres : bookmark = instance d'objet GLib à traiter. * +* * +* Description : Procède à la libération totale de la mémoire. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +static void g_dalvik35_processor_finalize(GDalvik35Processor *proc) +{ + G_OBJECT_CLASS(g_dalvik35_processor_parent_class)->finalize(G_OBJECT(proc)); + +} + + +/****************************************************************************** +* * +* Paramètres : - * +* * +* Description : Crée le support de l'architecture Dalvik v35. * +* * +* Retour : Architecture mise en place. * +* * +* Remarques : - * +* * +******************************************************************************/ + +GArchProcessor *g_dalvik35_processor_new(void) +{ + GArchProcessor *result; /* Structure à retourner */ + + result = g_object_new(G_TYPE_DALVIK_PROCESSOR, NULL); + + return result; + +} + + +/****************************************************************************** +* * +* Paramètres : proc = architecture visée par la procédure. * +* ctx = contexte lié à l'exécution du processeur. * +* content = flux de données à analyser. * +* pos = position courante dans ce flux. [OUT] * +* format = format du fichier contenant le code. * +* * +* Description : Désassemble une instruction dans un flux de données. * +* * +* Retour : Instruction mise en place ou NULL en cas d'échec. * +* * +* Remarques : - * +* * +******************************************************************************/ + +static GArchInstruction *g_dalvik35_processor_disassemble(const GArchProcessor *proc, GDalvikContext *ctx, const GBinContent *content, vmpa2t *pos, GExeFormat *format) +{ + GArchInstruction *result; /* Instruction à renvoyer */ + uint8_t raw8; /* Donnée de 8 bits à analyser */ + Dalvik35Opcodes id; /* Identifiant d'instruction */ + + static const disass_instr_fc decodings[DOP35_COUNT] = { + + [DOP35_NOP] = dalvik35_read_instr_nop, + [DOP35_MOVE] = dalvik35_read_instr_move, + [DOP35_MOVE_FROM16] = dalvik35_read_instr_move_from16, + [DOP35_MOVE_16] = dalvik35_read_instr_move_16, + [DOP35_MOVE_WIDE] = dalvik35_read_instr_move_wide, + [DOP35_MOVE_WIDE_FROM16] = dalvik35_read_instr_move_wide_from16, + [DOP35_MOVE_WIDE_16] = dalvik35_read_instr_move_wide_16, + [DOP35_MOVE_OBJECT] = dalvik35_read_instr_move_object, + [DOP35_MOVE_OBJECT_FROM16] = dalvik35_read_instr_move_object_from16, + [DOP35_MOVE_OBJECT_16] = dalvik35_read_instr_move_object_16, + [DOP35_MOVE_RESULT] = dalvik35_read_instr_move_result, + [DOP35_MOVE_RESULT_WIDE] = dalvik35_read_instr_move_result_wide, + [DOP35_MOVE_RESULT_OBJECT] = dalvik35_read_instr_move_result_object, + [DOP35_MOVE_EXCEPTION] = dalvik35_read_instr_move_exception, + [DOP35_RETURN_VOID] = dalvik35_read_instr_return_void, + [DOP35_RETURN] = dalvik35_read_instr_return, + [DOP35_RETURN_WIDE] = dalvik35_read_instr_return_wide, + [DOP35_RETURN_OBJECT] = dalvik35_read_instr_return_object, + [DOP35_CONST_4] = dalvik35_read_instr_const_4, + [DOP35_CONST_16] = dalvik35_read_instr_const_16, + [DOP35_CONST] = dalvik35_read_instr_const, + [DOP35_CONST_HIGH16] = dalvik35_read_instr_const_high16, + [DOP35_CONST_WIDE_16] = dalvik35_read_instr_const_wide_16, + [DOP35_CONST_WIDE_32] = dalvik35_read_instr_const_wide_32, + [DOP35_CONST_WIDE] = dalvik35_read_instr_const_wide, + [DOP35_CONST_WIDE_HIGH16] = dalvik35_read_instr_const_wide_high16, + [DOP35_CONST_STRING] = dalvik35_read_instr_const_string, + [DOP35_CONST_STRING_JUMBO] = dalvik35_read_instr_const_string_jumbo, + [DOP35_CONST_CLASS] = dalvik35_read_instr_const_class, + [DOP35_MONITOR_ENTER] = dalvik35_read_instr_monitor_enter, + [DOP35_MONITOR_EXIT] = dalvik35_read_instr_monitor_exit, + [DOP35_CHECK_CAST] = dalvik35_read_instr_check_cast, + [DOP35_INSTANCE_OF] = dalvik35_read_instr_instance_of, + [DOP35_ARRAY_LENGTH] = dalvik35_read_instr_array_length, + [DOP35_NEW_INSTANCE] = dalvik35_read_instr_new_instance, + [DOP35_NEW_ARRAY] = dalvik35_read_instr_new_array, + [DOP35_FILLED_NEW_ARRAY] = dalvik35_read_instr_filled_new_array, + [DOP35_FILLED_NEW_ARRAY_RANGE] = dalvik35_read_instr_filled_new_array_range, + [DOP35_FILL_ARRAY_DATA] = dalvik35_read_instr_fill_array_data, + [DOP35_THROW] = dalvik35_read_instr_throw, + [DOP35_GOTO] = dalvik35_read_instr_goto, + [DOP35_GOTO_16] = dalvik35_read_instr_goto_16, + [DOP35_GOTO_32] = dalvik35_read_instr_goto_32, + [DOP35_PACKED_SWITCH] = dalvik35_read_instr_packed_switch, + [DOP35_SPARSE_SWITCH] = dalvik35_read_instr_sparse_switch, + [DOP35_CMPL_FLOAT] = dalvik35_read_instr_cmpl_float, + [DOP35_CMPG_FLOAT] = dalvik35_read_instr_cmpg_float, + [DOP35_CMPL_DOUBLE] = dalvik35_read_instr_cmpl_double, + [DOP35_CMPG_DOUBLE] = dalvik35_read_instr_cmpg_double, + [DOP35_CMP_LONG] = dalvik35_read_instr_cmp_long, + [DOP35_IF_EQ] = dalvik35_read_instr_if_eq, + [DOP35_IF_NE] = dalvik35_read_instr_if_ne, + [DOP35_IF_LT] = dalvik35_read_instr_if_lt, + [DOP35_IF_GE] = dalvik35_read_instr_if_ge, + [DOP35_IF_GT] = dalvik35_read_instr_if_gt, + [DOP35_IF_LE] = dalvik35_read_instr_if_le, + [DOP35_IF_EQZ] = dalvik35_read_instr_if_eqz, + [DOP35_IF_NEZ] = dalvik35_read_instr_if_nez, + [DOP35_IF_LTZ] = dalvik35_read_instr_if_ltz, + [DOP35_IF_GEZ] = dalvik35_read_instr_if_gez, + [DOP35_IF_GTZ] = dalvik35_read_instr_if_gtz, + [DOP35_IF_LEZ] = dalvik35_read_instr_if_lez, + [DOP35_UNUSED_3E] = dalvik35_read_instr_unused_3e, + [DOP35_UNUSED_3F] = dalvik35_read_instr_unused_3f, + [DOP35_UNUSED_40] = dalvik35_read_instr_unused_40, + [DOP35_UNUSED_41] = dalvik35_read_instr_unused_41, + [DOP35_UNUSED_42] = dalvik35_read_instr_unused_42, + [DOP35_UNUSED_43] = dalvik35_read_instr_unused_43, + [DOP35_AGET] = dalvik35_read_instr_aget, + [DOP35_AGET_WIDE] = dalvik35_read_instr_aget_wide, + [DOP35_AGET_OBJECT] = dalvik35_read_instr_aget_object, + [DOP35_AGET_BOOLEAN] = dalvik35_read_instr_aget_boolean, + [DOP35_AGET_BYTE] = dalvik35_read_instr_aget_byte, + [DOP35_AGET_CHAR] = dalvik35_read_instr_aget_char, + [DOP35_AGET_SHORT] = dalvik35_read_instr_aget_short, + [DOP35_APUT] = dalvik35_read_instr_aput, + [DOP35_APUT_WIDE] = dalvik35_read_instr_aput_wide, + [DOP35_APUT_OBJECT] = dalvik35_read_instr_aput_object, + [DOP35_APUT_BOOLEAN] = dalvik35_read_instr_aput_boolean, + [DOP35_APUT_BYTE] = dalvik35_read_instr_aput_byte, + [DOP35_APUT_CHAR] = dalvik35_read_instr_aput_char, + [DOP35_APUT_SHORT] = dalvik35_read_instr_aput_short, + [DOP35_IGET] = dalvik35_read_instr_iget, + [DOP35_IGET_WIDE] = dalvik35_read_instr_iget_wide, + [DOP35_IGET_OBJECT] = dalvik35_read_instr_iget_object, + [DOP35_IGET_BOOLEAN] = dalvik35_read_instr_iget_boolean, + [DOP35_IGET_BYTE] = dalvik35_read_instr_iget_byte, + [DOP35_IGET_CHAR] = dalvik35_read_instr_iget_char, + [DOP35_IGET_SHORT] = dalvik35_read_instr_iget_short, + [DOP35_IPUT] = dalvik35_read_instr_iput, + [DOP35_IPUT_WIDE] = dalvik35_read_instr_iput_wide, + [DOP35_IPUT_OBJECT] = dalvik35_read_instr_iput_object, + [DOP35_IPUT_BOOLEAN] = dalvik35_read_instr_iput_boolean, + [DOP35_IPUT_BYTE] = dalvik35_read_instr_iput_byte, + [DOP35_IPUT_CHAR] = dalvik35_read_instr_iput_char, + [DOP35_IPUT_SHORT] = dalvik35_read_instr_iput_short, + [DOP35_SGET] = dalvik35_read_instr_sget, + [DOP35_SGET_WIDE] = dalvik35_read_instr_sget_wide, + [DOP35_SGET_OBJECT] = dalvik35_read_instr_sget_object, + [DOP35_SGET_BOOLEAN] = dalvik35_read_instr_sget_boolean, + [DOP35_SGET_BYTE] = dalvik35_read_instr_sget_byte, + [DOP35_SGET_CHAR] = dalvik35_read_instr_sget_char, + [DOP35_SGET_SHORT] = dalvik35_read_instr_sget_short, + [DOP35_SPUT] = dalvik35_read_instr_sput, + [DOP35_SPUT_WIDE] = dalvik35_read_instr_sput_wide, + [DOP35_SPUT_OBJECT] = dalvik35_read_instr_sput_object, + [DOP35_SPUT_BOOLEAN] = dalvik35_read_instr_sput_boolean, + [DOP35_SPUT_BYTE] = dalvik35_read_instr_sput_byte, + [DOP35_SPUT_CHAR] = dalvik35_read_instr_sput_char, + [DOP35_SPUT_SHORT] = dalvik35_read_instr_sput_short, + [DOP35_INVOKE_VIRTUAL] = dalvik35_read_instr_invoke_virtual, + [DOP35_INVOKE_SUPER] = dalvik35_read_instr_invoke_super, + [DOP35_INVOKE_DIRECT] = dalvik35_read_instr_invoke_direct, + [DOP35_INVOKE_STATIC] = dalvik35_read_instr_invoke_static, + [DOP35_INVOKE_INTERFACE] = dalvik35_read_instr_invoke_interface, + [DOP35_UNUSED_73] = dalvik35_read_instr_unused_73, + [DOP35_INVOKE_VIRTUAL_RANGE] = dalvik35_read_instr_invoke_virtual_range, + [DOP35_INVOKE_SUPER_RANGE] = dalvik35_read_instr_invoke_super_range, + [DOP35_INVOKE_DIRECT_RANGE] = dalvik35_read_instr_invoke_direct_range, + [DOP35_INVOKE_STATIC_RANGE] = dalvik35_read_instr_invoke_static_range, + [DOP35_INVOKE_INTERFACE_RANGE] = dalvik35_read_instr_invoke_interface_range, + [DOP35_UNUSED_79] = dalvik35_read_instr_unused_79, + [DOP35_UNUSED_7A] = dalvik35_read_instr_unused_7a, + [DOP35_NEG_INT] = dalvik35_read_instr_neg_int, + [DOP35_NOT_INT] = dalvik35_read_instr_not_int, + [DOP35_NEG_LONG] = dalvik35_read_instr_neg_long, + [DOP35_NOT_LONG] = dalvik35_read_instr_not_long, + [DOP35_NEG_FLOAT] = dalvik35_read_instr_neg_float, + [DOP35_NEG_DOUBLE] = dalvik35_read_instr_neg_double, + [DOP35_INT_TO_LONG] = dalvik35_read_instr_int_to_long, + [DOP35_INT_TO_FLOAT] = dalvik35_read_instr_int_to_float, + [DOP35_INT_TO_DOUBLE] = dalvik35_read_instr_int_to_double, + [DOP35_LONG_TO_INT] = dalvik35_read_instr_long_to_int, + [DOP35_LONG_TO_FLOAT] = dalvik35_read_instr_long_to_float, + [DOP35_LONG_TO_DOUBLE] = dalvik35_read_instr_long_to_double, + [DOP35_FLOAT_TO_INT] = dalvik35_read_instr_float_to_int, + [DOP35_FLOAT_TO_LONG] = dalvik35_read_instr_float_to_long, + [DOP35_FLOAT_TO_DOUBLE] = dalvik35_read_instr_float_to_double, + [DOP35_DOUBLE_TO_INT] = dalvik35_read_instr_double_to_int, + [DOP35_DOUBLE_TO_LONG] = dalvik35_read_instr_double_to_long, + [DOP35_DOUBLE_TO_FLOAT] = dalvik35_read_instr_double_to_float, + [DOP35_INT_TO_BYTE] = dalvik35_read_instr_int_to_byte, + [DOP35_INT_TO_CHAR] = dalvik35_read_instr_int_to_char, + [DOP35_INT_TO_SHORT] = dalvik35_read_instr_int_to_short, + [DOP35_ADD_INT] = dalvik35_read_instr_add_int, + [DOP35_SUB_INT] = dalvik35_read_instr_sub_int, + [DOP35_MUL_INT] = dalvik35_read_instr_mul_int, + [DOP35_DIV_INT] = dalvik35_read_instr_div_int, + [DOP35_REM_INT] = dalvik35_read_instr_rem_int, + [DOP35_AND_INT] = dalvik35_read_instr_and_int, + [DOP35_OR_INT] = dalvik35_read_instr_or_int, + [DOP35_XOR_INT] = dalvik35_read_instr_xor_int, + [DOP35_SHL_INT] = dalvik35_read_instr_shl_int, + [DOP35_SHR_INT] = dalvik35_read_instr_shr_int, + [DOP35_USHR_INT] = dalvik35_read_instr_ushr_int, + [DOP35_ADD_LONG] = dalvik35_read_instr_add_long, + [DOP35_SUB_LONG] = dalvik35_read_instr_sub_long, + [DOP35_MUL_LONG] = dalvik35_read_instr_mul_long, + [DOP35_DIV_LONG] = dalvik35_read_instr_div_long, + [DOP35_REM_LONG] = dalvik35_read_instr_rem_long, + [DOP35_AND_LONG] = dalvik35_read_instr_and_long, + [DOP35_OR_LONG] = dalvik35_read_instr_or_long, + [DOP35_XOR_LONG] = dalvik35_read_instr_xor_long, + [DOP35_SHL_LONG] = dalvik35_read_instr_shl_long, + [DOP35_SHR_LONG] = dalvik35_read_instr_shr_long, + [DOP35_USHR_LONG] = dalvik35_read_instr_ushr_long, + [DOP35_ADD_FLOAT] = dalvik35_read_instr_add_float, + [DOP35_SUB_FLOAT] = dalvik35_read_instr_sub_float, + [DOP35_MUL_FLOAT] = dalvik35_read_instr_mul_float, + [DOP35_DIV_FLOAT] = dalvik35_read_instr_div_float, + [DOP35_REM_FLOAT] = dalvik35_read_instr_rem_float, + [DOP35_ADD_DOUBLE] = dalvik35_read_instr_add_double, + [DOP35_SUB_DOUBLE] = dalvik35_read_instr_sub_double, + [DOP35_MUL_DOUBLE] = dalvik35_read_instr_mul_double, + [DOP35_DIV_DOUBLE] = dalvik35_read_instr_div_double, + [DOP35_REM_DOUBLE] = dalvik35_read_instr_rem_double, + [DOP35_ADD_INT_2ADDR] = dalvik35_read_instr_add_int_2addr, + [DOP35_SUB_INT_2ADDR] = dalvik35_read_instr_sub_int_2addr, + [DOP35_MUL_INT_2ADDR] = dalvik35_read_instr_mul_int_2addr, + [DOP35_DIV_INT_2ADDR] = dalvik35_read_instr_div_int_2addr, + [DOP35_REM_INT_2ADDR] = dalvik35_read_instr_rem_int_2addr, + [DOP35_AND_INT_2ADDR] = dalvik35_read_instr_and_int_2addr, + [DOP35_OR_INT_2ADDR] = dalvik35_read_instr_or_int_2addr, + [DOP35_XOR_INT_2ADDR] = dalvik35_read_instr_xor_int_2addr, + [DOP35_SHL_INT_2ADDR] = dalvik35_read_instr_shl_int_2addr, + [DOP35_SHR_INT_2ADDR] = dalvik35_read_instr_shr_int_2addr, + [DOP35_USHR_INT_2ADDR] = dalvik35_read_instr_ushr_int_2addr, + [DOP35_ADD_LONG_2ADDR] = dalvik35_read_instr_add_long_2addr, + [DOP35_SUB_LONG_2ADDR] = dalvik35_read_instr_sub_long_2addr, + [DOP35_MUL_LONG_2ADDR] = dalvik35_read_instr_mul_long_2addr, + [DOP35_DIV_LONG_2ADDR] = dalvik35_read_instr_div_long_2addr, + [DOP35_REM_LONG_2ADDR] = dalvik35_read_instr_rem_long_2addr, + [DOP35_AND_LONG_2ADDR] = dalvik35_read_instr_and_long_2addr, + [DOP35_OR_LONG_2ADDR] = dalvik35_read_instr_or_long_2addr, + [DOP35_XOR_LONG_2ADDR] = dalvik35_read_instr_xor_long_2addr, + [DOP35_SHL_LONG_2ADDR] = dalvik35_read_instr_shl_long_2addr, + [DOP35_SHR_LONG_2ADDR] = dalvik35_read_instr_shr_long_2addr, + [DOP35_USHR_LONG_2ADDR] = dalvik35_read_instr_ushr_long_2addr, + [DOP35_ADD_FLOAT_2ADDR] = dalvik35_read_instr_add_float_2addr, + [DOP35_SUB_FLOAT_2ADDR] = dalvik35_read_instr_sub_float_2addr, + [DOP35_MUL_FLOAT_2ADDR] = dalvik35_read_instr_mul_float_2addr, + [DOP35_DIV_FLOAT_2ADDR] = dalvik35_read_instr_div_float_2addr, + [DOP35_REM_FLOAT_2ADDR] = dalvik35_read_instr_rem_float_2addr, + [DOP35_ADD_DOUBLE_2ADDR] = dalvik35_read_instr_add_double_2addr, + [DOP35_SUB_DOUBLE_2ADDR] = dalvik35_read_instr_sub_double_2addr, + [DOP35_MUL_DOUBLE_2ADDR] = dalvik35_read_instr_mul_double_2addr, + [DOP35_DIV_DOUBLE_2ADDR] = dalvik35_read_instr_div_double_2addr, + [DOP35_REM_DOUBLE_2ADDR] = dalvik35_read_instr_rem_double_2addr, + [DOP35_ADD_INT_LIT16] = dalvik35_read_instr_add_int_lit16, + [DOP35_RSUB_INT] = dalvik35_read_instr_rsub_int, + [DOP35_MUL_INT_LIT16] = dalvik35_read_instr_mul_int_lit16, + [DOP35_DIV_INT_LIT16] = dalvik35_read_instr_div_int_lit16, + [DOP35_REM_INT_LIT16] = dalvik35_read_instr_rem_int_lit16, + [DOP35_AND_INT_LIT16] = dalvik35_read_instr_and_int_lit16, + [DOP35_OR_INT_LIT16] = dalvik35_read_instr_or_int_lit16, + [DOP35_XOR_INT_LIT16] = dalvik35_read_instr_xor_int_lit16, + [DOP35_ADD_INT_LIT8] = dalvik35_read_instr_add_int_lit8, + [DOP35_RSUB_INT_LIT8] = dalvik35_read_instr_rsub_int_lit8, + [DOP35_MUL_INT_LIT8] = dalvik35_read_instr_mul_int_lit8, + [DOP35_DIV_INT_LIT8] = dalvik35_read_instr_div_int_lit8, + [DOP35_REM_INT_LIT8] = dalvik35_read_instr_rem_int_lit8, + [DOP35_AND_INT_LIT8] = dalvik35_read_instr_and_int_lit8, + [DOP35_OR_INT_LIT8] = dalvik35_read_instr_or_int_lit8, + [DOP35_XOR_INT_LIT8] = dalvik35_read_instr_xor_int_lit8, + [DOP35_SHL_INT_LIT8] = dalvik35_read_instr_shl_int_lit8, + [DOP35_SHR_INT_LIT8] = dalvik35_read_instr_shr_int_lit8, + [DOP35_USHR_INT_LIT8] = dalvik35_read_instr_ushr_int_lit8, + [DOP35_UNUSED_E3] = dalvik35_read_instr_unused_e3, + [DOP35_UNUSED_E4] = dalvik35_read_instr_unused_e4, + [DOP35_UNUSED_E5] = dalvik35_read_instr_unused_e5, + [DOP35_UNUSED_E6] = dalvik35_read_instr_unused_e6, + [DOP35_UNUSED_E7] = dalvik35_read_instr_unused_e7, + [DOP35_UNUSED_E8] = dalvik35_read_instr_unused_e8, + [DOP35_UNUSED_E9] = dalvik35_read_instr_unused_e9, + [DOP35_UNUSED_EA] = dalvik35_read_instr_unused_ea, + [DOP35_UNUSED_EB] = dalvik35_read_instr_unused_eb, + [DOP35_UNUSED_EC] = dalvik35_read_instr_unused_ec, + [DOP35_UNUSED_ED] = dalvik35_read_instr_unused_ed, + [DOP35_UNUSED_EE] = dalvik35_read_instr_unused_ee, + [DOP35_UNUSED_EF] = dalvik35_read_instr_unused_ef, + [DOP35_UNUSED_F0] = dalvik35_read_instr_unused_f0, + [DOP35_UNUSED_F1] = dalvik35_read_instr_unused_f1, + [DOP35_UNUSED_F2] = dalvik35_read_instr_unused_f2, + [DOP35_UNUSED_F3] = dalvik35_read_instr_unused_f3, + [DOP35_UNUSED_F4] = dalvik35_read_instr_unused_f4, + [DOP35_UNUSED_F5] = dalvik35_read_instr_unused_f5, + [DOP35_UNUSED_F6] = dalvik35_read_instr_unused_f6, + [DOP35_UNUSED_F7] = dalvik35_read_instr_unused_f7, + [DOP35_UNUSED_F8] = dalvik35_read_instr_unused_f8, + [DOP35_UNUSED_F9] = dalvik35_read_instr_unused_f9, + [DOP35_UNUSED_FA] = dalvik35_read_instr_unused_fa, + [DOP35_UNUSED_FB] = dalvik35_read_instr_unused_fb, + [DOP35_UNUSED_FC] = dalvik35_read_instr_unused_fc, + [DOP35_UNUSED_FD] = dalvik35_read_instr_unused_fd, + [DOP35_UNUSED_FE] = dalvik35_read_instr_unused_fe, + [DOP35_UNUSED_FF] = dalvik35_read_instr_unused_ff, + + }; + + /* Données brutes associées à une instruction ? */ + + result = g_dalvik_context_get_raw_data(ctx, content, pos); + + if (result != NULL) goto gdpd_done; + + /* Pseudo-instruction... */ + + if (!g_binary_content_read_u8(content, pos, &raw8)) + return NULL; + + result = g_dalvik_processor_disassemble_pseudo(proc, ctx, content, pos, raw8); + + if (result != NULL) goto gdpd_done; + + /* ... ou instruction classique */ + + assert(raw8 < DOP35_COUNT); + + id = (Dalvik35Opcodes)raw8; + + result = decodings[id](proc, G_PROC_CONTEXT(ctx), content, pos, format); + + gdpd_done: + + return result; + +} diff --git a/plugins/dalvik/v35/processor.h b/plugins/dalvik/v35/processor.h new file mode 100644 index 0000000..c7930de --- /dev/null +++ b/plugins/dalvik/v35/processor.h @@ -0,0 +1,55 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * processor.h - prototypes pour la manipulation du processeur de la VM Dalvik + * + * Copyright (C) 2018 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Chrysalide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +#ifndef _PLUGINS_DALVIK_V35_PROCESSOR_H +#define _PLUGINS_DALVIK_V35_PROCESSOR_H + + +#include <arch/processor.h> + + + +#define G_TYPE_DALVIK35_PROCESSOR g_dalvik35_processor_get_type() +#define G_DALVIK35_PROCESSOR(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), G_TYPE_DALVIK35_PROCESSOR, GDalvik35Processor)) +#define G_IS_DALVIK35_PROCESSOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), G_TYPE_DALVIK35_PROCESSOR)) +#define G_DALVIK35_PROCESSOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_DALVIK35_PROCESSOR, GDalvik35ProcessorClass)) +#define G_IS_DALVIK35_PROCESSOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_DALVIK35_PROCESSOR)) +#define G_DALVIK35_PROCESSOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_DALVIK35_PROCESSOR, GDalvik35ProcessorClass)) + + +/* Définition du processeur de la VM Dalvik v35 (instance) */ +typedef struct _GDalvik35Processor GDalvik35Processor; + +/* Définition du processeur de la VM Dalvik v35 (classe) */ +typedef struct _GDalvik35ProcessorClass GDalvik35ProcessorClass; + + +/* Indique le type défini par la GLib pour le processeur Dalvik v35. */ +GType g_dalvik35_processor_get_type(void); + +/* Crée le support de l'architecture Dalvik v35. */ +GArchProcessor *g_dalvik35_processor_new(void); + + + +#endif /* _PLUGINS_DALVIK_V35_PROCESSOR_H */ diff --git a/plugins/dex/dex-int.c b/plugins/dex/dex-int.c index 3f3eccb..3a69bb2 100644 --- a/plugins/dex/dex-int.c +++ b/plugins/dex/dex-int.c @@ -32,7 +32,7 @@ #include <common/endianness.h> -#include <plugins/dalvik/instruction-def.h> +#include <plugins/dalvik/pseudo/identifiers.h> diff --git a/plugins/dex/format.c b/plugins/dex/format.c index fc49a15..44e9c0a 100755 --- a/plugins/dex/format.c +++ b/plugins/dex/format.c @@ -336,7 +336,7 @@ static SourceEndian g_dex_format_get_endianness(const GDexFormat *format) static const char *g_dex_format_get_target_machine(const GDexFormat *format) { - return "dalvik"; + return "dalvik35"; } |