|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
#include <iostream>
|
|
|
|
|
#include "Hook.hpp"
|
|
|
|
|
#include "hook.hpp"
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
|
|
BOOL HookWriteFile(
|
|
|
|
@ -10,20 +10,23 @@ BOOL HookWriteFile(
|
|
|
|
|
LPOVERLAPPED lpOverlapped
|
|
|
|
|
)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
//this will change the output to "shithooked!\n"
|
|
|
|
|
|
|
|
|
|
memset((void *)lpBuffer, NULL, nNumberOfBytesToWrite);
|
|
|
|
|
memcpy((void*)lpBuffer, "LOL HACKED?\n", sizeof("LOL HACKED?\n"));
|
|
|
|
|
Hook::Disable((uintptr_t)&WriteFile);
|
|
|
|
|
memcpy((void*)lpBuffer, "shithooked!?\n", sizeof("shithooked!\n"));
|
|
|
|
|
hook::disable(&WriteFile);
|
|
|
|
|
BOOL result = WriteFile(hFile, lpBuffer, nNumberOfBytesToWrite, lpNumberOfBytesWritten, lpOverlapped);
|
|
|
|
|
Hook::Enable((uintptr_t)&WriteFile);
|
|
|
|
|
hook::enable(&WriteFile);
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int main()
|
|
|
|
|
{
|
|
|
|
|
cout << "Hello world" << endl;
|
|
|
|
|
Hook::Install(
|
|
|
|
|
(uintptr_t) &WriteFile,
|
|
|
|
|
(uintptr_t) &HookWriteFile
|
|
|
|
|
hook::install(
|
|
|
|
|
&WriteFile,
|
|
|
|
|
&HookWriteFile
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
OFSTRUCT ofstruct;
|
|
|
|
|