Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
stevemk14ebr committed Dec 17, 2023
2 parents 2543014 + e8d33f5 commit 8eab02d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ option(POLYHOOK_FEATURE_VIRTUALS "Implement all virtual table hooking functional

function(add_asmjit_properties)
if(MSVC)
if(ASMJIT_STATIC)
if(POLYHOOK_BUILD_STATIC_RUNTIME)
set_target_properties(asmjit PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
else()
set_target_properties(asmjit PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
Expand All @@ -67,7 +67,7 @@ if(POLYHOOK_FEATURE_DETOURS AND NOT POLYHOOK_USE_EXTERNAL_ASMTK)
set(ASMJIT_STATIC ON CACHE BOOL "")
endif()

add_subdirectory(asmtk)
add_subdirectory(asmtk)
add_asmjit_properties()

if(MSVC)
Expand All @@ -93,7 +93,7 @@ if(POLYHOOK_FEATURE_INLINENTD AND NOT POLYHOOK_USE_EXTERNAL_ASMJIT)
set(ASMJIT_STATIC ON CACHE BOOL "")
endif()

add_subdirectory(asmjit)
add_subdirectory(asmjit)
add_asmjit_properties()
endif()
endif()
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# PolyHook 2.0
C++17, x86/x64 Hooking Libary v2.0
C++ 20, x86/x64 Hooking Libary v2.0

Article 1: https://www.codeproject.com/articles/1100579/polyhook-the-cplusplus-x-x-hooking-library

Expand Down Expand Up @@ -47,7 +47,7 @@ See: https://github.com/stevemk14ebr/PolyHook_2_0/pull/59#issuecomment-619223616
I provide directions below for how to setup the visual studio cmake environment only. If you don't want to use visual studio that's fine, this is a standard cmake project and will build from command line just fine.

### Visual Studio 2022
clone the project and perform submodule init as above. Do not run the cmake commands, instead:
An up to date visual studio is required. First clone the project and perform submodule init as above. Do not run the cmake commands, instead:

Open VS 2022, go to file->open->cmake.. this will load the project and start cmake generation. Next goto cmake->build all or cmake->build, you can also set a startup item and release mode to use the play button (do not use the install target). Capstone, Zydis, and asmjit are set to automatically build and link, you DO NOT need to build them seperately.

Expand Down
5 changes: 2 additions & 3 deletions sources/FBAllocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ void* ALLOC_Alloc(ALLOC_HANDLE hAlloc, size_t size)
// Convert handle to an ALLOC_Allocator instance
self = (ALLOC_Allocator*)hAlloc;

// Ensure requested size fits within memory block
(size);
// Ensure requested size fits within memory block
assert(size <= self->blockSize);

// Get a block from the free-list
Expand Down Expand Up @@ -144,4 +143,4 @@ void ALLOC_Free(ALLOC_HANDLE hAlloc, void* pBlock)
// Keep track of usage statistics
self->deallocations++;
self->blocksInUse--;
}
}

0 comments on commit 8eab02d

Please sign in to comment.