Comments (10)
0x1179: "CMPSS",
is also missing in distorm3.Mnemonics
Original comment by [email protected]
on 24 Jan 2012 at 8:43
from distorm.
The same happens for normal (without REX prefix) version:
>>> i = distorm3.Decompose(0x0000000001646b2e, "f30fc2ce06".decode('hex'),
distorm3.Decode64Bits)[0]
>>> i.opcode
9: 4474
>>> i.mnemonic
10: 'UNDEFINED'
>>> i.valid
11: True
0x1179: "CMPSS",
is also missing in distorm3.Mnemonics
Original comment by [email protected]
on 24 Jan 2012 at 8:50
from distorm.
This issue and issue 30 seem to be caused by this line:
http://code.google.com/p/distorm/source/browse/trunk/src/decoder.c#296
di->opcode = ii->opcodeId + cmpType;
The index into the _MNEMONICS array is being offset by cmpType which has a
value of 0-7 bytes. For the extended mnemonics of the cmpss/cmpsd/cmpps/cmppd
instructions, we really want to offset by 0-7 mnemonics.
Original comment by [email protected]
on 7 Feb 2012 at 5:28
from distorm.
Here's a possible fix:
int i;
unsigned int stringOffset = 0;
/*
* The _MNEMONICS string contains pascal-style strings with the length of each mnemonic specified.
* We will sum each mnemonic length to arrive at the final mnemonic offset.
*/
for (i=0; i<cmpType; i++) {
/* +1 is for the null terminator, +1 is for the length byte itself */
if (_MNEMONICS_SIZE <= (ii->opcodeId + stringOffset)) goto _Undecodable;
stringOffset += _MNEMONICS[ii->opcodeId + stringOffset] + 2;
}
if (_MNEMONICS_SIZE <= (ii->opcodeId + stringOffset)) goto _Undecodable;
di->opcode = ii->opcodeId + stringOffset;
I added _MNEMONICS_SIZE to mnemonics.c for safety checking:
const unsigned int _MNEMONICS_SIZE = sizeof(_MNEMONICS);
Original comment by [email protected]
on 7 Feb 2012 at 5:31
from distorm.
Issue 30 has been merged into this issue.
Original comment by [email protected]
on 26 Feb 2012 at 11:38
from distorm.
Original comment by [email protected]
on 26 Feb 2012 at 11:38
- Changed state: Accepted
from distorm.
Original comment by [email protected]
on 26 Feb 2012 at 3:55
- Added labels: Priority-High
- Removed labels: Priority-Medium
from distorm.
Sanjay, thanks for your patch suggestion, but I used another way that doesn't
need to loop - just another static table to look up the offsets.
Original comment by [email protected]
on 27 Feb 2012 at 5:37
- Changed state: Fixed
from distorm.
This issue was closed by revision r195.
Original comment by [email protected]
on 27 Feb 2012 at 6:05
from distorm.
This issue was closed by revision r197.
Original comment by [email protected]
on 28 Feb 2012 at 2:53
from distorm.
Related Issues (20)
- The 'offset' parameter of "CSample" is no effect HOT 1
- modifiedFlagsMask HOT 5
- operand.type O_PTR/OPERAND_FAR_MEMORY wrong from py HOT 3
- Invalid decompose of FST/FSTP/FIST/FISTP HOT 2
- Wrong SAL/SAR affected flags HOT 2
- immediate sizes 64 bit HOT 2
- FLAG_LOCK not set when destination is a register HOT 2
- Operan size in FNSTCW HOT 3
- Operand size in PUSH IMM8 HOT 2
- Imm size is wrong for mov [dword ptr]rsp,0x42 HOT 3
- Unable to decode VEX-prefixed AVX vpermq instruction HOT 2
- Problem compiling Jdistorm HOT 2
- mov instruction with opcode 8e not supported? HOT 2
- UNDEFINED instruction HOT 2
- Incorrect RDRAND disassembly - missing register HOT 2
- Undefined Output for add DWORD PTR [r8+0x4b00],ebx HOT 3
- operands not decoded fully, python binding HOT 1
- pip version is a pre-release version HOT 5
- PUSH on amd64
- MOVSX ? UNDEFINED
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from distorm.