Function at 0x140021b00
Capabilities:
Parse pe header

Disassembly:
push rbp
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 7]
sub rsp, 0xa8
mov rax, qword [0x140037010]
xor rax, rsp
mov qword [rbp - 9], rax
mov r13, rdx
mov rsi, rcx
mov qword [rbp - 0x19], r8
mov qword [rbp - 0x11], r9
movzx r14d, byte [rbp + 0x77]
mov byte [rbp - 0x71], r14b
mov rax, qword [rbp + 0x8f]
mov qword [rbp - 0x29], rax
mov rax, qword [rbp + 0x97]
mov qword [rbp - 0x21], rax
mov eax, 0x5a4d
cmp word [rdx], ax
jne 0x14002208f
movsxd rdi, dword [rdx + 0x3c]
add rdi, rdx
cmp dword [rdi], 0x4550
jne 0x14002208f
mov eax, 0x20b
cmp word [rdi + 0x18], ax
je 0x140021b8c
lea rdx, str.____Image_is_not_64_bit
jmp 0x140022096
mov ebx, dword [rdi + 0x50]
mov edx, ebx
xor ecx, ecx
lea r9d, [rcx + 4]
mov r8d, 0x3000
call qword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov r12, rax
test rax, rax
je 0x1400220b2
movzx eax, word [rdi + 0x14]
mov ecx, dword [rax + rdi + 0x24]
mov dword [rbp - 0x61], ecx
xor r15d, r15d
mov eax, r15d
test r14b, r14b
cmovne eax, ecx
mov dword [rbp - 0x55], eax
sub ebx, eax
mov dword [rbp - 0x59], ebx
mov qword [rbp - 0x51], r15
mov eax, dword [rbp + 0x7f]
cmp eax, 1
jne 0x140021bf0
mov edx, ebx
lea r8, [rbp - 0x51]
mov rcx, rsi
call fcn.1400213e0
mov r15, rax
jmp 0x140021d33
cmp eax, 2
jne 0x140021c07
mov edx, ebx
mov rcx, rsi
call fcn.140021890
mov r15, rax
jmp 0x140021d33
test rbx, rbx
je 0x140021d06
mov edx, 4
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
mov eax, dword [rdx + rcx]
cmp dword [0x140037ab0], eax
jle 0x140021cd9
lea rcx, [0x140037ab0]
call fcn.140024970
cmp dword [0x140037ab0], 0xffffffff
jne 0x140021cd9
mov qword [rbp - 0x49], r15
mov qword [rbp - 0x39], r15
mov qword [rbp - 0x31], 0xf
mov byte [rbp - 0x49], 0
mov r8d, 0x15
lea rdx, [0x140028400]
lea rcx, [rbp - 0x49]
call fcn.140005e20
nop
lea r8, [rbp - 0x49]
mov rdx, qword [0x140037a38]
mov rcx, rsi
call fcn.140002e00
mov qword [0x140037b98], rax
mov rdx, qword [rbp - 0x31]
cmp rdx, 0x10
jb 0x140021ccd
inc rdx
mov rcx, qword [rbp - 0x49]
mov rax, rcx
cmp rdx, 0x1000
jb 0x140021cc7
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x140021cc7
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.1400247e0
nop
lea rcx, [0x140037ab0]
call fcn.140024910
cmp qword [0x140037b98], 0
jne 0x140021d16
lea rdx, str.____Failed_to_find_ExAllocatePool
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t___std::wcout]
call fcn.140005fb0
lea rdx, [0x140006190]
mov rcx, rax
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______ptr64___cdecl_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t__::operator___class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______ptr64____cdecl___class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______ptr64_____ptr64]
mov qword [rbp - 0x69], r15
lea rdx, str.____Failed_to_allocate_remote_image_in_kernel
jmp 0x140021f4e
mov qword [rbp - 0x69], r15
mov qword [rsp + 0x20], rbx
lea rdx, [rbp - 0x69]
mov rcx, rsi
call fcn.140007830
test al, al
je 0x140021d06
mov r15, qword [rbp - 0x69]
mov qword [rbp - 0x69], r15
test r15, r15
jne 0x140021d48
lea rdx, str.____Failed_to_allocate_remote_image_in_kernel
jmp 0x140021f4e
lea rdx, str.___Image_base_has_been_allocated_at_0x
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t___std::wcout]
call fcn.140005fb0
mov rdx, r15
mov rcx, rax
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______ptr64___cdecl_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t__::operator___void_const____ptr64____ptr64]
lea rdx, [0x140006190]
mov rcx, rax
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______ptr64___cdecl_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t__::operator___class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______ptr64____cdecl___class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______ptr64_____ptr64]
mov r8d, dword [rdi + 0x54]
mov rdx, r13
mov rcx, r12
call sub.VCRUNTIME140.dll_memcpy
movzx ebx, word [rdi + 0x14]
add rbx, 0x28
xor eax, eax
mov r14d, eax
cmp ax, word [rdi + 6]
jae 0x140021dcd
add rbx, rdi
nop dword [rax]
test dword [rbx + 0x14], 0x80
ja 0x140021dbd
mov r8d, dword [rbx]
mov edx, dword [rbx + 4]
add rdx, r13
mov ecx, dword [rbx - 4]
add rcx, r12
call sub.VCRUNTIME140.dll_memcpy
inc r14d
add rbx, 0x28
movzx eax, word [rdi + 6]
cmp r14d, eax
jl 0x140021da0
mov r14, r15
cmp byte [rbp - 0x71], 0
je 0x140021e29
mov ebx, dword [rbp - 0x61]
sub r15, rbx
lea rdx, str.___Skipped_0x
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t___std::wcout]
call fcn.140005fb0
lea rdx, [0x1400012b0]
mov rcx, rax
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______ptr64___cdecl_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t__::operator___class_std::ios_base____ptr64____cdecl___class_std::ios_base____ptr64_____ptr64]
mov edx, ebx
mov rcx, rax
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______ptr64___cdecl_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t__::operator___unsigned_long_int____ptr64]
mov rcx, rax
lea rdx, str._bytes_of_PE_Header
call fcn.140005fb0
lea rdx, [0x140006190]
mov rcx, rax
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______ptr64___cdecl_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t__::operator___class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______ptr64____cdecl___class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______ptr64_____ptr64]
mov rbx, r15
sub rbx, qword [rdi + 0x30]
mov rdx, r12
lea rcx, [rbp - 0x49]
call fcn.140022f60
mov rdx, rbx
mov rcx, rax
call fcn.1400220e0
mov rdx, r15
mov rcx, r12
call fcn.1400221e0
test al, al
jne 0x140021e62
lea rdx, str.____Failed_to_fix_cookie
jmp 0x140022096
mov rdx, r12
lea rcx, [rbp - 0x49]
call fcn.1400230b0
mov rdx, rax
mov rcx, rsi
call fcn.140022330
test al, al
jne 0x140021e89
lea rdx, str.____Failed_to_resolve_imports
jmp 0x140021f4e
mov ebx, dword [rbp - 0x59]
mov r8d, dword [rbp - 0x55]
add r8, r12
mov r9d, ebx
mov rdx, r14
mov rcx, rsi
call fcn.140002630
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t___std::wcout]
test al, al
jne 0x140021eb8
lea rdx, str.____Failed_to_write_local_image_to_remote_image
jmp 0x140021f55
mov edi, dword [rdi + 0x28]
add rdi, r15
lea rdx, str.____Calling_DriverEntry_0x
call fcn.140005fb0
mov rdx, rdi
mov rcx, rax
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______ptr64___cdecl_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t__::operator___void_const____ptr64____ptr64]
lea rdx, [0x140006190]
mov rcx, rax
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______ptr64___cdecl_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t__::operator___class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______ptr64____cdecl___class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______ptr64_____ptr64]
mov rax, qword [rbp - 0x29]
mov r15, qword [rbp - 0x51]
test rax, rax
je 0x140021f15
mov qword [rsp + 0x20], r15
mov r9, rbx
mov r8, r14
lea rdx, [rbp - 0x11]
lea rcx, [rbp - 0x19]
call rax
test al, al
jne 0x140021f15
lea rdx, str.____Callback_returns_false__failed_
jmp 0x140021f4e
mov dword [rbp - 0x61], 0
mov r9, qword [rbp - 0x19]
cmp byte [rbp + 0x87], 0
cmovne r9, r14
mov rax, qword [rbp - 0x11]
mov qword [rsp + 0x20], rax
mov r8, rdi
lea rdx, [rbp - 0x61]
mov rcx, rsi
call fcn.140022690
test al, al
jne 0x140021f8c
lea rdx, str.____Failed_to_call_driver_entry
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t___std::wcout]
call fcn.140005fb0
lea rdx, [0x140006190]
mov rcx, rax
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______ptr64___cdecl_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t__::operator___class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______ptr64____cdecl___class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______ptr64_____ptr64]
xor edx, edx
mov r8d, 0x8000
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_VirtualFree]
mov rdx, qword [rbp - 0x69]
mov rcx, rsi
call fcn.140002cc0
jmp 0x1400220b2
mov edi, dword [rbp - 0x61]
mov rax, qword [rbp - 0x21]
test rax, rax
je 0x140021f9a
mov dword [rax], edi
lea rdx, str.___DriverEntry_returned_0x
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t___std::wcout]
call fcn.140005fb0
lea rdx, [0x1400012b0]
mov rcx, rax
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______ptr64___cdecl_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t__::operator___class_std::ios_base____ptr64____cdecl___class_std::ios_base____ptr64_____ptr64]
mov edx, edi
mov rcx, rax
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______ptr64___cdecl_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t__::operator___long_int____ptr64]
lea rdx, [0x140006190]
mov rcx, rax
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______ptr64___cdecl_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t__::operator___class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______ptr64____cdecl___class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______ptr64_____ptr64]
cmp byte [rbp + 0x6f], 0
je 0x140022067
lea rdx, str.___Freeing_memory
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t___std::wcout]
call fcn.140005fb0
lea rdx, [0x140006190]
mov rcx, rax
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______ptr64___cdecl_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t__::operator___class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______ptr64____cdecl___class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______ptr64_____ptr64]
mov eax, dword [rbp + 0x7f]
mov rdx, r14
cmp eax, 1
jne 0x14002207d
mov r8, r15
mov rcx, rsi
call fcn.140002a40
test al, al
je 0x140022044
mov rdx, r15
mov rcx, rsi
call fcn.140002b80
test al, al
je 0x140022044
mov rdx, r15
mov rcx, rsi
call fcn.140002cc0
test al, al
lea rdx, str.___Memory_has_been_released
jne 0x14002204b
lea rdx, str.____WARNING:_Failed_to_free_memory_
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t___std::wcout]
call fcn.140005fb0
lea rdx, [0x140006190]
mov rcx, rax
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______ptr64___cdecl_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t__::operator___class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______ptr64____cdecl___class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______ptr64_____ptr64]
xor edx, edx
mov r8d, 0x8000
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_VirtualFree]
mov rax, r14
jmp 0x1400220b4
cmp eax, 2
jne 0x140022031
mov r8d, ebx
mov rcx, rsi
call fcn.140002920
jmp 0x140022039
lea rdx, str.____Invalid_format_of_PE_image
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t___std::wcout]
call fcn.140005fb0
lea rdx, [0x140006190]
mov rcx, rax
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______ptr64___cdecl_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t__::operator___class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______ptr64____cdecl___class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______ptr64_____ptr64]
xor eax, eax
mov rcx, qword [rbp - 9]
xor rcx, rsp
call fcn.1400247c0
add rsp, 0xa8
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret