Open DiamondHunters opened 8 months ago
DYLD_PRINT_LIBRARIES=1 python -c 'import capstone'
library load:
dyld[18101]: <81B692C8-CFD7-3ADD-842D-AA9DFA176748> [delete]/.venv11/lib/python3.11/site-packages/capstone/lib/libcapstone.dylib
cs_version of this lib(decompiled by IDA):
__int64 __fastcall cs_version(_DWORD *a1, _DWORD *a2)
{
if ( a1 && a2 )
{
*a1 = 5;
*a2 = 0;
}
return 1280LL;
}
I also tried forcing python to loading libcapstone.5.dylib which bundle with cstool and get the same result so I think python bindings use the correct library but always gave wrong result.that's so weird
next branch could get correct result,but a lot of symbols was changed,It's heavy to refactor code.
version : 5.0.0
****************
Platform: ARM-64
Code: 2bb94239
Disasm:
0x0: ldrb w11, [x9, #0xae]
op_count: 2
operands[0].type: REG = w11
operands[0].access: WRITE
operands[1].type: MEM
operands[1].mem.base: REG = x9
operands[1].mem.disp: 0x0xae
operands[1].access: READ
Registers read: x9
Registers modified: w11
0x4:
If you want to use next
branch, you can refer to the release guide for v6 (see "Note about AArch64" section).
There we document how to use the meta-programming macros to make the refactor easier.
release guide for v6
thanks
It's similar to https://github.com/capstone-engine/capstone/issues/2260 cstool and python binding are the same version but give different results.
python binding api will lost the mem operand python code(modified from capstone arm64 test):
but cstool gave the correct result: