Advertisement
Guest User

1337

a guest
Apr 22nd, 2014
881
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. #include <Windows.h>
  2. #include <process.h>
  3. #include "Detour.h"
  4. #include <string>
  5.  
  6. UINT WINAPI hkGetSystemWow64Directory(LPTSTR lpBuffer,UINT uSize);
  7. BOOL WINAPI hkReadProcessMemory(HANDLE hProcess,LPCVOID lpBaseAddress,LPVOID lpBuffer,SIZE_T nSize,SIZE_T *lpNumberOfBytesRead);
  8.  
  9.  
  10. void InitPatch(void* lpArg){
  11.  
  12. DWORD xBase;
  13. while(true){
  14. Sleep(500);
  15. xBase = (DWORD)GetModuleHandle("XTrapVa.dll");
  16. if(xBase > 0)
  17. break;
  18. }
  19.  
  20.  
  21. wmemcpy(reinterpret_cast<wchar_t*>(0x4069ABA0),reinterpret_cast<const wchar_t*>("\\.\XDva409"),11);
  22. DetourFunction((PBYTE)GetSystemWow64Directory,(PBYTE)hkGetSystemWow64Directory);
  23.  
  24.  
  25.  
  26. DetourFunction((PBYTE)ReadProcessMemory,(PBYTE)hkReadProcessMemory);
  27.  
  28.  
  29.  
  30. }
  31.  
  32. bool __stdcall DllMain (HINSTANCE hMod, DWORD dwReason, LPVOID unused){
  33. if(dwReason == DLL_PROCESS_ATTACH){
  34. _beginthread(InitPatch,0,0);
  35. }
  36. return true;
  37. }
  38.  
  39.  
  40. BOOL WINAPI hkReadProcessMemory(HANDLE hProcess,LPCVOID lpBaseAddress,LPVOID lpBuffer,SIZE_T nSize,SIZE_T *lpNumberOfBytesRead)
  41. {
  42.  
  43. if( &lpBuffer > 0 ){
  44. while(1){
  45. Sleep(250);
  46.  
  47. }
  48. }
  49. return true;
  50. }
  51.  
  52. UINT WINAPI hkGetSystemWow64Directory(LPTSTR lpBuffer,UINT uSize)
  53. {
  54.  
  55. int ret = GetSystemDirectory(lpBuffer,uSize);
  56. return ret;
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement