New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disassembly (capstone) messed up #459
Comments
Looks like it's a capstone issue. Capstone decodes the instruction
Can you please report this issue to the capstone support (cc @aquynh)? PoC from capstone import *
from capstone.x86 import *
# mov dword ptr [4], eax
CODE = b"\xa3\x04\x00\x00\x00"
md = Cs(CS_ARCH_X86, CS_MODE_32)
md.detail = True
for inst in md.disasm(CODE, 0x1000):
print("%x:\t%s\t%s" %(inst.address, inst.mnemonic, inst.op_str))
for op in inst.operands:
if op.type == X86_OP_REG:
print inst.reg_name(op.value.reg)
if op.type == X86_OP_MEM:
print 'mem' PS: Decoding |
It's fixed into their |
I'm having trouble building against that branch: D:\Projects\c++\Triton\src\libtriton\arch\x86\x86Specifications.cpp:2923:16: error: 'X86_INS_FCOMPI' is not a member of 'triton::extlibs::capstone' ...and the same error for X86_INS_VCMP, X86_INS_FUCOMPI, X86_INS_VBROADCASTI128 and X86_INS_VPCMP. |
Yep I know. You can remove these enums to solve this issue, but then, you will get others troubles because capstone defines some immediate operands with a size of 0... Actually, I cannot port Triton on capstone 4.x until the 4.x is not into their master branch. |
@gyorokpeter checkout dev-capstone-4.x. |
It works. I had to change the CMake config parameter from "D:/Projects/lib/capstone/include" to "D:/Projects/lib/capstone/include/capstone". |
Hi, compiling the project on Linux ubuntu 4.15.0-38-generic #41-Ubuntu SMP Wed Oct 10 10:59:38 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux I receive the same error due to Capstone. Was the dev-capstone-4.x branch removed? Below the error:
|
We merged the next branch into master branch long ago.
Can you try to use the master branch of Capstone now?
…On Tue, Nov 6, 2018, 00:33 Antonio Parata ***@***.*** wrote:
Hi,
compiling the project on *Linux ubuntu 4.15.0-38-generic #41
<#41>-Ubuntu SMP Wed Oct 10
10:59:38 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux* I receive the same
error due to Capstone. Was the *dev-capstone-4.x* branch removed?
Below the error:
Triton/build$ sudo make install
[ 1%] Built target gen-syscall64
[ 2%] Built target gen-syscall32
[ 3%] Building CXX object src/libtriton/CMakeFiles/triton.dir/api/api.cpp.o
[ 4%] Building CXX object src/libtriton/CMakeFiles/triton.dir/arch/irBuilder.cpp.o
[ 6%] Building CXX object src/libtriton/CMakeFiles/triton.dir/arch/operandWrapper.cpp.o
[ 7%] Building CXX object src/libtriton/CMakeFiles/triton.dir/arch/bitsVector.cpp.o
[ 8%] Building CXX object src/libtriton/CMakeFiles/triton.dir/arch/instruction.cpp.o
[ 9%] Building CXX object src/libtriton/CMakeFiles/triton.dir/arch/memoryAccess.cpp.o
[ 10%] Building CXX object src/libtriton/CMakeFiles/triton.dir/arch/x86/x8664Cpu.cpp.o
[ 12%] Building CXX object src/libtriton/CMakeFiles/triton.dir/arch/x86/x86Cpu.cpp.o
[ 13%] Building CXX object src/libtriton/CMakeFiles/triton.dir/arch/x86/x86Semantics.cpp.o
[ 14%] Building CXX object src/libtriton/CMakeFiles/triton.dir/arch/x86/x86Specifications.cpp.o
/Triton/src/libtriton/arch/x86/x86Specifications.cpp: In member function 'triton::uint32 triton::arch::x86::x86Specifications::capstoneInstructionToTritonInstruction(triton::uint32) const':
/Triton/src/libtriton/arch/x86/x86Specifications.cpp:1044:16: error: 'X86_INS_VCMP' is not a member of 'triton::extlibs::capstone'
case triton::extlibs::capstone::X86_INS_VCMP:
^
/Triton/src/libtriton/arch/x86/x86Specifications.cpp:3008:16: error: 'X86_INS_VBROADCASTI128' is not a member of 'triton::extlibs::capstone'
case triton::extlibs::capstone::X86_INS_VBROADCASTI128:
^
/Triton/src/libtriton/arch/x86/x86Specifications.cpp:4040:16: error: 'X86_INS_VPCMP' is not a member of 'triton::extlibs::capstone'
case triton::extlibs::capstone::X86_INS_VPCMP:
^
src/libtriton/CMakeFiles/triton.dir/build.make:360: recipe for target 'src/libtriton/CMakeFiles/triton.dir/arch/x86/x86Specifications.cpp.o' failed
make[2]: *** [src/libtriton/CMakeFiles/triton.dir/arch/x86/x86Specifications.cpp.o] Error 1
CMakeFiles/Makefile2:1148: recipe for target 'src/libtriton/CMakeFiles/triton.dir/all' failed
make[1]: *** [src/libtriton/CMakeFiles/triton.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#459 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFsG4GOOwtJyywRR6y2HWs8CUDssLB4Vks5usGhFgaJpZM4Lfw4N>
.
|
@enkomio can you please try the version 3.x of capstone. |
Hi, by installing Capstone 3.0.5 I was able to proceed, but now I received another error:
|
It should be a store access. The result is correct for the opposite direction, mov eax,[4].
The text was updated successfully, but these errors were encountered: