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

Disassembly:
sub esp, 0x2c
push ebx
push ebp
push esi
mov ebx, edx
mov dword [esp + 0xc], ecx
xor esi, esi
mov dword [esp + 0x10], ebx
push edi
cmp ebx, 0x40
jb 0x4016f3
mov eax, 0x5a4d
cmp word [ecx], ax
jne 0x401902
mov edx, dword [ecx + 0x3c]
lea eax, [edx + 0xf8]
cmp ebx, eax
jae 0x4016fa
push 0xd
jmp 0x401907
lea ebx, [edx + ecx]
cmp dword [ebx], 0x4550
jne 0x401902
mov eax, 0x14c
cmp word [ebx + 4], ax
jne 0x401902
test byte [ebx + 0x38], 1
jne 0x401902
movzx eax, word [ebx + 0x14]
movzx edx, word [ebx + 6]
add eax, 0x24
test edx, edx
je 0x401750
lea ecx, [eax + ebx]
cmp dword [ecx + 4], 0
mov eax, dword [ebx + 0x38]
cmovne eax, dword [ecx + 4]
add eax, dword [ecx]
lea ecx, [ecx + 0x28]
cmp eax, esi
cmovbe eax, esi
mov esi, eax
sub edx, 1
jne 0x401734
lea eax, [esp + 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_GetNativeSystemInfo]
mov ecx, dword [esp + 0x1c]
lea edx, [ecx - 1]
lea edi, [ecx - 1]
not edx
add edi, dword [ebx + 0x50]
lea eax, [ecx - 1]
add eax, esi
and edi, edx
and eax, edx
cmp edi, eax
jne 0x401902
mov esi, dword [sym.imp.KERNEL32.dll_VirtualAlloc]
push 4
push 0x3000
push edi
push dword [ebx + 0x34]
call esi
mov ebp, eax
test ebp, ebp
jne 0x4017ac
push 4
push 0x3000
push edi
push eax
call esi
mov ebp, eax
test ebp, ebp
jne 0x4017ac
push 0xe
jmp 0x401907
push 0x40
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, eax
test edi, edi
jne 0x4017d2
push 0x8000
push eax
push ebp
call dword [sym.imp.KERNEL32.dll_VirtualFree]
jmp 0x4017a5
mov dword [edi + 4], ebp
movzx eax, word [ebx + 0x16]
and dword [edi + 0x34], 0
shr eax, 0xd
and eax, 1
mov dword [edi + 0x1c], 0x401667
mov dword [edi + 0x14], eax
mov dword [edi + 0x20], 0x401680
mov dword [edi + 0x24], 0x401695
mov dword [edi + 0x28], 0x4016a2
mov dword [edi + 0x2c], 0x4016b3
mov eax, dword [esp + 0x1c]
mov dword [edi + 0x3c], eax
mov eax, dword [ebx + 0x54]
cmp dword [esp + 0x14], eax
jae 0x40182d
push 0xd
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov ecx, edi
call fcn.00401a71
jmp 0x40190d
push 4
push 0x1000
push eax
push ebp
call esi
push dword [ebx + 0x54]
mov esi, eax
push dword [esp + 0x14]
push esi
call fcn.00433870
mov eax, dword [esp + 0x1c]
add esp, 0xc
mov edx, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
mov eax, dword [eax + 0x3c]
add eax, esi
mov dword [edi], eax
push edi
mov dword [eax + 0x34], ebp
call fcn.00401390
test eax, eax
jne 0x401821
mov eax, dword [edi]
mov edx, dword [eax + 0x34]
sub edx, dword [ebx + 0x34]
je 0x40187d
mov ecx, edi
call fcn.004014a8
jmp 0x401880
xor eax, eax
inc eax
mov ecx, edi
mov dword [edi + 0x18], eax
call fcn.0040153d
test eax, eax
je 0x401821
mov ecx, edi
call fcn.0040140d
test eax, eax
jne 0x401821
mov ecx, dword [edi]
mov eax, ecx
mov esi, dword [ecx + 0xc0]
test esi, esi
je 0x4018ca
mov ebx, dword [edi + 4]
mov esi, dword [esi + ebx + 0xc]
test esi, esi
je 0x4018ca
mov edx, dword [esi]
test edx, edx
je 0x4018ca
push 0
push 1
push ebx
call edx
lea esi, [esi + 4]
mov edx, dword [esi]
test edx, edx
jne 0x4018b8
mov eax, dword [edi]
mov eax, dword [eax + 0x28]
test eax, eax
je 0x4018fa
add eax, ebp
cmp dword [edi + 0x14], 0
je 0x4018f5
push 0
xor ebx, ebx
inc ebx
push ebx
push ebp
call eax
test eax, eax
jne 0x4018f0
push 0x45a
jmp 0x40181b
mov dword [edi + 0x10], ebx
jmp 0x4018fe
mov dword [edi + 0x38], eax
jmp 0x4018fe
and dword [edi + 0x38], 0
mov eax, edi
jmp 0x40190f
push 0xc1
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2c
ret 0x18