-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDllMain.cpp
More file actions
34 lines (28 loc) · 721 Bytes
/
DllMain.cpp
File metadata and controls
34 lines (28 loc) · 721 Bytes
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
#include <Windows.h>
#include "ModUtils.h"
using namespace ModUtils;
DWORD WINAPI MainThread(LPVOID lpParam)
{
Log("Activating RemoveVignette...");
std::string aob = "8b 42 54 89 81 50 01 00 00 8b 42 60 89 81 78 01 00 00";
std::string expectedBytes = "8b 42 60";
std::string newBytes = "31 c0 90";
uintptr_t patchAddress = AobScan(aob);
size_t offset = 9;
if (patchAddress != 0)
{
patchAddress += offset;
ReplaceExpectedBytesAtAddress(patchAddress, expectedBytes, newBytes);
}
CloseLog();
return 0;
}
BOOL WINAPI DllMain(HINSTANCE module, DWORD reason, LPVOID)
{
if (reason == DLL_PROCESS_ATTACH)
{
DisableThreadLibraryCalls(module);
CreateThread(0, 0, &MainThread, 0, 0, NULL);
}
return 1;
}