-
Notifications
You must be signed in to change notification settings - Fork 6
/
regionfree.cpp
52 lines (44 loc) · 1.16 KB
/
regionfree.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
40
41
42
43
44
45
46
47
48
49
50
51
52
#include "windows.h"
#include <stdint.h>
typedef uintptr_t uintptr;
#include "MemoryMgr.h" // take from skygfx_vc
typedef uint8_t uint8, uchar;
typedef uint16_t uint16, ushort;
typedef uint32_t uint32, uint;
typedef uint64_t uint64;
typedef int8_t int8;
typedef int16_t int16;
typedef int32_t int32;
typedef int64_t int64;
#define nil NULL
#define FIELD(type, var, offset) *(type*)((uint8*)var + offset)
int gtaversion = -1;
void
patchIII10(void)
{
// don't set frenchGame and germanGame in
// CMenuManager::InitialiseChangedLanguageSettings
InjectHook(0x47A51B, 0x47A537, PATCH_JUMP);
// and additionally nastyGame, noProstitues and m_PrefsAllowNastyGame in
// InitialiseLanguage
InjectHook(0x5821C2, 0x582222, PATCH_JUMP);
}
void
patchVC10(void)
{
// same as patchIII10
InjectHook(0x4A38EC, 0x4A3948, PATCH_JUMP);
InjectHook(0x600B42, 0x600BA2, PATCH_JUMP);
}
BOOL WINAPI
DllMain(HINSTANCE hInst, DWORD reason, LPVOID)
{
if(reason == DLL_PROCESS_ATTACH){
AddressByVersion<uint32_t>(0, 0, 0, 0, 0, 0);
if (gtaversion == III_10)
patchIII10();
else if(gtaversion == VC_10)
patchVC10();
}
return TRUE;
}