forked from 66hh/RiptermsGhost
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
50 lines (44 loc) · 1.17 KB
/
main.cpp
File metadata and controls
50 lines (44 loc) · 1.17 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
#include <Windows.h>
#include <iostream>
#include "Ripterms/Ripterms.h"
#define RIPTERMS_INJECTOR 66666
BOOL WINAPI DllMain(
HINSTANCE hinstDLL, // handle to DLL module
DWORD fdwReason, // reason for calling function
LPVOID lpvReserved) // reserved
{
// Perform actions based on the reason for calling.
switch (fdwReason)
{
case RIPTERMS_INJECTOR:
case DLL_PROCESS_ATTACH:
{
// Initialize once for each new process.
// Return FALSE to fail DLL load.
if (!Ripterms::init(hinstDLL))
{
std::cin.ignore();
FreeConsole();
return FALSE;
}
std::cout << "Init success" << std::endl;
return TRUE;
}
case DLL_THREAD_ATTACH:
// Do thread-specific initialization.
break;
case DLL_THREAD_DETACH:
// Do thread-specific cleanup.
break;
case DLL_PROCESS_DETACH:
if (lpvReserved != nullptr)
{
//process termination
Ripterms::partialClean();
break;
}
// Perform any necessary cleanup.
break;
}
return TRUE; // Successful DLL_PROCESS_ATTACH.
}