Function at 0x140003820
Capabilities:
Get system information on windows
Parse pe header

Disassembly:
push rbx
push r12
push r13
sub rsp, 0x50
xor ebx, ebx
mov r13, rdx
mov r12, rcx
cmp rdx, 0x40
jae 0x14000384f
mov ecx, 0xd
call qword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
add rsp, 0x50
pop r13
pop r12
pop rbx
ret
mov eax, 0x5a4d
cmp word [rcx], ax
je 0x140003870
mov ecx, 0xc1
call qword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
add rsp, 0x50
pop r13
pop r12
pop rbx
ret
movsxd rcx, dword [rcx + 0x3c]
lea rax, [rcx + 0x108]
cmp rdx, rax
jb 0x140003838
cmp dword [rcx + r12], 0x4550
mov qword [rsp + 0x78], rsi
lea rsi, [rcx + r12]
jne 0x1400038a5
mov eax, 0x8664
cmp word [rsi + 4], ax
jne 0x1400038a5
mov eax, dword [rsi + 0x38]
test al, 1
je 0x1400038c1
mov ecx, 0xc1
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rsi, qword [rsp + 0x78]
xor eax, eax
add rsp, 0x50
pop r13
pop r12
pop rbx
ret
movzx ecx, word [rsi + 0x14]
mov r9, rax
movzx eax, word [rsi + 6]
mov qword [rsp + 0x80], rdi
test eax, eax
je 0x140003903
lea rcx, [rcx + rsi + 0x24]
mov r8, rax
mov edx, dword [rcx + 4]
test edx, edx
jne 0x1400038ee
mov eax, dword [rcx]
add rax, r9
jmp 0x1400038f2
mov eax, dword [rcx]
add eax, edx
cmp rax, rbx
cmova rbx, rax
add rcx, 0x28
sub r8, 1
jne 0x1400038e0
lea rcx, [rsp + 0x20]
call qword [sym.imp.KERNEL32.dll_GetNativeSystemInfo]
mov r11d, dword [rsp + 0x24]
mov eax, dword [rsi + 0x50]
lea edx, [r11 - 1]
lea edi, [rax + r11 - 1]
lea rcx, [r11 + rbx - 1]
not edx
and rdi, rdx
and rcx, rdx
cmp rdi, rcx
je 0x140003943
mov ecx, 0xc1
call qword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x140003a27
mov rcx, qword [rsi + 0x30]
mov r9d, 4
mov r8d, 0x3000
mov rdx, rdi
mov qword [rsp + 0x70], rbp
call qword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov rbp, rax
test rax, rax
jne 0x140003986
lea r9d, [rax + 4]
mov r8d, 0x3000
mov rdx, rdi
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov rbp, rax
test rax, rax
je 0x1400039b7
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov edx, 8
lea r8d, [rdx + 0x50]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov rdi, rax
test rax, rax
jne 0x1400039c4
xor edx, edx
mov r8d, 0x8000
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_VirtualFree]
mov ecx, 0xe
call qword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x140003a20
mov qword [rax + 8], rbp
movzx eax, word [rsi + 0x16]
mov qword [rdi + 0x40], 0
shr eax, 0xd
and eax, 1
mov dword [rdi + 0x20], eax
lea rax, [0x1400037f0]
mov qword [rdi + 0x28], rax
lea rax, [0x140003800]
mov qword [rdi + 0x30], rax
lea rax, [0x140003810]
mov qword [rdi + 0x38], rax
mov eax, dword [rsp + 0x24]
mov dword [rdi + 0x50], eax
mov edx, dword [rsi + 0x54]
cmp r13, rdx
jae 0x140003a3e
mov ecx, 0xd
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rcx, rdi
call fcn.140003c90
xor eax, eax
mov rbp, qword [rsp + 0x70]
mov rdi, qword [rsp + 0x80]
mov rsi, qword [rsp + 0x78]
add rsp, 0x50
pop r13
pop r12
pop rbx
ret
mov r9d, 4
mov r8d, 0x1000
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov r8d, dword [rsi + 0x54]
mov rdx, r12
mov rcx, rax
mov rbx, rax
call sub.MSVCR90.dll_memcpy
movsxd rax, dword [r12 + 0x3c]
mov r9, rdi
add rax, rbx
mov r8, rsi
mov rdx, r13
mov qword [rdi], rax
mov rcx, r12
mov qword [rax + 0x30], rbp
call fcn.1400031e0
test eax, eax
je 0x140003a18
mov rax, qword [rdi]
mov rdx, qword [rax + 0x30]
sub rdx, qword [rsi + 0x30]
je 0x140003aa3
mov rcx, rdi
call fcn.140003580
mov dword [rdi + 0x24], eax
jmp 0x140003aaa
mov dword [rdi + 0x24], 1
mov rcx, rdi
call fcn.140003650
test eax, eax
je 0x140003a18
mov rcx, rdi
call fcn.140003300
test eax, eax
je 0x140003a18
mov rax, qword [rdi]
mov rsi, qword [rdi + 8]
mov ecx, dword [rax + 0xd0]
test ecx, ecx
je 0x140003b09
mov rbx, qword [rcx + rsi + 0x18]
test rbx, rbx
je 0x140003b09
mov rax, qword [rbx]
test rax, rax
je 0x140003b09
nop dword [rax]
xor r8d, r8d
mov rcx, rsi
lea edx, [r8 + 1]
call rax
mov rax, qword [rbx + 8]
add rbx, 8
test rax, rax
jne 0x140003af0
mov rax, qword [rdi]
mov ecx, dword [rax + 0x28]
test ecx, ecx
je 0x140003b5e
cmp dword [rdi + 0x20], 0
je 0x140003b4d
xor r8d, r8d
lea rax, [rbp + rcx]
mov rcx, rbp
lea edx, [r8 + 1]
call rax
test eax, eax
jne 0x140003b3e
mov ecx, 0x45a
call qword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x140003a18
mov dword [rdi + 0x1c], 1
mov rax, rdi
jmp 0x140003a22
lea rax, [rbp + rcx]
mov qword [rdi + 0x48], rax
mov rax, rdi
jmp 0x140003a22
mov qword [rdi + 0x48], 0
mov rax, rdi
jmp 0x140003a22