44 return (
PPEB)__readgsqword(0x60);
46 return (
PPEB)__readfsdword(0x30);
64 if (c1 <= L'Z' && c1 >= L
'A') {
65 c1 = (c1 - L
'A') + L
'a';
72 if (wanted_name == NULL || curr_name == NULL)
return false;
74 WCHAR *curr_end_ptr = curr_name;
75 while (*curr_end_ptr != L
'\0') {
78 if (curr_end_ptr == curr_name)
return false;
80 WCHAR *wanted_end_ptr = wanted_name;
81 while (*wanted_end_ptr != L
'\0') {
84 if (wanted_end_ptr == wanted_name)
return false;
86 while ((curr_end_ptr != curr_name) && (wanted_end_ptr != wanted_name)) {
115 if (curr_module == NULL || curr_module->
BaseAddress == NULL) {
123 }
while (curr_module != first_module);
146 if (curr_module == NULL || curr_module->
BaseAddress == NULL) {
149 if (hModule == (HMODULE)(curr_module->
BaseAddress)) {
154 }
while (curr_module != first_module);
SectionLocker(RTL_CRITICAL_SECTION &_section)
RTL_CRITICAL_SECTION & section
HMODULE get_main_module_via_peb()
bool set_main_module_in_peb(HMODULE hModule)
size_t get_module_size_via_peb(IN OPTIONAL HMODULE hModule=nullptr)
HMODULE get_module_via_peb(IN OPTIONAL LPWSTR module_name=nullptr)
NTSYSAPI NTSTATUS NTAPI RtlLeaveCriticalSection(IN PRTL_CRITICAL_SECTION CriticalSection)
NTSYSAPI NTSTATUS NTAPI RtlEnterCriticalSection(IN PRTL_CRITICAL_SECTION CriticalSection)
bool is_wanted_module(LPWSTR curr_name, LPWSTR wanted_name)
struct _LDR_MODULE * PLDR_MODULE
WCHAR to_lowercase(WCHAR c1)
struct _LDR_MODULE LDR_MODULE
Functions for retrieving process information from PEB.
LIST_ENTRY InLoadOrderModuleList
UNICODE_STRING FullDllName
LIST_ENTRY InMemoryOrderModuleList
UNICODE_STRING BaseDllName
LIST_ENTRY InInitializationOrderModuleList
LIST_ENTRY InLoadOrderModuleList
PRTL_CRITICAL_SECTION LoaderLock
PRTL_CRITICAL_SECTION FastPebLock