Permalink
Browse files

Updated instructions tables

  • Loading branch information...
1 parent 69c6821 commit 13208f38a27a62ca67772f81625a283d38fbd6c3 distorm committed Sep 21, 2012
View
@@ -22,5 +22,4 @@ src\textdefs.c
src\textdefs.h
src\wstring.c
src\wstring.h
-src\x86defs.c
src\x86defs.h
View
@@ -192,7 +192,7 @@ def DumpMnemonics():
# Used for Python/Java dictionary of opcodeIds-->mnemonics.
#CreatePythonDict(mnemonicsIds)
- #CreateJavaDict(mnemonicsIds)
+ CreateJavaDict(mnemonicsIds)
O_NONE = 0
# REG standalone
@@ -707,7 +707,6 @@ def CreateTables(db):
if x.tag in ["_0F_0F", "_0F", "_0F_3A", "_0F_38"]:
# Store the index of these special tables, they are used directly in instructions.c.
externTables.append((x.tag, len(InstructionsTree)))
- #print x.tag
# Notice we use GenBlock for the special instructions, this is a must, otherwise we miss instructions from the DB.
for i in x86db.GenBlock(x):
if isinstance(i, x86db.InstructionInfo):
@@ -726,7 +725,7 @@ def CreateTables(db):
else:
# False indicates this entry points nothing.
InstructionsTree.append((0, ""))
- s = ["\n".join(["_InstInfo II_%s =%s;" % (i.mnemonics[0], FormatInstruction(i)[0]) for i in db.getExportedInstructions()]),
+ s = ["\n".join(["_InstInfo II_%s =%s;" % (i.mnemonics[0] if i.mnemonics[0][0] != '_' else i.mnemonics[0][1:], FormatInstruction(i)[0]) for i in db.getExportedInstructions()]),
"_iflags FlagsTable[%d] = {\n%s\n};" % (len(flagsDict), ",\n".join(["0x%x" % i[1] for i in sorted(zip(flagsDict.values(), flagsDict.keys()))])),
"\n".join(["_InstNode Table%s = %d;" % (i[0], i[1]) for i in externTables]),
"_InstInfo InstInfos[%d] = {\n%s\n};" % (len(InstInfos), ",\n".join(InstInfos)),
Oops, something went wrong.
@@ -120,6 +120,7 @@ public static OpcodeEnum lookup(int op)
mOpcodes.put(0xcf5, OpcodeEnum.CVTPS2DQ);
mOpcodes.put(0x24af, OpcodeEnum.PBLENDW);
mOpcodes.put(0x21ae, OpcodeEnum.VFMSUBADD213PS);
+ mOpcodes.put(0x2542, OpcodeEnum.VPINSRB);
mOpcodes.put(0xe76, OpcodeEnum.PCMPGTB);
mOpcodes.put(0xe9c, OpcodeEnum.PCMPGTD);
mOpcodes.put(0x23d7, OpcodeEnum.VAESENC);
@@ -161,7 +162,6 @@ public static OpcodeEnum lookup(int op)
mOpcodes.put(0x145, OpcodeEnum.RET);
mOpcodes.put(0xffa, OpcodeEnum.VPCMPEQD);
mOpcodes.put(0x1fc3, OpcodeEnum.VPMINSD);
- mOpcodes.put(0x2542, OpcodeEnum.VPINSRB);
mOpcodes.put(0xfd4, OpcodeEnum.VPCMPEQB);
mOpcodes.put(0x18fa, OpcodeEnum.ADDSUBPD);
mOpcodes.put(0x22a6, OpcodeEnum.VFMADDSUB231PS);
@@ -544,6 +544,7 @@ public static OpcodeEnum lookup(int op)
mOpcodes.put(0x571, OpcodeEnum.FUCOMPP);
mOpcodes.put(0x84e, OpcodeEnum.VMOVUPD);
mOpcodes.put(0x816, OpcodeEnum.PSWAPD);
+ mOpcodes.put(0x247f, OpcodeEnum.VROUNDSD);
mOpcodes.put(0x1c33, OpcodeEnum.PADDW);
mOpcodes.put(0x1b70, OpcodeEnum.PSLLD);
mOpcodes.put(0x740, OpcodeEnum.SWAPGS);
@@ -583,7 +584,6 @@ public static OpcodeEnum lookup(int op)
mOpcodes.put(0x1262, OpcodeEnum.VCMPLEPS);
mOpcodes.put(0x1983, OpcodeEnum.PMOVMSKB);
mOpcodes.put(0x254b, OpcodeEnum.INSERTPS);
- mOpcodes.put(0x2732, OpcodeEnum._3DNOW);
mOpcodes.put(0x25fe, OpcodeEnum.PCMPESTRI);
mOpcodes.put(0x272c, OpcodeEnum.WAIT);
mOpcodes.put(0x152b, OpcodeEnum.VCMPFALSE_OSPD);
@@ -603,6 +603,7 @@ public static OpcodeEnum lookup(int op)
mOpcodes.put(0x154, OpcodeEnum.ENTER);
mOpcodes.put(0x2423, OpcodeEnum.MOVBE);
mOpcodes.put(0x1016, OpcodeEnum.VZEROALL);
+ mOpcodes.put(0x2732, OpcodeEnum._3DNOW);
mOpcodes.put(0xd9c, OpcodeEnum.VMINSD);
mOpcodes.put(0x15f9, OpcodeEnum.VCMPNEQ_OQSS);
mOpcodes.put(0x7e4, OpcodeEnum.PFSUBR);
@@ -856,7 +857,6 @@ public static OpcodeEnum lookup(int op)
mOpcodes.put(0x13d1, OpcodeEnum.VCMPTRUE_USPS);
mOpcodes.put(0x76c, OpcodeEnum.PI2FD);
mOpcodes.put(0x1e08, OpcodeEnum.PABSB);
- mOpcodes.put(0x247f, OpcodeEnum.VROUNDSD);
mOpcodes.put(0x1a10, OpcodeEnum.VPANDN);
mOpcodes.put(0xe55, OpcodeEnum.VPUNPCKLDQ);
mOpcodes.put(0x62a, OpcodeEnum.FDIVP);
View
@@ -1,4 +1,4 @@
-/* diStorm3 3.2 */
+/* diStorm3 3.3 */
/*
distorm.h
View
@@ -53,29 +53,28 @@ extern const _WRegister _REGISTERS[];
#define GET_MNEMONIC_NAME(m) ((_WMnemonic*)&_MNEMONICS[(m)])->p
typedef enum {
- I_UNDEFINED = 0, I_3DNOW = 10034, I_AAA = 66, I_AAD = 389, I_AAM = 384, I_AAS = 76, I_ADC = 31,
- I_ADD = 11, I_ADDPD = 3110, I_ADDPS = 3103, I_ADDSD = 3124, I_ADDSS = 3117,
- I_ADDSUBPD = 6394, I_ADDSUBPS = 6404, I_AESDEC = 9209, I_AESDECLAST = 9226,
- I_AESENC = 9167, I_AESENCLAST = 9184, I_AESIMC = 9150, I_AESKEYGENASSIST = 9795,
- I_AND = 41, I_ANDNPD = 3021, I_ANDNPS = 3013, I_ANDPD = 2990, I_ANDPS = 2983,
- I_ARPL = 111, I_BLENDPD = 9372, I_BLENDPS = 9353, I_BLENDVPD = 7619, I_BLENDVPS = 7609,
- I_BOUND = 104, I_BSF = 4346, I_BSR = 4358, I_BSWAP = 960, I_BT = 872, I_BTC = 934,
- I_BTR = 912, I_BTS = 887, I_CALL = 456, I_CALL_FAR = 260, I_CBW = 228, I_CDQ = 250,
- I_CDQE = 239, I_CLC = 492, I_CLD = 512, I_CLFLUSH = 4329, I_CLGI = 1833, I_CLI = 502,
- I_CLTS = 541, I_CMC = 487, I_CMOVA = 694, I_CMOVAE = 663, I_CMOVB = 656, I_CMOVBE = 686,
- I_CMOVG = 754, I_CMOVGE = 738, I_CMOVL = 731, I_CMOVLE = 746, I_CMOVNO = 648,
- I_CMOVNP = 723, I_CMOVNS = 708, I_CMOVNZ = 678, I_CMOVO = 641, I_CMOVP = 716,
- I_CMOVS = 701, I_CMOVZ = 671, I_CMP = 71, I_CMPEQPD = 4449, I_CMPEQPS = 4370,
- I_CMPEQSD = 4607, I_CMPEQSS = 4528, I_CMPLEPD = 4467, I_CMPLEPS = 4388, I_CMPLESD = 4625,
- I_CMPLESS = 4546, I_CMPLTPD = 4458, I_CMPLTPS = 4379, I_CMPLTSD = 4616, I_CMPLTSS = 4537,
- I_CMPNEQPD = 4488, I_CMPNEQPS = 4409, I_CMPNEQSD = 4646, I_CMPNEQSS = 4567,
- I_CMPNLEPD = 4508, I_CMPNLEPS = 4429, I_CMPNLESD = 4666, I_CMPNLESS = 4587,
- I_CMPNLTPD = 4498, I_CMPNLTPS = 4419, I_CMPNLTSD = 4656, I_CMPNLTSS = 4577,
- I_CMPORDPD = 4518, I_CMPORDPS = 4439, I_CMPORDSD = 4676, I_CMPORDSS = 4597,
- I_CMPS = 301, I_CMPUNORDPD = 4476, I_CMPUNORDPS = 4397, I_CMPUNORDSD = 4634,
- I_CMPUNORDSS = 4555, I_CMPXCHG = 898, I_CMPXCHG16B = 6373, I_CMPXCHG8B = 6362,
- I_COMISD = 2779, I_COMISS = 2771, I_CPUID = 865, I_CQO = 255, I_CRC32 = 9258,
- I_CVTDQ2PD = 6787, I_CVTDQ2PS = 3307, I_CVTPD2DQ = 6797, I_CVTPD2PI = 2681,
+ I_UNDEFINED = 0, I_AAA = 66, I_AAD = 389, I_AAM = 384, I_AAS = 76, I_ADC = 31, I_ADD = 11, I_ADDPD = 3110,
+ I_ADDPS = 3103, I_ADDSD = 3124, I_ADDSS = 3117, I_ADDSUBPD = 6394, I_ADDSUBPS = 6404,
+ I_AESDEC = 9209, I_AESDECLAST = 9226, I_AESENC = 9167, I_AESENCLAST = 9184,
+ I_AESIMC = 9150, I_AESKEYGENASSIST = 9795, I_AND = 41, I_ANDNPD = 3021, I_ANDNPS = 3013,
+ I_ANDPD = 2990, I_ANDPS = 2983, I_ARPL = 111, I_BLENDPD = 9372, I_BLENDPS = 9353,
+ I_BLENDVPD = 7619, I_BLENDVPS = 7609, I_BOUND = 104, I_BSF = 4346, I_BSR = 4358,
+ I_BSWAP = 960, I_BT = 872, I_BTC = 934, I_BTR = 912, I_BTS = 887, I_CALL = 456,
+ I_CALL_FAR = 260, I_CBW = 228, I_CDQ = 250, I_CDQE = 239, I_CLC = 492, I_CLD = 512,
+ I_CLFLUSH = 4329, I_CLGI = 1833, I_CLI = 502, I_CLTS = 541, I_CMC = 487, I_CMOVA = 694,
+ I_CMOVAE = 663, I_CMOVB = 656, I_CMOVBE = 686, I_CMOVG = 754, I_CMOVGE = 738,
+ I_CMOVL = 731, I_CMOVLE = 746, I_CMOVNO = 648, I_CMOVNP = 723, I_CMOVNS = 708,
+ I_CMOVNZ = 678, I_CMOVO = 641, I_CMOVP = 716, I_CMOVS = 701, I_CMOVZ = 671,
+ I_CMP = 71, I_CMPEQPD = 4449, I_CMPEQPS = 4370, I_CMPEQSD = 4607, I_CMPEQSS = 4528,
+ I_CMPLEPD = 4467, I_CMPLEPS = 4388, I_CMPLESD = 4625, I_CMPLESS = 4546, I_CMPLTPD = 4458,
+ I_CMPLTPS = 4379, I_CMPLTSD = 4616, I_CMPLTSS = 4537, I_CMPNEQPD = 4488, I_CMPNEQPS = 4409,
+ I_CMPNEQSD = 4646, I_CMPNEQSS = 4567, I_CMPNLEPD = 4508, I_CMPNLEPS = 4429,
+ I_CMPNLESD = 4666, I_CMPNLESS = 4587, I_CMPNLTPD = 4498, I_CMPNLTPS = 4419,
+ I_CMPNLTSD = 4656, I_CMPNLTSS = 4577, I_CMPORDPD = 4518, I_CMPORDPS = 4439,
+ I_CMPORDSD = 4676, I_CMPORDSS = 4597, I_CMPS = 301, I_CMPUNORDPD = 4476, I_CMPUNORDPS = 4397,
+ I_CMPUNORDSD = 4634, I_CMPUNORDSS = 4555, I_CMPXCHG = 898, I_CMPXCHG16B = 6373,
+ I_CMPXCHG8B = 6362, I_COMISD = 2779, I_COMISS = 2771, I_CPUID = 865, I_CQO = 255,
+ I_CRC32 = 9258, I_CVTDQ2PD = 6787, I_CVTDQ2PS = 3307, I_CVTPD2DQ = 6797, I_CVTPD2PI = 2681,
I_CVTPD2PS = 3233, I_CVTPH2PS = 4161, I_CVTPI2PD = 2495, I_CVTPI2PS = 2485,
I_CVTPS2DQ = 3317, I_CVTPS2PD = 3223, I_CVTPS2PH = 4171, I_CVTPS2PI = 2671,
I_CVTSD2SI = 2701, I_CVTSD2SS = 3253, I_CVTSI2SD = 2515, I_CVTSI2SS = 2505,
@@ -291,7 +290,7 @@ typedef enum {
I_WAIT = 10028, I_WBINVD = 561, I_WRFSBASE = 9931, I_WRGSBASE = 9960, I_WRMSR = 586,
I_XADD = 946, I_XCHG = 212, I_XGETBV = 1771, I_XLAT = 400, I_XOR = 61, I_XORPD = 3080,
I_XORPS = 3073, I_XRSTOR = 4273, I_XRSTOR64 = 4281, I_XSAVE = 4249, I_XSAVE64 = 4256,
- I_XSAVEOPT = 4299, I_XSAVEOPT64 = 4309, I_XSETBV = 1779
+ I_XSAVEOPT = 4299, I_XSAVEOPT64 = 4309, I_XSETBV = 1779, I__3DNOW = 10034
} _InstructionType;
typedef enum {
Oops, something went wrong.

0 comments on commit 13208f3

Please sign in to comment.