Closed vancaho closed 1 year ago
Are you compiling on M1? If you are on an Apple silicon, make sure the triton library is compiled in arm64 and x86_64. Or make sure your triton tool is compiled with the same arch than the library. It looks like your libtriton does not have x86_64 symbol because it's probably compiled on arm64 and your try to compile your tool on x64?
No, the CPU is Intel. I compiled triton according to the tutorial.
I run the nm
command to look for concreteRegister
, here is the output:
libtriton git:(master) ✗ nm -gU /usr/local/lib/libtriton.dylib | grep ConcreteRegister
00000000000072f0 T __ZN6triton4arch12Architecture24setConcreteRegisterValueERKNS0_8RegisterERKN5boost14multiprecision6numberINS6_8backends15cpp_int_backendILj512ELj512ELNS6_16cpp_integer_typeE0ELNS6_18cpp_int_check_typeE0EvEELNS6_26expression_template_optionE0EEEb
000000000009a400 T __ZN6triton4arch3arm5arm328Arm32Cpu24setConcreteRegisterValueERKNS0_8RegisterERKN5boost14multiprecision6numberINS8_8backends15cpp_int_backendILj512ELj512ELNS8_16cpp_integer_typeE0ELNS8_18cpp_int_check_typeE0EvEELNS8_26expression_template_optionE0EEEb
0000000000011630 T __ZN6triton4arch3arm7aarch6410AArch64Cpu24setConcreteRegisterValueERKNS0_8RegisterERKN5boost14multiprecision6numberINS8_8backends15cpp_int_backendILj512ELj512ELNS8_16cpp_integer_typeE0ELNS8_18cpp_int_check_typeE0EvEELNS8_26expression_template_optionE0EEEb
00000000000e5080 T __ZN6triton4arch3x866x86Cpu24setConcreteRegisterValueERKNS0_8RegisterERKN5boost14multiprecision6numberINS7_8backends15cpp_int_backendILj512ELj512ELNS7_16cpp_integer_typeE0ELNS7_18cpp_int_check_typeE0EvEELNS7_26expression_template_optionE0EEEb
00000000000ddf20 T __ZN6triton4arch3x868x8664Cpu24setConcreteRegisterValueERKNS0_8RegisterERKN5boost14multiprecision6numberINS7_8backends15cpp_int_backendILj512ELj512ELNS7_16cpp_integer_typeE0ELNS7_18cpp_int_check_typeE0EvEELNS7_26expression_template_optionE0EEEb
0000000000295d00 T __ZN6triton7Context24setConcreteRegisterValueERKNS_4arch8RegisterERKN5boost14multiprecision6numberINS6_8backends15cpp_int_backendILj512ELj512ELNS6_16cpp_integer_typeE0ELNS6_18cpp_int_check_typeE0EvEELNS6_26expression_template_optionE0EEEb
00000000000070c0 T __ZNK6triton4arch12Architecture24getConcreteRegisterValueERKNS0_8RegisterEb
0000000000099940 T __ZNK6triton4arch3arm5arm328Arm32Cpu24getConcreteRegisterValueERKNS0_8RegisterEb
000000000000cf70 T __ZNK6triton4arch3arm7aarch6410AArch64Cpu24getConcreteRegisterValueERKNS0_8RegisterEb
00000000000e37e0 T __ZNK6triton4arch3x866x86Cpu24getConcreteRegisterValueERKNS0_8RegisterEb
00000000000dbee0 T __ZNK6triton4arch3x868x8664Cpu24getConcreteRegisterValueERKNS0_8RegisterEb
0000000000295810 T __ZNK6triton7Context24getConcreteRegisterValueERKNS_4arch8RegisterEb
Yeah, it outputs:
libtriton git:(master) ✗ file /usr/local/lib/libtriton.dylib
/usr/local/lib/libtriton.dylib: Mach-O 64-bit dynamically linked shared library x86_64
Mmmmh, maybe there is something wrong with Boost definition. When compiling Triton, you have the choice to compile with boost::multiprecision
or with wide_integer
(-DBOOST_INTERFACE=ON|OFF
). How did you compiled the libtriton
? Maybe the triton library is compiled without boost whereas your triton tool wants to link with boost definition?
If I can remember, I compile triton using the following command. The os is macos 13.4 (22F66)
$ git clone https://github.com/JonathanSalwan/Triton
$ cd Triton
$ mkdir build ; cd build
$ cmake ..
$ make -j3
$ sudo make install
Yeah, I recompiled triton with the -DBOOST_INTERFACE=ON
option, then it really works. Thanks very much Jonathan!
Hi, I want to use libtriton in my project. I copied the code in example\cmake, and add a line to set concrete value for
rax
, however it reports a link error:How to resolve this error?
Here are the source code:
Here is the cmakelists.txt file: