forked from dredknight/H5_DLL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dllmain.cpp
49 lines (39 loc) · 1.28 KB
/
dllmain.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
// dllmain.cpp : Defines the entry point for the DLL application.
#include "pch.h"
#include <iostream>
#include <windows.h>
#define EXTERN_DLL_EXPORT extern "C" __declspec(dllexport)
typedef BOOL(WINAPI* TrackingCountPtr)(void* a, char* b, int c, int d);
bool MMH55_LOADED = false;
EXTERN_DLL_EXPORT BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
{
switch (ul_reason_for_call) {
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
}
EXTERN_DLL_EXPORT BOOL TrackingCount(void* a, char* b, int c, int d) {
//HINSTANCE UbiStatsDLL = LoadLibrary(TEXT("UbiStats2.dll"));
//if (!UbiStatsDLL) {
// printf("Load failed with 0x%x\n", GetLastError());
// return FALSE;
//}
//TrackingCountPtr original_function = (TrackingCountPtr)GetProcAddress(UbiStatsDLL, "TrackingCount");
//if (!original_function) {
// return FALSE;
//}
/****** MMH55_64 CODE START *******/
/****** MMH55_64 CODE END *******/
//BOOL result = original_function(a, b, c, d);
//FreeLibrary(UbiStatsDLL);
if (!MMH55_LOADED) {
main();
MMH55_LOADED = true;
}
return true;
}