-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.cpp
39 lines (35 loc) · 865 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <xtl.h>
#include <xboxmath.h>
#include <xbox.h>
#include <xam.h>
#include <stdio.h>
#include "Hooking.h"
#include "utility.h"
typedef UINT32 (__cdecl * XamGetCurrentTitleId_t)(void);
XamGetCurrentTitleId_t XamGetCurrentTitleId = (XamGetCurrentTitleId_t)resolveFunct("xam.xex", 0x1CF);
int runningID;
HANDLE thisApplication;
BOOL APIENTRY DllMain(HANDLE hInstDLL, DWORD dreason, LPVOID lpReserved)
{
bool recognized = false;
LPTHREAD_START_ROUTINE functionToRun;
thisApplication = hInstDLL;
switch(dreason)
{
case DLL_PROCESS_ATTACH:
runningID = XamGetCurrentTitleId();
if(runningID == 0x41560817) //Running MW2
{
if(*(short *)0x8221A5A2 == 2 && *(short *)0x8221A5A6 == -32766) //TU8
MW2_TU8_Init();
}
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}