forked from weak1337/BE-Shellcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbeshellcode.cpp
More file actions
61 lines (53 loc) · 2 KB
/
Copy pathbeshellcode.cpp
File metadata and controls
61 lines (53 loc) · 2 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
54
55
56
57
58
59
60
61
#include "beshellcode.h"
void beshellcode::report(report_ids report_id) {
printf("Triggered report id: %x\n", report_id);
}
HANDLE beshellcode::add_exception_handler() {
PVOID handler = AddVectoredExceptionHandler(1, veh::be_handler);
if (handler != INVALID_HANDLE_VALUE) {
HMODULE user32 = LoadLibraryA("USER32.dll");
HMODULE kernel32 = LoadLibraryA("KERNEL32.dll");
HMODULE win32u = LoadLibraryA("win32u.dll");
HMODULE ntdll = LoadLibraryA("ntdll.dll");
HMODULE ucrtbase = LoadLibraryA("ucrtbase.dll");
veh::add_func((uintptr_t)GetProcAddress(user32, "GetAsyncKeyState"));
veh::add_func((uintptr_t)GetProcAddress(user32, "GetCursorPos"));
veh::add_func((uintptr_t)GetProcAddress(kernel32, "IsBadReadPtr"));
veh::add_func((uintptr_t)GetProcAddress(win32u, "NtUserGetAsyncKeyState"));
veh::add_func((uintptr_t)GetProcAddress(user32, "GetForegroundWindow"));
veh::add_func((uintptr_t)GetProcAddress(user32, "CallWindowProcW"));
veh::add_func((uintptr_t)GetProcAddress(win32u, "NtUserPeekMessage"));
veh::add_func((uintptr_t)GetProcAddress(ntdll, "NtSetEvent"));
veh::add_func((uintptr_t)GetProcAddress(ucrtbase, "__stdio_common_vsprintf_s"));
veh::add_func((uintptr_t)GetProcAddress(ucrtbase, "sqrtf"));
}
/*
Some additional d3d11 + dxgi + game specific stuff
*/
return (HANDLE)handler;
}
void beshellcode::remove_exception_handler(HANDLE handle) {
if(handle != INVALID_HANDLE_VALUE)
RemoveVectoredExceptionHandler(handle);
}
void beshellcode::find_system_threads()
{
if (systhreadfinder::found_sys_thread(10)) {
report(report_ids::HiddenSystemThread);
}
}
void beshellcode::check_KiUserExceptionDispatcher_hook() {
misc::check_KiUserExceptionDispatcher_hook();
}
void beshellcode::check_modules() {
module_check::check_modules();
}
void beshellcode::function_integrity() {
misc::check_integrity();
}
void beshellcode::scan_sigs() {
signatures::scan_sigs();
}
void beshellcode::scan_threads() {
thread_scan::scan_threads();
}