PROJECT(frida)
set(CMAKE_VERBOSE_MAKEFILE on)
-
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules")
+include(GNUInstallDirs)
find_package(Qt5Widgets)
find_package(Qt5 CONFIG REQUIRED Widgets Gui)
separate_arguments(LLVM_LIBS)
INCLUDE_DIRECTORIES("src")
+include_directories(${CMAKE_CURRENT_BINARY_DIR}/src)
#####################
# Language Bindings #
#FIND_PACKAGE(PythonLibs)
#INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
SET_SOURCE_FILES_PROPERTIES(src/bindings/guile/frida.i PROPERTIES CPLUSPLUS ON)
-SWIG_ADD_MODULE(frida-guile guile src/bindings/guile/frida.i)
-SWIG_LINK_LIBRARIES(frida-guile ${GUILE_LDFLAGS})
+SWIG_ADD_MODULE(guile-frida-binding guile src/bindings/guile/frida.i)
+SWIG_LINK_LIBRARIES(guile-frida-binding ${GUILE_LDFLAGS})
#################
)
ADD_EXECUTABLE(frida src/main.cxx ${frida_SOURCES} ${frida_HEADERS_MOC})
-#ADD_LIBRARY(llvm SHARED )
+
ADD_DEFINITIONS(${QT_DEFINITIONS})
${LOG4CXX_LDFLAGS}
${QUAZIP_LIBRARIES})
+configure_file(src/Config.hxx.in src/Config.hxx @ONLY)
###########
# Plugins #
enable_testing()
target_link_libraries(fridatest gmock gtest ${QT_LIBRARIES} ${LLVM_LDFLAGS} -lLLVM-3.5 ${LLVM_SYSTEM_LIBS} ${LOG4CXX_LDFLAGS} ${GUILE_LDFLAGS} ${QUAZIP_LIBRARIES})
add_test(NAME fridatest COMMAND fridatest ${CMAKE_SOURCE_DIR})
+
+
+
+install(TARGETS frida
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+
+install(TARGETS guilePlugin guile-frida-binding
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/frida/plugins/Interpreter)
#include "Guile.hxx"
+#include "Config.hxx"
namespace {
SCM handler (void*, SCM tag, SCM throw_args) {
GuileInterpreter::GuileInterpreter() {
scm_init_guile();
- scm_internal_catch(SCM_BOOL_T,
- (SCM (*)(void *))scm_c_eval_string,
- (void*)"(use-modules (system repl server))",
- handler, NULL);
- scm_internal_catch(SCM_BOOL_T,
- (SCM (*)(void *))scm_c_eval_string,
- (void*)"(spawn-server)",
- handler, NULL);
- scm_internal_catch(SCM_BOOL_T,
- (SCM (*)(void *))scm_c_eval_string,
- (void*)"(load-extension \"libfrida-guile\" \"scm_init_frida_module\")",
- handler, NULL);
+ scm_c_use_module("system repl server");
+ scm_call_0(scm_c_public_ref("system repl server", "spawn-server"));
+ scm_c_load_extension(CMAKE_INSTALL_FULL_LIBDIR "/frida/plugins/Interpreter/libguile-frida-binding",
+ "scm_init_frida_module");
guile_output_port = scm_open_output_string();
guile_error_port = scm_open_output_string();
std::ostream& stdout,
std::ostream& stderr,
std::string& result) {
- return evaluate("(load \"" + filename + "\")",
- stdout, stderr, result);
+ scm_c_primitive_load(filename.c_str());
}
#include "gui/Mainwindow.hxx"
#include "core/InformationManager.hxx"
#include "disassembler/llvm/LLVMDisassembler.hxx"
+#include "Config.hxx"
int main(int argc, char** argv)
{
QApplication::setApplicationName("frida");
QApplication::setApplicationVersion("0.0");
+ QApplication::addLibraryPath(CMAKE_INSTALL_FULL_LIBDIR "/frida/plugins/Interpreter");
#ifdef ARGPARSE
parser.addHelpOption();
parser.addVersionOption();