Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Windows.h>
- #include "globals.h"
- #define jmp(frm, to) (int)(((int)to - (int)frm) - 5)
- void __declspec(naked) mainProcHook()
- {
- __asm
- {
- cmp ecx, 0x00001497
- je _Godmode
- cmp ecx, 0x00000f33
- je _FreezeSeconds
- cmp ecx, 0x00000f32
- je _FreezeDecaseconds
- cmp ecx, 0x00000f31
- je _FreezeHectaseconds
- _Normal:
- mov [ecx+0x0072b468], al
- _Exit:
- jmp [returnAddress]
- _Godmode:
- cmp boolGodmode, 1
- jne _Normal
- mov al, 0x7f
- jmp _Normal
- #pragma region Freeze Time
- _FreezeSeconds:
- cmp boolFreezeTime, 1
- jne _Normal
- mov al, seconds
- jmp _Normal
- _FreezeDecaseconds:
- cmp boolFreezeTime, 1
- jne _Normal
- mov al, decaseconds
- jmp _Normal
- _FreezeHectaseconds:
- cmp boolFreezeTime, 1
- jne _Normal
- mov al, hectaseconds
- jmp _Normal
- #pragma endregion
- }
- }
- void initializeMainProcHook( void )
- {
- *(BYTE*)mainProc = 0xe9; // jmp
- *(DWORD*)(mainProc+1) = jmp(mainProc, mainProcHook);
- *(BYTE*)(mainProc+5) = 0x90; // nop
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement