-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlaunch.c
50 lines (40 loc) · 891 Bytes
/
launch.c
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
/* * * * * * * *\
LAUNCH.C -
Copyright © 2024 Brady McDermott
DESCRIPTION -
ApiHook launcher program.
LICENSE INFORMATION -
MIT License, see LICENSE.txt in the root folder
\* * * * * * * */
/* Includes */
#define VC_EXTRALEAN
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
/* Functions */
/* * * *\
DllMain -
The application's entry point
\* * * */
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine, int nCmdShow)
{
HMODULE hLib = LoadLibrary(L"ApiHook.dll");
BOOL bRet = 0;
OutputDebugString(L"Starting ApiHook...\n");
// Call ApiHook's initialization function
if (hLib)
{
FARPROC fLib = GetProcAddress(hLib, "InstallUserHook");
bRet = (BOOL)fLib();
FreeLibrary(hLib);
FreeConsole();
return bRet;
}
else
{
OutputDebugString(L"ApiHook not found!\n");
FreeConsole();
return -1;
}
FreeConsole();
return 0;
}