You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
unsigned int opcode = di->opcode;
unsigned int prefix = FLAG_GET_PREFIX(di->flags);
mnemonic = (const _WMnemonic*)&_MNEMONICS[opcode]; <--
unsigned int size = di->size;
_OffsetType offset = di->addr & addrMask;
Visual C doesn't permit assignments before declarations in some instances. The solution is to move the flagged line to be after all declarations are completed, e.g.,
unsigned int opcode = di->opcode;
unsigned int prefix = FLAG_GET_PREFIX(di->flags);
unsigned int size = di->size;
mnemonic = (const _WMnemonic*)&_MNEMONICS[opcode]; <--
_OffsetType offset = di->addr & addrMask;
A similar issue exists in prefix.c, line 141:
for (unsigned int index = 0;
(ci->codeLen > 0) && (index < INST_MAXIMUM_SIZE);
ci->code++, ci->codeLen--, index++) {
Needs to be replaced with:
unsigned int index;
for (index = 0;
(ci->codeLen > 0) && (index < INST_MAXIMUM_SIZE);
ci->code++, ci->codeLen--, index++) {
C:\Users\testaccount\distorm>python setup.py --verbose build
running build
running build_py
not copying python\distorm3_generated.py (output up-to-date)
not copying python\distorm3_init_.py (output up-to-date)
not copying python\distorm3_main_.py (output up-to-date)
running build_ext
Importing new compiler from distutils.msvc9compiler
building '_distorm3' extension
Calling 'vcvarsall.bat x86' (version=9.0)
C:\Users\testaccount\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DSUPPORT_64BIT_OFFSET -DDISTORM_DYNAMIC -Isrc -Iinclude -IC:\Python27\include -IC:\Python27\PC /Tcsrc\decoder.c /Fobuild\temp.win32-2.7\Release\src\decoder.obj
decoder.c
C:\Users\testaccount\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DSUPPORT_64BIT_OFFSET -DDISTORM_DYNAMIC -Isrc -Iinclude -IC:\Python27\include -IC:\Python27\PC /Tcsrc\distorm.c /Fobuild\temp.win32-2.7\Release\src\distorm.obj
distorm.c
src\distorm.c(320) : error C2143: syntax error : missing ';' before 'type'
src\distorm.c(321) : error C2275: '_OffsetType' : illegal use of this type as an expression
c:\users\testaccount\distorm\src../include/distorm.h(110) : see declaration of '_OffsetType'
src\distorm.c(321) : error C2146: syntax error : missing ';' before identifier 'offset'
src\distorm.c(321) : error C2065: 'offset' : undeclared identifier
src\distorm.c(321) : warning C4244: '=' : conversion from 'const _OffsetType' to 'int', possible loss of data
src\distorm.c(345) : error C2065: 'offset' : undeclared identifier
src\distorm.c(346) : error C2065: 'size' : undeclared identifier
error: command '"C:\Users\testaccount\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe"' failed with exit status 2
The text was updated successfully, but these errors were encountered: