diff --git a/cmake/FindRadare2.cmake b/cmake/FindRadare2.cmake index 4e73a73e..5743efb5 100644 --- a/cmake/FindRadare2.cmake +++ b/cmake/FindRadare2.cmake @@ -46,7 +46,8 @@ if(WIN32) socket fs magic - crypto) + crypto + sdb) set(Radare2_LIBRARIES "") set(Radare2_LIBRARIES_VARS "") diff --git a/cutter-plugin/CMakeLists.txt b/cutter-plugin/CMakeLists.txt index 2094da50..b108a015 100644 --- a/cutter-plugin/CMakeLists.txt +++ b/cutter-plugin/CMakeLists.txt @@ -20,4 +20,8 @@ if(APPLE) target_link_options(r2ghidra_cutter PRIVATE -undefined dynamic_lookup) endif() +if(WIN32) + target_link_options(r2ghidra_cutter PRIVATE -FORCE:UNRESOLVED) +endif() + install(TARGETS r2ghidra_cutter DESTINATION "${CUTTER_INSTALL_PLUGDIR}") \ No newline at end of file diff --git a/ghidra/CMakeLists.txt b/ghidra/CMakeLists.txt index 48c2cfda..8bb63a92 100644 --- a/ghidra/CMakeLists.txt +++ b/ghidra/CMakeLists.txt @@ -206,10 +206,12 @@ if(BUILD_SLASPECS) file(MAKE_DIRECTORY "${SLEIGH_BASE}") foreach(slaspec ${SLASPEC_FILES}) get_filename_component(sleigh_name "${slaspec}" NAME_WE) + get_filename_component(sleigh_dir "${slaspec}" DIRECTORY) set(sla_file "${SLEIGH_BASE}/${sleigh_name}.sla") add_custom_command(OUTPUT "${sla_file}" COMMAND sleighc "${slaspec}" "${sla_file}" - MAIN_DEPENDENCY "${slaspec}") + MAIN_DEPENDENCY "${slaspec}" + WORKING_DIRECTORY "${sleigh_dir}") list(APPEND SLAFILES "${sla_file}") endforeach() add_custom_target(sla ALL DEPENDS ${SLAFILES}) diff --git a/src/CodeXMLParse.cpp b/src/CodeXMLParse.cpp index d0336458..a556e2a3 100644 --- a/src/CodeXMLParse.cpp +++ b/src/CodeXMLParse.cpp @@ -27,8 +27,8 @@ void AnnotateOpref(ANNOTATOR_PARAMS) pugi::xml_attribute attr = node.attribute("opref"); if(attr.empty()) return; - unsigned long long opref = attr.as_ullong(ULONG_LONG_MAX); - if(opref == ULONG_LONG_MAX) + unsigned long long opref = attr.as_ullong(ULLONG_MAX); + if(opref == ULLONG_MAX) return; auto opit = ctx->ops.find((uintm)opref); if(opit == ctx->ops.end()) diff --git a/src/R2Scope.h b/src/R2Scope.h index d8e99534..c43104e8 100644 --- a/src/R2Scope.h +++ b/src/R2Scope.h @@ -7,6 +7,11 @@ #include +// Windows defines LoadImage to LoadImageA +#ifdef LoadImage +#undef LoadImage +#endif + class R2Architecture; typedef struct r_anal_function_t RAnalFunction; typedef struct r_flag_item_t RFlagItem; diff --git a/src/R2TypeFactory.cpp b/src/R2TypeFactory.cpp index 9035ce88..a762b10b 100644 --- a/src/R2TypeFactory.cpp +++ b/src/R2TypeFactory.cpp @@ -2,11 +2,12 @@ #include "R2TypeFactory.h" #include "R2Architecture.h" -#include "R2Utils.h" #include #include +#include "R2Utils.h" + R2TypeFactory::R2TypeFactory(R2Architecture *arch) : TypeFactory(arch), arch(arch) @@ -69,9 +70,9 @@ Datatype *R2TypeFactory::queryR2Struct(const string &n) memberType = getTypeArray(elements, memberType); fields.push_back({ - .offset = offset, - .name = memberName, - .type = memberType + offset, + memberName, + memberType }); } diff --git a/src/core_ghidra.cpp b/src/core_ghidra.cpp index 4acebc4c..44b44e77 100644 --- a/src/core_ghidra.cpp +++ b/src/core_ghidra.cpp @@ -3,6 +3,11 @@ #include "R2Architecture.h" #include "CodeXMLParse.h" +// Windows clash +#ifdef restrict +#undef restrict +#endif + #include #include #include "R2PrintC.h"