-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdllmain.cpp
More file actions
54 lines (45 loc) · 1.19 KB
/
dllmain.cpp
File metadata and controls
54 lines (45 loc) · 1.19 KB
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
53
// dllmain.cpp : Defines the entry point for the DLL application.
#include "stdafx.h"
#include "ToggleStacker.h"
void Initialize()
{
// This method is executed when the game starts, before the user interface is shown
// Here you can do things such as:
// - Add new cheats
// - Add new simulator classes
// - Add new game modes
// - Add new space tools
// - Change materials
CheatManager.AddCheat("ToggleStacker", new ToggleStacker());
}
void Dispose()
{
// This method is called when the game is closing
}
void AttachDetours()
{
// Call the attach() method on any detours you want to add
// For example: cViewer_SetRenderType_detour::attach(GetAddress(cViewer, SetRenderType));
}
// Generally, you don't need to touch any code here
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
ModAPI::AddPostInitFunction(Initialize);
ModAPI::AddDisposeFunction(Dispose);
PrepareDetours(hModule);
AttachDetours();
CommitDetours();
break;
case DLL_PROCESS_DETACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
break;
}
return TRUE;
}