Function at 0x1400018d0
Capabilities:
Allocate or change rwx memory
Parse pe header

Disassembly:
push rbx
push r12
sub rsp, 0x28
mov rdx, qword [rcx + 8]
mov rbx, rcx
sub rdx, qword [rcx]
mov r8d, 0x3000
xor ecx, ecx
lea r9d, [rcx + 4]
call qword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov r12, rax
test rax, rax
jne 0x14000193c
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
lea rdx, str.VirtualAlloc_failed:
mov ebx, eax
call fcn.140002210
mov rcx, rax
mov edx, ebx
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::operator___unsigned_long_int____ptr64]
mov rcx, rax
lea rdx, [0x1400023e0]
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64____cdecl___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64_____ptr64]
xor eax, eax
add rsp, 0x28
pop r12
pop rbx
ret
mov rdx, qword [rbx]
mov rcx, r12
mov r8, qword [rbx + 8]
sub r8, rdx
call sub.VCRUNTIME140.dll_memcpy
mov eax, 0x5a4d
cmp word [r12], ax
je 0x140001998
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
lea rdx, str.Invalid_DOS_signature.
call fcn.140002210
mov rcx, rax
lea rdx, [0x1400023e0]
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64____cdecl___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64_____ptr64]
xor edx, edx
mov r8d, 0x8000
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_VirtualFree]
xor eax, eax
add rsp, 0x28
pop r12
pop rbx
ret
mov qword [rsp + 0x50], rdi
movsxd rdi, dword [r12 + 0x3c]
add rdi, r12
cmp dword [rdi], 0x4550
je 0x1400019f0
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
lea rdx, str.Invalid_NT_signature.
call fcn.140002210
mov rcx, rax
lea rdx, [0x1400023e0]
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64____cdecl___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64_____ptr64]
xor edx, edx
mov r8d, 0x8000
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_VirtualFree]
mov rdi, qword [rsp + 0x50]
xor eax, eax
add rsp, 0x28
pop r12
pop rbx
ret
mov edx, dword [rdi + 0x50]
mov r9d, 0x40
mov rcx, qword [rdi + 0x30]
mov r8d, 0x3000
mov qword [rsp + 0x48], rsi
call qword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov rsi, rax
test rax, rax
jne 0x140001a5e
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
lea rdx, str.Failed_to_allocate_memory_for_image.
call fcn.140002210
mov rcx, rax
lea rdx, [0x1400023e0]
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64____cdecl___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64_____ptr64]
xor edx, edx
mov r8d, 0x8000
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_VirtualFree]
mov rsi, qword [rsp + 0x48]
xor eax, eax
mov rdi, qword [rsp + 0x50]
add rsp, 0x28
pop r12
pop rbx
ret
mov r8d, dword [rdi + 0x54]
mov rdx, r12
mov rcx, rsi
mov qword [rsp + 0x40], rbp
call sub.VCRUNTIME140.dll_memcpy
movzx ebx, word [rdi + 0x14]
xor ebp, ebp
add rbx, 0x2c
cmp bp, word [rdi + 6]
jae 0x140001ab2
add rbx, rdi
nop word [rax + rax]
mov edx, dword [rbx]
mov ecx, dword [rbx - 8]
add rdx, r12
mov r8d, dword [rbx - 4]
add rcx, rsi
call sub.VCRUNTIME140.dll_memcpy
movzx eax, word [rdi + 6]
lea rbx, [rbx + 0x28]
inc ebp
cmp ebp, eax
jl 0x140001a90
mov ebp, dword [rdi + 0x90]
add rbp, rsi
mov qword [rsp + 0x58], r14
mov qword [rsp + 0x20], r15
mov eax, dword [rbp + 0xc]
test eax, eax
je 0x140001b35
nop dword [rax]
mov ebx, eax
add rbx, rsi
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov r15, rax
test rax, rax
je 0x140001b83
mov ebx, dword [rbp]
mov edi, dword [rbp + 0x10]
add rbx, rsi
add rdi, rsi
mov rcx, qword [rbx]
test rcx, rcx
je 0x140001b2a
nop
lea r14, [rcx + rsi]
mov rcx, r15
lea rdx, [r14 + 2]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rdi], rax
test rax, rax
je 0x140001b6a
mov rcx, qword [rbx + 8]
add rbx, 8
add rdi, 8
test rcx, rcx
jne 0x140001b00
mov eax, dword [rbp + 0x20]
add rbp, 0x14
test eax, eax
jne 0x140001ad0
xor edx, edx
mov r8d, 0x8000
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_VirtualFree]
mov rax, rsi
mov r14, qword [rsp + 0x58]
mov r15, qword [rsp + 0x20]
mov rbp, qword [rsp + 0x40]
mov rsi, qword [rsp + 0x48]
mov rdi, qword [rsp + 0x50]
add rsp, 0x28
pop r12
pop rbx
ret
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
lea rdx, str.Failed_to_resolve_import:
call fcn.140002210
lea rdx, [r14 + 2]
jmp 0x140001b99
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
lea rdx, str.Failed_to_load_module:
call fcn.140002210
mov rdx, rbx
mov rcx, rax
call fcn.140002210
lea rdx, [0x1400023e0]
mov rcx, rax
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64____cdecl___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64_____ptr64]
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
lea rdx, str.Failed_to_resolve_imports.
call fcn.140002210
mov rcx, rax
lea rdx, [0x1400023e0]
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64____cdecl___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64_____ptr64]
xor edx, edx
mov r8d, 0x8000
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_VirtualFree]
xor edx, edx
mov r8d, 0x8000
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_VirtualFree]
xor eax, eax
jmp 0x140001b49