mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-19 10:58:51 +00:00
Yara plugin + fix linuxdeployqt plugins (#2924)
This commit is contained in:
parent
266db132aa
commit
544b904c2c
9
.github/workflows/ccpp.yml
vendored
9
.github/workflows/ccpp.yml
vendored
@ -124,6 +124,7 @@ jobs:
|
|||||||
-DCUTTER_ENABLE_DEPENDENCY_DOWNLOADS=ON \
|
-DCUTTER_ENABLE_DEPENDENCY_DOWNLOADS=ON \
|
||||||
-DCUTTER_PACKAGE_RZ_GHIDRA=ON \
|
-DCUTTER_PACKAGE_RZ_GHIDRA=ON \
|
||||||
-DCUTTER_PACKAGE_RZ_LIBSWIFT=ON \
|
-DCUTTER_PACKAGE_RZ_LIBSWIFT=ON \
|
||||||
|
-DCUTTER_PACKAGE_RZ_LIBYARA=ON \
|
||||||
-DCMAKE_INSTALL_PREFIX=appdir/usr \
|
-DCMAKE_INSTALL_PREFIX=appdir/usr \
|
||||||
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON \
|
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON \
|
||||||
..
|
..
|
||||||
@ -142,20 +143,16 @@ jobs:
|
|||||||
ninja install
|
ninja install
|
||||||
"../scripts/appimage_embed_python.sh" appdir
|
"../scripts/appimage_embed_python.sh" appdir
|
||||||
APP_PREFIX=`pwd`/appdir/usr
|
APP_PREFIX=`pwd`/appdir/usr
|
||||||
# export LD_LIBRARY_PATH=${APP_PREFIX}/lib:$Shiboken2_ROOT/lib
|
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$APP_PREFIX/lib/rizin/plugins"
|
||||||
export PATH=$PATH:${APP_PREFIX}/bin
|
export PATH=$PATH:${APP_PREFIX}/bin
|
||||||
"../scripts/jsdec.sh" --prefix=`pwd`/appdir/usr
|
|
||||||
wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"
|
wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"
|
||||||
chmod a+x linuxdeployqt*.AppImage
|
chmod a+x linuxdeployqt*.AppImage
|
||||||
rm -fv "../cutter-deps/qt/plugins/imageformats/libqjp2.so"
|
rm -fv "../cutter-deps/qt/plugins/imageformats/libqjp2.so"
|
||||||
# ./linuxdeployqt*.AppImage ./appdir/usr/share/applications/*.desktop -executable=./appdir/usr/bin/python3 -bundle-non-qt-libs -no-strip -exclude-libs=libnss3.so,libnssutil3.so,libqjp2.so -ignore-glob=usr/lib/python3.9/**/* -verbose=2
|
|
||||||
# exclude librzghidra cutter plugin because cutter and rz plugin is loaded manuallly as they are plugins linuxdeployqt doesn't know this
|
|
||||||
./linuxdeployqt*.AppImage ./appdir/usr/share/applications/*.desktop \
|
./linuxdeployqt*.AppImage ./appdir/usr/share/applications/*.desktop \
|
||||||
-executable=./appdir/usr/bin/python3 \
|
-executable=./appdir/usr/bin/python3 \
|
||||||
-appimage \
|
-appimage \
|
||||||
-no-strip -exclude-libs=libnss3.so,libnssutil3.so,libqjp2.so \
|
-no-strip -exclude-libs=libnss3.so,libnssutil3.so,libqjp2.so \
|
||||||
-ignore-glob=usr/lib/python3.9/**/* \
|
-ignore-glob=usr/lib/python3.9/**/* \
|
||||||
-ignore-glob=usr/share/rizin/cutter/plugins/native/librz_ghidra_cutter.so \
|
|
||||||
-verbose=2
|
-verbose=2
|
||||||
find ./appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq
|
find ./appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq
|
||||||
export APPIMAGE_FILE="Cutter-${PACKAGE_ID}-x64.Linux.AppImage"
|
export APPIMAGE_FILE="Cutter-${PACKAGE_ID}-x64.Linux.AppImage"
|
||||||
@ -192,6 +189,7 @@ jobs:
|
|||||||
-DCUTTER_PACKAGE_RZ_GHIDRA=ON \
|
-DCUTTER_PACKAGE_RZ_GHIDRA=ON \
|
||||||
-DCUTTER_PACKAGE_JSDEC=ON \
|
-DCUTTER_PACKAGE_JSDEC=ON \
|
||||||
-DCUTTER_PACKAGE_RZ_LIBSWIFT=ON \
|
-DCUTTER_PACKAGE_RZ_LIBSWIFT=ON \
|
||||||
|
-DCUTTER_PACKAGE_RZ_LIBYARA=ON \
|
||||||
-DCPACK_PACKAGE_FILE_NAME="$PACKAGE_NAME" \
|
-DCPACK_PACKAGE_FILE_NAME="$PACKAGE_NAME" \
|
||||||
-DCMAKE_FRAMEWORK_PATH="$BREAKPAD_FRAMEWORK_DIR" \
|
-DCMAKE_FRAMEWORK_PATH="$BREAKPAD_FRAMEWORK_DIR" \
|
||||||
-DCPACK_BUNDLE_APPLE_CERT_APP="-" \
|
-DCPACK_BUNDLE_APPLE_CERT_APP="-" \
|
||||||
@ -231,6 +229,7 @@ jobs:
|
|||||||
-DCUTTER_PACKAGE_DEPENDENCIES=ON ^
|
-DCUTTER_PACKAGE_DEPENDENCIES=ON ^
|
||||||
-DCUTTER_PACKAGE_RZ_GHIDRA=ON ^
|
-DCUTTER_PACKAGE_RZ_GHIDRA=ON ^
|
||||||
-DCUTTER_PACKAGE_RZ_LIBSWIFT=ON ^
|
-DCUTTER_PACKAGE_RZ_LIBSWIFT=ON ^
|
||||||
|
-DCUTTER_PACKAGE_RZ_LIBYARA=ON ^
|
||||||
-DCUTTER_PACKAGE_JSDEC=ON ^
|
-DCUTTER_PACKAGE_JSDEC=ON ^
|
||||||
-DCUTTER_ENABLE_DEPENDENCY_DOWNLOADS=ON ^
|
-DCUTTER_ENABLE_DEPENDENCY_DOWNLOADS=ON ^
|
||||||
-DCUTTER_ENABLE_CRASH_REPORTS=ON ^
|
-DCUTTER_ENABLE_CRASH_REPORTS=ON ^
|
||||||
|
@ -27,6 +27,7 @@ option(CUTTER_ENABLE_SIGDB "Downloads and installs sigdb (only available when CU
|
|||||||
option(CUTTER_PACKAGE_DEPENDENCIES "During install step include the third party dependencies." OFF)
|
option(CUTTER_PACKAGE_DEPENDENCIES "During install step include the third party dependencies." OFF)
|
||||||
option(CUTTER_PACKAGE_RZ_GHIDRA "Compile and install rz-ghidra during install step." OFF)
|
option(CUTTER_PACKAGE_RZ_GHIDRA "Compile and install rz-ghidra during install step." OFF)
|
||||||
option(CUTTER_PACKAGE_RZ_LIBSWIFT, "Compile and install rz-libswift demangler during the install step." OFF)
|
option(CUTTER_PACKAGE_RZ_LIBSWIFT, "Compile and install rz-libswift demangler during the install step." OFF)
|
||||||
|
option(CUTTER_PACKAGE_RZ_LIBYARA, "Compile and install rz-libyara during the install step." OFF)
|
||||||
option(CUTTER_PACKAGE_JSDEC "Compile and install jsdec during install step." OFF)
|
option(CUTTER_PACKAGE_JSDEC "Compile and install jsdec during install step." OFF)
|
||||||
OPTION(CUTTER_QT6 "Use QT6" OFF)
|
OPTION(CUTTER_QT6 "Use QT6" OFF)
|
||||||
|
|
||||||
@ -132,6 +133,14 @@ message(STATUS "- Python Bindings: ${CUTTER_ENABLE_PYTHON_BINDINGS}")
|
|||||||
message(STATUS "- Crash Handling: ${CUTTER_ENABLE_CRASH_REPORTS}")
|
message(STATUS "- Crash Handling: ${CUTTER_ENABLE_CRASH_REPORTS}")
|
||||||
message(STATUS "- KSyntaxHighlighting: ${KSYNTAXHIGHLIGHTING_STATUS}")
|
message(STATUS "- KSyntaxHighlighting: ${KSYNTAXHIGHLIGHTING_STATUS}")
|
||||||
message(STATUS "- Graphviz: ${CUTTER_ENABLE_GRAPHVIZ}")
|
message(STATUS "- Graphviz: ${CUTTER_ENABLE_GRAPHVIZ}")
|
||||||
|
message(STATUS "- Downloads dependencies: ${CUTTER_ENABLE_DEPENDENCY_DOWNLOADS}")
|
||||||
|
message(STATUS "- Enable Packaging: ${CUTTER_ENABLE_PACKAGING}")
|
||||||
|
message(STATUS "- Package Dependencies: ${CUTTER_PACKAGE_DEPENDENCIES}")
|
||||||
|
message(STATUS "- Package RzGhidra: ${CUTTER_PACKAGE_RZ_GHIDRA}")
|
||||||
|
message(STATUS "- Package RzLibSwift: ${CUTTER_PACKAGE_RZ_LIBSWIFT}")
|
||||||
|
message(STATUS "- Package RzLibYara: ${CUTTER_PACKAGE_RZ_LIBYARA}")
|
||||||
|
message(STATUS "- Package JSDec: ${CUTTER_PACKAGE_JSDEC}")
|
||||||
|
message(STATUS "- QT6: ${CUTTER_QT6}")
|
||||||
message(STATUS "")
|
message(STATUS "")
|
||||||
|
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
|
64
dist/CMakeLists.txt
vendored
64
dist/CMakeLists.txt
vendored
@ -28,7 +28,7 @@ if(WIN32)
|
|||||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||||
RESULT_VARIABLE SCRIPT_RESULT)
|
RESULT_VARIABLE SCRIPT_RESULT)
|
||||||
if (SCRIPT_RESULT)
|
if (SCRIPT_RESULT)
|
||||||
message(FATAL_ERROR \"Failed to package jsdec\")
|
message(FATAL_ERROR \"Failed to package jsdec (returned \${SCRIPT_RESULT})\")
|
||||||
endif()
|
endif()
|
||||||
")
|
")
|
||||||
endif()
|
endif()
|
||||||
@ -40,7 +40,22 @@ if(WIN32)
|
|||||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||||
RESULT_VARIABLE SCRIPT_RESULT)
|
RESULT_VARIABLE SCRIPT_RESULT)
|
||||||
if (SCRIPT_RESULT)
|
if (SCRIPT_RESULT)
|
||||||
message(FATAL_ERROR \"Failed to package rz-libswift\")
|
message(FATAL_ERROR \"Failed to package rz-libswift (returned \${SCRIPT_RESULT})\")
|
||||||
|
endif()
|
||||||
|
")
|
||||||
|
endif()
|
||||||
|
if (CUTTER_PACKAGE_RZ_LIBYARA AND CUTTER_ENABLE_DEPENDENCY_DOWNLOADS)
|
||||||
|
install(CODE "
|
||||||
|
set(ENV{RZ_PREFIX} \"\${CMAKE_INSTALL_PREFIX}\")
|
||||||
|
set(ENV{PATH} \"\${CMAKE_INSTALL_PREFIX};\$ENV{PATH}\")
|
||||||
|
execute_process(COMMAND powershell
|
||||||
|
\"${CMAKE_CURRENT_SOURCE_DIR}/bundle_rz_libyara.ps1\"
|
||||||
|
\"\${CMAKE_INSTALL_PREFIX}\"
|
||||||
|
\"-DCUTTER_INSTALL_PLUGDIR=plugins/native\"
|
||||||
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||||
|
RESULT_VARIABLE SCRIPT_RESULT)
|
||||||
|
if (SCRIPT_RESULT)
|
||||||
|
message(FATAL_ERROR \"Failed to package rz_libyara (returned \${SCRIPT_RESULT})\")
|
||||||
endif()
|
endif()
|
||||||
")
|
")
|
||||||
endif()
|
endif()
|
||||||
@ -93,29 +108,52 @@ if(APPLE)
|
|||||||
get_filename_component(QT_PREFIX "${MACDEPLOYQT_PATH}/../.." ABSOLUTE)
|
get_filename_component(QT_PREFIX "${MACDEPLOYQT_PATH}/../.." ABSOLUTE)
|
||||||
list(APPEND RZ_GHIDRA_PREFIX_PATH "${QT_PREFIX}")
|
list(APPEND RZ_GHIDRA_PREFIX_PATH "${QT_PREFIX}")
|
||||||
set(RIZIN_INSTALL_PLUGDIR "lib/rizin/plugins") # escaped backslash on purpose, should be evaluated later
|
set(RIZIN_INSTALL_PLUGDIR "lib/rizin/plugins") # escaped backslash on purpose, should be evaluated later
|
||||||
|
endif()
|
||||||
|
|
||||||
if (CUTTER_PACKAGE_JSDEC AND CUTTER_ENABLE_DEPENDENCY_DOWNLOADS)
|
################################################
|
||||||
|
# macOS + Linux
|
||||||
|
################################################
|
||||||
|
|
||||||
|
if(CUTTER_ENABLE_DEPENDENCY_DOWNLOADS AND (NOT WIN32))
|
||||||
|
if (CUTTER_PACKAGE_JSDEC)
|
||||||
install(CODE "
|
install(CODE "
|
||||||
execute_process(COMMAND \"${CMAKE_CURRENT_SOURCE_DIR}/../scripts/jsdec.sh\" --pkg-config-path=\${CMAKE_INSTALL_PREFIX}/lib/pkgconfig --prefix=\${CMAKE_INSTALL_PREFIX}
|
execute_process(COMMAND \"${CMAKE_CURRENT_SOURCE_DIR}/../scripts/jsdec.sh\"
|
||||||
|
--pkg-config-path=\${CMAKE_INSTALL_PREFIX}/lib/pkgconfig --prefix=\${CMAKE_INSTALL_PREFIX}
|
||||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||||
RESULT_VARIABLE SCRIPT_RESULT)
|
RESULT_VARIABLE SCRIPT_RESULT)
|
||||||
if (SCRIPT_RESULT)
|
if (SCRIPT_RESULT)
|
||||||
message(FATAL_ERROR \"Failed to package jsdec\")
|
message(FATAL_ERROR \"Failed to package jsdec (returned \${SCRIPT_RESULT})\")
|
||||||
endif()
|
endif()
|
||||||
")
|
")
|
||||||
endif()
|
endif()
|
||||||
|
if (CUTTER_PACKAGE_RZ_LIBSWIFT)
|
||||||
if (CUTTER_PACKAGE_RZ_LIBSWIFT AND CUTTER_ENABLE_DEPENDENCY_DOWNLOADS)
|
|
||||||
install(CODE "
|
install(CODE "
|
||||||
execute_process(COMMAND \"${CMAKE_CURRENT_SOURCE_DIR}/../scripts/rz-libswift.sh\" --pkg-config-path=\${CMAKE_INSTALL_PREFIX}/lib/pkgconfig --prefix=\${CMAKE_INSTALL_PREFIX}
|
execute_process(COMMAND \"${CMAKE_CURRENT_SOURCE_DIR}/../scripts/rz-libswift.sh\"
|
||||||
|
--pkg-config-path=\${CMAKE_INSTALL_PREFIX}/lib/pkgconfig --prefix=\${CMAKE_INSTALL_PREFIX}
|
||||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||||
RESULT_VARIABLE SCRIPT_RESULT)
|
RESULT_VARIABLE SCRIPT_RESULT)
|
||||||
if (SCRIPT_RESULT)
|
if (SCRIPT_RESULT)
|
||||||
message(FATAL_ERROR \"Failed to package rz-libswift\")
|
message(FATAL_ERROR \"Failed to package rz-libswift (returned \${SCRIPT_RESULT})\")
|
||||||
|
endif()
|
||||||
|
")
|
||||||
|
endif()
|
||||||
|
if (CUTTER_PACKAGE_RZ_LIBYARA)
|
||||||
|
if(APPLE)
|
||||||
|
set (YARA_PLUGIN_OPTIONS "-DCUTTER_INSTALL_PLUGDIR=plugins/native")
|
||||||
|
else()
|
||||||
|
set (YARA_PLUGIN_OPTIONS "")
|
||||||
|
endif()
|
||||||
|
install(CODE "
|
||||||
|
execute_process(COMMAND
|
||||||
|
\"${CMAKE_CURRENT_SOURCE_DIR}/../scripts/rz-libyara.sh\"
|
||||||
|
\"\${CMAKE_INSTALL_PREFIX}\" \"${YARA_PLUGIN_OPTIONS}\"
|
||||||
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||||
|
RESULT_VARIABLE SCRIPT_RESULT)
|
||||||
|
if (SCRIPT_RESULT)
|
||||||
|
message(FATAL_ERROR \"Failed to package rz-libyara (returned \${SCRIPT_RESULT})\")
|
||||||
endif()
|
endif()
|
||||||
")
|
")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
################################################
|
################################################
|
||||||
@ -144,7 +182,7 @@ if(CUTTER_PACKAGE_RZ_GHIDRA)
|
|||||||
\"-DRIZIN_INSTALL_PLUGDIR=\${CMAKE_INSTALL_PREFIX}/${RIZIN_INSTALL_PLUGDIR}\"
|
\"-DRIZIN_INSTALL_PLUGDIR=\${CMAKE_INSTALL_PREFIX}/${RIZIN_INSTALL_PLUGDIR}\"
|
||||||
-DCUTTER_INSTALL_PLUGDIR=plugins/native")
|
-DCUTTER_INSTALL_PLUGDIR=plugins/native")
|
||||||
else()
|
else()
|
||||||
set (GHIDRA_OPTIONS "")
|
set (GHIDRA_OPTIONS "-DCUTTER_INSTALL_PLUGDIR=\${CMAKE_INSTALL_PREFIX}/share/rizin/cutter/plugins/native")
|
||||||
endif()
|
endif()
|
||||||
install(CODE "
|
install(CODE "
|
||||||
execute_process(
|
execute_process(
|
||||||
@ -161,14 +199,14 @@ if(CUTTER_PACKAGE_RZ_GHIDRA)
|
|||||||
-G Ninja
|
-G Ninja
|
||||||
)
|
)
|
||||||
if (SCRIPT_RESULT)
|
if (SCRIPT_RESULT)
|
||||||
message(FATAL_ERROR \"Failed to configure rz-ghidra\")
|
message(FATAL_ERROR \"Failed to configure rz-ghidra (returned \${SCRIPT_RESULT})\")
|
||||||
endif()
|
endif()
|
||||||
execute_process(WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/rz-ghidra-prefix/src/rz-ghidra-build
|
execute_process(WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/rz-ghidra-prefix/src/rz-ghidra-build
|
||||||
RESULT_VARIABLE SCRIPT_RESULT
|
RESULT_VARIABLE SCRIPT_RESULT
|
||||||
COMMAND \${CMAKE_COMMAND} --build . --target install
|
COMMAND \${CMAKE_COMMAND} --build . --target install
|
||||||
)
|
)
|
||||||
if (SCRIPT_RESULT)
|
if (SCRIPT_RESULT)
|
||||||
message(FATAL_ERROR \"Failed to install rz-ghidra plugin\")
|
message(FATAL_ERROR \"Failed to install rz-ghidra plugin (returned \${SCRIPT_RESULT})\")
|
||||||
endif()
|
endif()
|
||||||
")
|
")
|
||||||
endif()
|
endif()
|
||||||
|
3
dist/MacOSSetupBundle.cmake.in
vendored
3
dist/MacOSSetupBundle.cmake.in
vendored
@ -60,6 +60,9 @@ run_or_die(COMMAND install_name_tool
|
|||||||
run_or_die(COMMAND install_name_tool
|
run_or_die(COMMAND install_name_tool
|
||||||
-add_rpath "@executable_path/../Resources/lib"
|
-add_rpath "@executable_path/../Resources/lib"
|
||||||
"${EXECUTABLE_DIR}/cutter")
|
"${EXECUTABLE_DIR}/cutter")
|
||||||
|
run_or_die(COMMAND install_name_tool
|
||||||
|
-add_rpath "@executable_path/../Resources/lib/rizin/plugins"
|
||||||
|
"${EXECUTABLE_DIR}/cutter")
|
||||||
|
|
||||||
set(MACDEPLOYQT_COMMAND "${MACDEPLOYQT_PATH}" "${BUNDLE_PATH}" "-verbose=2" "-libpath=${CMAKE_INSTALL_PREFIX}/lib")
|
set(MACDEPLOYQT_COMMAND "${MACDEPLOYQT_PATH}" "${BUNDLE_PATH}" "-verbose=2" "-libpath=${CMAKE_INSTALL_PREFIX}/lib")
|
||||||
message("Running macdeployqt \"${MACDEPLOYQT_COMMAND}\"")
|
message("Running macdeployqt \"${MACDEPLOYQT_COMMAND}\"")
|
||||||
|
2
dist/bundle_rz_libswift.ps1
vendored
2
dist/bundle_rz_libswift.ps1
vendored
@ -13,4 +13,4 @@ if(![System.IO.File]::Exists($pathdll)) {
|
|||||||
ls "$dist/lib/plugins/"
|
ls "$dist/lib/plugins/"
|
||||||
throw (New-Object System.IO.FileNotFoundException("File not found: $pathdll", $pathdll))
|
throw (New-Object System.IO.FileNotFoundException("File not found: $pathdll", $pathdll))
|
||||||
}
|
}
|
||||||
Remove-Item -Recurse -Force $dist/lib/plugins/libswift.lib
|
Remove-Item -Recurse -Force $dist/lib/plugins/swift.lib
|
||||||
|
26
dist/bundle_rz_libyara.ps1
vendored
Normal file
26
dist/bundle_rz_libyara.ps1
vendored
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
$dist = $args[0]
|
||||||
|
$cmake_opts = $args[1]
|
||||||
|
$python = Split-Path((Get-Command python.exe).Path)
|
||||||
|
|
||||||
|
if (-not (Test-Path -Path 'rz_libyara' -PathType Container)) {
|
||||||
|
git clone https://github.com/rizinorg/rz-libyara.git --depth 1 rz_libyara
|
||||||
|
git -C rz_libyara submodule init
|
||||||
|
git -C rz_libyara submodule update
|
||||||
|
}
|
||||||
|
cd rz_libyara
|
||||||
|
& meson.exe --buildtype=release --prefix=$dist build
|
||||||
|
ninja -C build install
|
||||||
|
$pathdll = "$dist/lib/plugins/rz_yara.dll"
|
||||||
|
if(![System.IO.File]::Exists($pathdll)) {
|
||||||
|
type build/meson-logs/meson-log.txt
|
||||||
|
ls "$dist/lib/plugins/"
|
||||||
|
throw (New-Object System.IO.FileNotFoundException("File not found: $pathdll", $pathdll))
|
||||||
|
}
|
||||||
|
Remove-Item -Recurse -Force $dist/lib/plugins/rz_yara.lib
|
||||||
|
|
||||||
|
cd cutter-plugin
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DRIZIN_INSTALL_PLUGDIR="../build" -DCMAKE_INSTALL_PREFIX="$dist" $cmake_opts ..
|
||||||
|
ninja
|
||||||
|
ninja install
|
25
scripts/rz-libyara.sh
Executable file
25
scripts/rz-libyara.sh
Executable file
@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
SCRIPTPATH=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
|
||||||
|
INSTALL_PREFIX="$1"
|
||||||
|
EXTRA_CMAKE_OPTS="$2"
|
||||||
|
|
||||||
|
cd "$SCRIPTPATH/.."
|
||||||
|
|
||||||
|
if [[ ! -d rz_libyara ]]; then
|
||||||
|
git clone https://github.com/rizinorg/rz-libyara.git --depth 1 rz_libyara
|
||||||
|
git -C rz_libyara submodule init
|
||||||
|
git -C rz_libyara submodule update
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd rz_libyara
|
||||||
|
|
||||||
|
meson --buildtype=release --pkg-config-path="$INSTALL_PREFIX/lib/pkgconfig" --prefix="$INSTALL_PREFIX" build
|
||||||
|
ninja -C build install
|
||||||
|
|
||||||
|
cd cutter-plugin
|
||||||
|
mkdir build && cd build
|
||||||
|
cmake -G Ninja -DRIZIN_INSTALL_PLUGDIR="../build" -DCMAKE_INSTALL_PREFIX="$INSTALL_PREFIX" $EXTRA_CMAKE_OPTS ..
|
||||||
|
ninja
|
||||||
|
ninja install
|
@ -163,13 +163,8 @@ CutterApplication::CutterApplication(int &argc, char **argv) : QApplication(argc
|
|||||||
appdir.cdUp(); // appdir
|
appdir.cdUp(); // appdir
|
||||||
|
|
||||||
auto sleighHome = appdir;
|
auto sleighHome = appdir;
|
||||||
sleighHome.cd(
|
sleighHome.cd("lib/rizin/plugins/rz_ghidra_sleigh/"); // appdir/lib/rizin/plugins/rz_ghidra_sleigh/
|
||||||
"share/rizin/plugins/rz_ghidra_sleigh"); // appdir/share/rizin/plugins/rz_ghidra_sleigh
|
|
||||||
Core()->setConfig("ghidra.sleighhome", sleighHome.absolutePath());
|
Core()->setConfig("ghidra.sleighhome", sleighHome.absolutePath());
|
||||||
|
|
||||||
auto jsdecHome = appdir;
|
|
||||||
jsdecHome.cd("share/rizin/plugins/jsdec"); // appdir/share/rizin/plugins/jsdec
|
|
||||||
qputenv("JSDEC_HOME", jsdecHome.absolutePath().toLocal8Bit());
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -65,6 +65,7 @@ void PluginManager::loadPluginsFromDir(const QDir &pluginsDir, bool writable)
|
|||||||
nativePluginsDir.mkdir("native");
|
nativePluginsDir.mkdir("native");
|
||||||
}
|
}
|
||||||
if (nativePluginsDir.cd("native")) {
|
if (nativePluginsDir.cd("native")) {
|
||||||
|
qInfo() << "Native plugins are loaded from" << nativePluginsDir.absolutePath();
|
||||||
loadNativePlugins(nativePluginsDir);
|
loadNativePlugins(nativePluginsDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -74,6 +75,7 @@ void PluginManager::loadPluginsFromDir(const QDir &pluginsDir, bool writable)
|
|||||||
pythonPluginsDir.mkdir("python");
|
pythonPluginsDir.mkdir("python");
|
||||||
}
|
}
|
||||||
if (pythonPluginsDir.cd("python")) {
|
if (pythonPluginsDir.cd("python")) {
|
||||||
|
qInfo() << "Python plugins are loaded from" << pythonPluginsDir.absolutePath();
|
||||||
loadPythonPlugins(pythonPluginsDir.absolutePath());
|
loadPythonPlugins(pythonPluginsDir.absolutePath());
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user