Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Example/HWSyscalls-Example/HWSyscalls-Example.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,9 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<Optimization>Disabled</Optimization>
<Optimization>MaxSpeed</Optimization>
<LanguageStandard>stdcpp20</LanguageStandard>
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand Down
2 changes: 2 additions & 0 deletions Example/HWSyscalls-Example/HWSyscalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,11 @@ DWORD64 FindSyscallReturnAddress(DWORD64 functionAddress, WORD syscallNumber) {

#pragma endregion

#pragma optimize("", off)
UINT64 PrepareSyscall(char* functionName) {
return ntFunctionAddress;
}
#pragma optimize("", on)

bool SetMainBreakpoint() {
// Dynamically find the GetThreadContext and SetThreadContext functions
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@ The debug verbosity can be turned on or off by changing the `HWSYSCALLS_DEBUG` d

## Setup

To compile this project you will need Visual Studio 2019 and forward.
It is important to note that this project was made only for x64 environments and needs to be compiled without optimization.
You can disable it from Project Settings -> C/C++ -> Optimization -> Optimization (Disabled /Od).
To compile this project you will need Visual Studio 2019 and forward. Furthermore, it is important to note that this project was made only for x64 environments.

## Example

Expand Down
2 changes: 2 additions & 0 deletions Src/HWSyscalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,11 @@ DWORD64 FindSyscallReturnAddress(DWORD64 functionAddress, WORD syscallNumber) {

#pragma endregion

#pragma optimize("", off)
UINT64 PrepareSyscall(char* functionName) {
return ntFunctionAddress;
}
#pragma optimize("", on)

bool SetMainBreakpoint() {
// Dynamically find the GetThreadContext and SetThreadContext functions
Expand Down