Skip to content

Commit

Permalink
include fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
altalk23 committed May 26, 2024
1 parent b566e02 commit 40d632d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
14 changes: 9 additions & 5 deletions src/target/Windows32Target.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ using namespace tulip::hook;

#if defined(TULIP_HOOK_WINDOWS)

#if defined(TULIP_HOOK_X86)

Target& Target::get() {
static Windows32Target ret;
return ret;
}

#endif

#define WIN32_LEAN_AND_MEAN
#include <Windows.h>

Expand Down Expand Up @@ -54,11 +63,6 @@ uint32_t Windows32Target::getWritableProtection() {
return PAGE_READWRITE;
}

Target& Target::get() {
static Windows32Target ret;
return ret;
}

Result<csh> Windows32Target::openCapstone() {
cs_err status;

Expand Down
1 change: 1 addition & 0 deletions src/target/Windows64Target.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "Windows64Target.hpp"

#include <memory>
#include <Platform.hpp>

using namespace tulip::hook;
Expand Down
4 changes: 2 additions & 2 deletions src/target/Windows64Target.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

#if defined(TULIP_HOOK_WINDOWS) && defined(TULIP_HOOK_X64)

#include "../generator/X86Generator.hpp"
#include "../generator/X64Generator.hpp"
#include "Windows32Target.hpp"

namespace tulip::hook {
class Windows64Target : public Windows32Target {
public:
using Target::Target;
using Windows32Target::Windows32Target;

Result<csh> openCapstone() override;

Expand Down
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ enable_testing()
add_executable(${PROJECT_NAME} Assembler86.cpp Assembler64.cpp Hook.cpp)
target_link_libraries(${PROJECT_NAME} PUBLIC GTest::gtest_main TulipHook)

if(WIN32)
if(WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 4)
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "/INCREMENTAL:NO")

# add_executable(WinTest misc/WinTest.cpp)
Expand Down

0 comments on commit 40d632d

Please sign in to comment.