|
|
@ -1,5 +1,4 @@
|
|
|
|
#include "Hook.hpp"
|
|
|
|
#include "Hook.hpp"
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace Hook
|
|
|
|
namespace Hook
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -9,10 +8,8 @@ namespace Hook
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//finish the shellcode by adding the address to jmp to
|
|
|
|
//finish the shellcode by adding the address to jmp to
|
|
|
|
*(uintptr_t*)(jmpCode + OFFSET_TO_ADDRESS) = jmpTo;
|
|
|
|
*(uintptr_t*)(jmpCode + OFFSET_TO_ADDRESS) = jmpTo;
|
|
|
|
|
|
|
|
|
|
|
|
//save old bytes
|
|
|
|
//save old bytes
|
|
|
|
memcpy(originalBytes, (void*)HookAddress, JMP_CODE_SIZE);
|
|
|
|
memcpy(originalBytes, (void*)HookAddress, JMP_CODE_SIZE);
|
|
|
|
|
|
|
|
|
|
|
|
//install the hook.
|
|
|
|
//install the hook.
|
|
|
|
InstallHook();
|
|
|
|
InstallHook();
|
|
|
|
}
|
|
|
|
}
|
|
|
|