In what mode did you try to disassemble (16/32/64)?
32
What is the input buffer (binary stream) you used to reproduce the problem?
Use hex.
unsigned char rawData[] =
{
0xFF, 0x55, 0x8b, 0xec ,0x8b ,0x45 ,0x08 ,0x03 ,0x45 ,0x0c ,0xc9 ,0xc3
} ;
What is the expected output (or what instruction)?
0x00000000 (01) 55 PUSH EBP
0x00000001 (02) 8bec MOV EBP, ESP
0x00000003 (03) 8b4508 MOV EAX, [EBP+0x8]
0x00000006 (03) 03450c ADD EAX, [EBP+0xc]
0x00000009 (01) c9 LEAVE
0x0000000A (01) c3 RET
Which tool did you use to see the expected output?
VS 2010
What do you see instead?
0x00000001 (03) ff558b CALL DWORD [EBP-0x75]
0x00000004 (01) ec IN AL, DX
0x00000005 (03) 8b4508 MOV EAX, [EBP+0x8]
0x00000008 (03) 03450c ADD EAX, [EBP+0xc]
0x0000000B (01) c9 LEAVE
What version of diStorm are you using? On what platform (Python/EXE/other)?
Revision 204, VS 2010 SP1, EXE
Please provide any additional information below.
Test Code:
_DecodeResult res;
_DecodedInst decodedInstructions[1000];
unsigned int decodedInstructionsCount = 0, i = 0;
_OffsetType offset = 0;
unsigned int dver = distorm_version();
printf("diStorm version: %d.%d.%d\n", (dver >> 16), ((dver) >> 8) & 0xff, dver & 0xff);
unsigned char rawData[] =
{
0xFF, 0x55, 0x8b, 0xec ,0x8b ,0x45 ,0x08 ,0x03 ,0x45 ,0x0c ,0xc9 ,0xc3
} ;
res = distorm_decode(offset+1, (const unsigned char*)rawData, sizeof(rawData)-1, Decode32Bits, decodedInstructions, MAX_INSTRUCTIONS, &decodedInstructionsCount);
for (int i = 0; i < decodedInstructionsCount; i++) {
#ifdef _AMD64_
printf("%08I64x (%02d) %-24s %s%s%s\r\n", decodedInstructions[i].offset, decodedInstructions[i].size, (char*)decodedInstructions[i].instructionHex.p, (char*)decodedInstructions[i].mnemonic.p, decodedInstructions[i].operands.length != 0 ? " " : "", (char*)decodedInstructions[i].operands.p);
#else
printf("0x%08X (%02d) %-24s %s%s%s\r\n", decodedInstructions[i].offset, decodedInstructions[i].size, (char*)decodedInstructions[i].instructionHex.p, (char*)decodedInstructions[i].mnemonic.p, decodedInstructions[i].operands.length != 0 ? " " : "", (char*)decodedInstructions[i].operands.p);
#endif
}