From 1d8c9de37c5816a40139af0be0c1c2b58a50c4b6 Mon Sep 17 00:00:00 2001 From: karlis Date: Mon, 15 Jun 2020 23:38:15 +0300 Subject: [PATCH] Link cutter r2ghidra decompiler against ghidra_core. --- .appveyor.yml | 6 ++++-- scripts/appveyor_r2ghidra.sh | 4 ++-- src/Cutter.pro | 2 ++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 86589ce7..4e67375e 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -54,12 +54,14 @@ before_build: # Build config build_script: - - cmd: if defined QMAKE ( call prepare_r2.bat && call build.bat CUTTER_APPVEYOR_R2DEC=true CUTTER_R2GHIDRA_STATIC=true R2GHIDRA_SOURCE="%APPVEYOR_BUILD_FOLDER%/r2ghidra-dec" CUTTER_ENABLE_CRASH_REPORTS=true CUTTER_ENABLE_PYTHON=true CUTTER_ENABLE_PYTHON_BINDINGS=true CUTTER_DEPS_DIR="%CUTTER_DEPS_DIR%" ) + - cmd: if defined QMAKE ( call prepare_r2.bat ) + - cmd: if defined QMAKE ( C:\msys64\usr\bin\bash -lc "export PATH=\"/c/msys64/usr/bin:$PATH\" && cd \"$APPVEYOR_BUILD_FOLDER\" && scripts/appveyor_r2ghidra.sh" ) + - cmd: if defined QMAKE ( call build.bat CUTTER_APPVEYOR_R2DEC=true CUTTER_R2GHIDRA_STATIC=true R2GHIDRA_SOURCE="%APPVEYOR_BUILD_FOLDER%/r2ghidra-dec" R2GHIDRA_INSTALL_PATH="%APPVEYOR_BUILD_FOLDER%/r2_dist_%ARCH%/radare2/lib/plugins" CUTTER_ENABLE_CRASH_REPORTS=true CUTTER_ENABLE_PYTHON=true CUTTER_ENABLE_PYTHON_BINDINGS=true CUTTER_DEPS_DIR="%CUTTER_DEPS_DIR%" ) - cmd: if defined MESON ( python meson.py --release --dist=%ARTIFACT_PATH% --backend=%BACKEND% --python ) after_build: - cmd: if defined QMAKE ( set "PATH=%CD%\r2_dist_%ARCH%\bin;%PATH%" && powershell scripts\bundle_r2dec.ps1 "%CD%\%ARTIFACT_PATH%" ) - - cmd: if defined QMAKE ( C:\msys64\usr\bin\bash -lc "export PATH=\"/c/msys64/usr/bin:$PATH\" && cd \"$APPVEYOR_BUILD_FOLDER\" && scripts/appveyor_r2ghidra.sh" ) + #- cmd: if defined QMAKE ( C:\msys64\usr\bin\bash -lc "export PATH=\"/c/msys64/usr/bin:$PATH\" && cd \"$APPVEYOR_BUILD_FOLDER\" && scripts/appveyor_r2ghidra.sh" ) #- cmd: powershell scripts\bundle_openssl.ps1 %ARCH% "%CD%\%ARTIFACT_PATH%" - cmd: powershell scripts\bundle_python.ps1 %ARCH% "%CD%\%ARTIFACT_PATH%" - cmd: xcopy "%CUTTER_DEPS_DIR%\pyside\lib\site-packages" "%ARTIFACT_PATH%\python36\site-packages" /e /i /h diff --git a/scripts/appveyor_r2ghidra.sh b/scripts/appveyor_r2ghidra.sh index af6fd2a8..5b479604 100755 --- a/scripts/appveyor_r2ghidra.sh +++ b/scripts/appveyor_r2ghidra.sh @@ -4,5 +4,5 @@ scripts/r2ghidra.sh \ -DCMAKE_C_COMPILER=cl \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_PREFIX_PATH="$APPVEYOR_BUILD_FOLDER/r2_dist_$ARCH;$APPVEYOR_BUILD_FOLDER/r2_dist_$ARCH/radare2;$QT64PATH" \ - -DCMAKE_INSTALL_PREFIX="$APPVEYOR_BUILD_FOLDER/$ARTIFACT_PATH/radare2" \ - -DRADARE2_INSTALL_PLUGDIR="$APPVEYOR_BUILD_FOLDER/$ARTIFACT_PATH/radare2/lib/plugins" \ No newline at end of file + -DCMAKE_INSTALL_PREFIX="$APPVEYOR_BUILD_FOLDER/r2_dist_$ARCH/radare2" \ + -DRADARE2_INSTALL_PLUGDIR="$APPVEYOR_BUILD_FOLDER/r2_dist_$ARCH/radare2/lib/plugins" \ No newline at end of file diff --git a/src/Cutter.pro b/src/Cutter.pro index 1271e620..3d95f8fa 100644 --- a/src/Cutter.pro +++ b/src/Cutter.pro @@ -283,6 +283,8 @@ CUTTER_R2GHIDRA_STATIC { SOURCES += $$R2GHIDRA_SOURCE/cutter-plugin/R2GhidraDecompiler.cpp HEADERS += $$R2GHIDRA_SOURCE/cutter-plugin/R2GhidraDecompiler.h INCLUDEPATH += $$R2GHIDRA_SOURCE/cutter-plugin + LIBS += -L$$R2GHIDRA_INSTALL_PATH -lcore_ghidra -ldelayimp + QMAKE_LFLAGS += /delayload:core_ghidra.dll } QMAKE_SUBSTITUTES += CutterConfig.h.in