Advertisement
AngraMainyu

Untitled

Apr 4th, 2015
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.03 KB | None | 0 0
  1. #include <Windows.h>
  2. #include "globals.h"
  3. #define jmp(frm, to) (int)(((int)to - (int)frm) - 5)
  4.  
  5. void __declspec(naked) mainProcHook()
  6. {
  7.     __asm
  8.     {
  9.         cmp     ecx, 0x00001497
  10.         je      _Godmode
  11.         cmp     ecx, 0x00000f33
  12.         je      _FreezeSeconds
  13.         cmp     ecx, 0x00000f32
  14.         je      _FreezeDecaseconds
  15.         cmp     ecx, 0x00000f31
  16.         je      _FreezeHectaseconds
  17.  
  18.         _Normal:
  19.         mov     [ecx+0x0072b468], al
  20.  
  21.         _Exit:
  22.         jmp     [returnAddress]
  23.  
  24.         _Godmode:
  25.         cmp     boolGodmode, 1
  26.         jne     _Normal
  27.         mov     al, 0x7f
  28.         jmp     _Normal
  29.  
  30.         #pragma region Freeze Time
  31.  
  32.         _FreezeSeconds:
  33.         cmp     boolFreezeTime, 1
  34.         jne     _Normal
  35.         mov     al, seconds
  36.         jmp     _Normal
  37.  
  38.         _FreezeDecaseconds:
  39.         cmp     boolFreezeTime, 1
  40.         jne     _Normal
  41.         mov     al, decaseconds
  42.         jmp     _Normal
  43.  
  44.         _FreezeHectaseconds:
  45.         cmp     boolFreezeTime, 1
  46.         jne     _Normal
  47.         mov     al, hectaseconds
  48.         jmp     _Normal
  49.  
  50.         #pragma endregion
  51.     }
  52. }
  53. void initializeMainProcHook( void )
  54. {
  55.     *(BYTE*)mainProc = 0xe9; // jmp
  56.     *(DWORD*)(mainProc+1) = jmp(mainProc, mainProcHook);
  57.     *(BYTE*)(mainProc+5) = 0x90; // nop
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement