Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Windows.h>
- #include <process.h>
- #include "Detour.h"
- #include <string>
- UINT WINAPI hkGetSystemWow64Directory(LPTSTR lpBuffer,UINT uSize);
- BOOL WINAPI hkReadProcessMemory(HANDLE hProcess,LPCVOID lpBaseAddress,LPVOID lpBuffer,SIZE_T nSize,SIZE_T *lpNumberOfBytesRead);
- void InitPatch(void* lpArg){
- DWORD xBase;
- while(true){
- Sleep(500);
- xBase = (DWORD)GetModuleHandle("XTrapVa.dll");
- if(xBase > 0)
- break;
- }
- wmemcpy(reinterpret_cast<wchar_t*>(0x4069ABA0),reinterpret_cast<const wchar_t*>("\\.\XDva409"),11);
- DetourFunction((PBYTE)GetSystemWow64Directory,(PBYTE)hkGetSystemWow64Directory);
- DetourFunction((PBYTE)ReadProcessMemory,(PBYTE)hkReadProcessMemory);
- }
- bool __stdcall DllMain (HINSTANCE hMod, DWORD dwReason, LPVOID unused){
- if(dwReason == DLL_PROCESS_ATTACH){
- _beginthread(InitPatch,0,0);
- }
- return true;
- }
- BOOL WINAPI hkReadProcessMemory(HANDLE hProcess,LPCVOID lpBaseAddress,LPVOID lpBuffer,SIZE_T nSize,SIZE_T *lpNumberOfBytesRead)
- {
- if( &lpBuffer > 0 ){
- while(1){
- Sleep(250);
- }
- }
- return true;
- }
- UINT WINAPI hkGetSystemWow64Directory(LPTSTR lpBuffer,UINT uSize)
- {
- int ret = GetSystemDirectory(lpBuffer,uSize);
- return ret;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement