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

Disassembly:
push rbx
push r14
push r15
sub rsp, 0x50
xor ebx, ebx
mov r15, rdx
mov r14, rcx
cmp rdx, 0x40
jae 0x1800121bf
mov ecx, reloc.WS2_32.dll_listen
call qword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
add rsp, 0x50
pop r15
pop r14
pop rbx
ret
mov eax, 0x5a4d
cmp word [rcx], ax
je 0x1800121e0
mov ecx, 0xc1
call qword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
add rsp, 0x50
pop r15
pop r14
pop rbx
ret
movsxd rcx, dword [rcx + 0x3c]
lea rax, [rcx + 0x108]
cmp r15, rax
jb 0x1800121a8
cmp dword [rcx + r14], 0x4550
mov qword [rsp + 0x78], rsi
lea rsi, [rcx + r14]
jne 0x180012216
mov eax, 0x8664
cmp word [rsi + 4], ax
jne 0x180012216
mov ecx, dword [rsi + 0x38]
test cl, 1
je 0x180012232
mov ecx, 0xc1
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rsi, qword [rsp + 0x78]
xor eax, eax
add rsp, 0x50
pop r15
pop r14
pop rbx
ret
movzx eax, word [rsi + 0x14]
lea rdx, [rsi + 0x24]
add rdx, rax
mov qword [rsp + 0x80], rdi
movzx eax, word [rsi + 6]
mov r9, rcx
test eax, eax
je 0x180012276
mov r8d, eax
mov ecx, dword [rdx + 4]
test ecx, ecx
jne 0x180012261
mov eax, dword [rdx]
add rax, r9
jmp 0x180012265
mov eax, dword [rdx]
add eax, ecx
cmp rax, rbx
cmova rbx, rax
add rdx, 0x28
sub r8, 1
jne 0x180012253
lea rcx, [rsp + 0x20]
call qword [sym.imp.KERNEL32.dll_GetNativeSystemInfo]
mov edx, dword [rsp + 0x24]
lea r8d, [rdx - 1]
lea edi, [rdx - 1]
not r8d
add edi, dword [rsi + 0x50]
lea rcx, [rdx - 1]
add rcx, rbx
and rdi, r8
and rcx, r8
cmp rdi, rcx
je 0x1800122b6
mov ecx, 0xc1
call qword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x18001239a
mov rcx, qword [rsi + 0x30]
mov r9d, 4
mov r8d, 0x3000
mov qword [rsp + 0x70], rbp
mov rdx, rdi
call qword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov rbp, rax
test rax, rax
jne 0x1800122f9
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 0x18001232a
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov edx, 8
mov rcx, rax
lea r8d, [rdx + 0x50]
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov rdi, rax
test rax, rax
jne 0x180012337
xor edx, edx
mov r8d, 0x8000
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_VirtualFree]
mov ecx, reloc.WLDAP32.dll_Ordinal_14
call qword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x180012393
mov qword [rax + 8], rbp
movzx eax, word [rsi + 0x16]
shr eax, 0xd
and eax, 1
mov qword [rdi + 0x40], 0
mov dword [rdi + 0x20], eax
lea rax, [0x180012150]
mov qword [rdi + 0x28], rax
lea rax, [0x180012160]
mov qword [rdi + 0x30], rax
lea rax, [0x180012170]
mov qword [rdi + 0x38], rax
mov eax, dword [rsp + 0x24]
mov dword [rdi + 0x50], eax
mov edx, dword [rsi + 0x54]
cmp r15, rdx
jae 0x1800123b1
mov ecx, reloc.WS2_32.dll_listen
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rcx, rdi
call fcn.180012600
xor eax, eax
mov rbp, qword [rsp + 0x70]
mov rdi, qword [rsp + 0x80]
mov rsi, qword [rsp + 0x78]
add rsp, 0x50
pop r15
pop r14
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, r14
mov rcx, rax
mov rbx, rax
call fcn.18007f700
movsxd rax, dword [r14 + 0x3c]
mov r9, rdi
add rax, rbx
mov r8, rsi
mov qword [rdi], rax
mov rdx, r15
mov rcx, r14
mov qword [rax + 0x30], rbp
call fcn.180011b90
test eax, eax
je 0x18001238b
mov rax, qword [rdi]
mov rdx, qword [rax + 0x30]
sub rdx, qword [rsi + 0x30]
je 0x180012415
mov rcx, rdi
call fcn.180011f10
mov dword [rdi + 0x24], eax
jmp 0x18001241c
mov dword [rdi + 0x24], 1
mov rcx, rdi
call fcn.180011fd0
test eax, eax
je 0x18001238b
mov rcx, rdi
call fcn.180011cb0
test eax, eax
je 0x18001238b
mov rax, qword [rdi]
mov rsi, qword [rdi + 8]
mov ecx, dword [rax + 0xd0]
test ecx, ecx
je 0x180012479
mov rbx, qword [rcx + rsi + 0x18]
test rbx, rbx
je 0x180012479
mov rax, qword [rbx]
test rax, rax
je 0x180012479
nop
xor r8d, r8d
mov rcx, rsi
lea edx, [r8 + 1]
call rax
mov rax, qword [rbx + 8]
lea rbx, [rbx + 8]
test rax, rax
jne 0x180012460
mov rax, qword [rdi]
mov ecx, dword [rax + 0x28]
test ecx, ecx
je 0x1800124c2
cmp dword [rdi + 0x20], 0
lea rax, [rcx + rbp]
je 0x1800124b6
xor r8d, r8d
mov rcx, rbp
lea edx, [r8 + 1]
call rax
test eax, eax
jne 0x1800124a7
mov ecx, 0x45a
jmp 0x180012385
mov dword [rdi + 0x1c], 1
mov rax, rdi
jmp 0x180012395
mov qword [rdi + 0x48], rax
mov rax, rdi
jmp 0x180012395
mov qword [rdi + 0x48], 0
mov rax, rdi
jmp 0x180012395