Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <windows.h>
- #include <assert.h>
- typedef uintptr_t addr;
- #include "MemoryMgr.h"
- typedef unsigned char uchar;
- typedef unsigned short ushort;
- typedef unsigned int uint;
- #define RET(n) __asm push n __asm retn
- #define ASM(name) void __declspec(naked) name(void)
- ASM(techtree_asm)
- {
- __asm {
- cmp ecx, 104
- jnz slingers_hook
- cmp dword ptr [edi], 775
- jnz slingers_hook
- cmp dword ptr [esi+0x81C], 14
- jnz endif_5B3C42
- slingers_hook:
- cmp ecx, 87
- jnz endif_5B3B9F
- cmp dword ptr [edi], 185
- jnz endif_5B3B9F
- cmp dword ptr [esi+0x81C], 21
- jnz endif_5B3C42
- endif_5B3B9F:
- RET(0x5B3B9F);
- endif_5B3C42:
- RET(0x5B3C42);
- }
- }
- BOOL WINAPI
- DllMain(HINSTANCE hInst, DWORD reason, LPVOID)
- {
- if(reason == DLL_PROCESS_ATTACH) {
- if (*(int*)0x6146F0 == 0x042474ff && *(int*)0x51A3B8 == 0x002A6674) {
- if (strstr((char*)GetCommandLine(), "age2_x2")) {
- InjectHook(0x5B3B85, techtree_asm, PATCH_JUMP);
- }
- }
- }
- return TRUE;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement