首页
论坛
课程
招聘
[个人备忘]通过vcpkg在windows平台构建Triton
2022-6-24 13:57 3358

[个人备忘]通过vcpkg在windows平台构建Triton

2022-6-24 13:57
3358

Triton:动态二进制分析库(地址)


 

安装vcpkg

1
2
3
git clone https://github.com/microsoft/vcpkg
cd vcpkg
.\bootstrap-vcpkg.bat

vcpkg安装依赖库Boost、capstone、z3

1
2
PS> "`r`nset(VCPKG_BUILD_TYPE release)" | Add-Content "$env:VCPKG_INSTALLATION_ROOT\triplets\x64-windows-static.cmake"
PS> vcpkg install capstone[x86,arm,arm64] z3 boost-multiprecision boost-numeric-conversion boost-math --triplet x64-windows-static

vcpkg集成

1
2
3
4
5
6
# 集成到全局
vcpkg integrate install
# 移除
vcpkg integrate remove
# 集成到工程
vcpkg integrate project

下载、构建Triton

  • 出现问题:https://github.com/JonathanSalwan/Triton/issues/1070

  • 修复PR:https://github.com/JonathanSalwan/Triton/pull/1072/files
    故Readme中的开关STATICLIB弃用了,新的开关叫MSVC_STATIC

1
2
3
4
5
6
7
PS> git clone https://github.com/JonathanSalwan/Triton
 
PS> cd Triton
 
PS> cmake -S . -B build_x64 -DCMAKE_INSTALL_PREFIX=install_dir -G "Visual Studio 16 2019" -A x64 -DPYTHON_BINDINGS=ON -DMSVC_STATIC=ON -DBOOST_INCLUDEDIR="$env:VCPKG_INSTALLATION_ROOT\installed\x64-windows-static\include" -DZ3_INCLUDE_DIRS="$env:VCPKG_INSTALLATION_ROOT\installed\x64-windows-static\include" -DZ3_LIBRARIES="$env:VCPKG_INSTALLATION_ROOT\installed\x64-windows-static\lib\libz3.lib" -DCAPSTONE_INCLUDE_DIRS="$env:VCPKG_INSTALLATION_ROOT\installed\x64-windows-static\include\capstone" -DCAPSTONE_LIBRARIES="$env:VCPKG_INSTALLATION_ROOT\installed\x64-windows-static\lib\capstone.lib"
 
PS> cmake --build build_x64 --target install --config Release --parallel 2

[2022冬季班]《安卓高级研修班(网课)》月薪三万班招生中~

收藏
点赞2
打赏
分享
最新回复 (0)
游客
登录 | 注册 方可回帖
返回