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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x40
mov eax, dword [0x450008]
xor eax, ebp
mov dword [ebp - 4], eax
mov edx, dword [ebp + 8]
push ebx
mov ebx, dword [ebp + 0xc]
push esi
xor esi, esi
mov dword [ebp - 0x2c], ecx
mov dword [ebp - 0x40], edx
push edi
cmp ebx, 0x40
jb 0x405e91
mov eax, 0x5a4d
cmp word [edx], ax
jne 0x40629b
mov ecx, dword [edx + 0x3c]
lea eax, [ecx + 0xf8]
cmp ebx, eax
jae 0x405e98
push 0xd
jmp 0x4062a0
cmp dword [edx + ecx], 0x4550
lea ebx, [edx + ecx]
jne 0x40629b
mov eax, 0x14c
cmp word [ebx + 4], ax
jne 0x40629b
mov ecx, dword [ebx + 0x38]
test cl, 1
jne 0x40629b
movzx edx, word [ebx + 0x14]
movzx edi, word [ebx + 6]
add edx, 0x24
test edi, edi
je 0x405ef1
add edx, ebx
mov eax, dword [edx + 4]
lea edx, [edx + 0x28]
test eax, eax
cmovne ecx, eax
add ecx, dword [edx - 0x28]
cmp ecx, esi
cmovbe ecx, esi
mov esi, ecx
mov ecx, dword [ebx + 0x38]
sub edi, 1
jne 0x405ed4
lea eax, [ebp - 0x28]
push eax
call dword [sym.imp.KERNEL32.dll_GetNativeSystemInfo]
mov ecx, dword [ebp - 0x24]
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 0x40629b
mov esi, dword [sym.imp.KERNEL32.dll_VirtualAlloc]
push 4
push 0x3000
push edi
push dword [ebx + 0x34]
call esi
mov dword [ebp - 0x30], eax
test eax, eax
jne 0x405f46
push 4
push 0x3000
push edi
push eax
call esi
mov dword [ebp - 0x30], eax
test eax, eax
je 0x405f70
push 0x40
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, dword [ebp - 0x2c]
mov ecx, dword [ebp - 0x30]
mov dword [edi], eax
test eax, eax
jne 0x405f77
push 0x8000
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_VirtualFree]
push 0xe
jmp 0x4062a0
mov dword [eax + 4], ecx
movzx ecx, word [ebx + 0x16]
mov eax, dword [edi]
shr ecx, 0xd
and ecx, 1
mov dword [eax + 0x14], ecx
mov eax, dword [edi]
mov dword [eax + 0x1c], 0x405dd0
mov eax, dword [edi]
mov dword [eax + 0x20], 0x405df0
mov eax, dword [edi]
mov dword [eax + 0x24], 0x405e10
mov eax, dword [edi]
mov dword [eax + 0x28], 0x405e20
mov eax, dword [edi]
mov dword [eax + 0x2c], 0x405e40
mov eax, dword [edi]
mov dword [eax + 0x34], 0
mov ecx, dword [edi]
mov eax, dword [ebp - 0x24]
mov dword [ecx + 0x3c], eax
push dword [ebx + 0x54]
push dword [ebp + 0xc]
call fcn.004059e0
test eax, eax
je 0x406125
push 4
push 0x1000
push dword [ebx + 0x54]
push dword [ebp - 0x30]
call esi
push dword [ebx + 0x54]
mov esi, eax
push dword [ebp - 0x40]
push esi
call fcn.00419220
mov eax, dword [ebp - 0x40]
add esp, 0xc
mov dword [ebp - 0x3c], 0
mov ecx, dword [eax + 0x3c]
mov eax, dword [edi]
add ecx, esi
mov dword [eax], ecx
mov eax, dword [edi]
mov ecx, dword [ebp - 0x30]
mov eax, dword [eax]
mov dword [eax + 0x34], ecx
mov ecx, dword [edi]
mov eax, dword [ecx]
mov esi, dword [ecx + 4]
mov dword [ebp - 0x34], esi
xor esi, esi
movzx edx, word [eax + 0x14]
add edx, eax
cmp si, word [eax + 6]
mov esi, dword [ebp - 0x34]
jae 0x4060f3
mov eax, ecx
lea edi, [edx + 0x24]
mov dword [ebp - 0x38], eax
nop
mov edx, dword [edi + 4]
test edx, edx
jne 0x406085
mov esi, dword [ebx + 0x38]
test esi, esi
jle 0x4060ca
push dword [eax + 0x34]
mov eax, dword [edi]
add eax, dword [ebp - 0x34]
push 4
push 0x1000
push esi
push eax
mov eax, dword [ebp - 0x38]
mov eax, dword [eax + 0x1c]
call eax
add esp, 0x14
test eax, eax
je 0x406122
mov eax, dword [edi]
add eax, dword [ebp - 0x34]
push esi
push 0
push eax
mov dword [edi - 4], eax
call fcn.00419080
jmp 0x4060c7
mov eax, dword [edi + 8]
add eax, edx
cmp dword [ebp + 0xc], eax
jb 0x40611a
push dword [ecx + 0x34]
mov eax, dword [edi]
push 4
push 0x1000
add eax, esi
push edx
push eax
mov eax, dword [ecx + 0x1c]
call eax
add esp, 0x14
test eax, eax
je 0x406122
push dword [edi + 4]
mov eax, dword [edi + 8]
mov esi, dword [edi]
add eax, dword [ebp - 0x40]
add esi, dword [ebp - 0x34]
push eax
push esi
call fcn.00419220
mov dword [edi - 4], esi
add esp, 0xc
mov eax, dword [ebp - 0x2c]
add edi, 0x28
mov edx, dword [ebp - 0x3c]
inc edx
mov dword [ebp - 0x3c], edx
mov ecx, dword [eax]
mov dword [ebp - 0x38], ecx
mov eax, dword [ecx]
movzx eax, word [eax + 6]
cmp edx, eax
jge 0x4060f0
mov esi, dword [ebp - 0x34]
mov eax, ecx
jmp 0x406040
mov edi, dword [ebp - 0x2c]
mov edx, dword [ecx]
mov eax, dword [edx + 0x34]
sub eax, dword [ebx + 0x34]
mov dword [ebp - 0x3c], eax
je 0x4061ac
cmp dword [edx + 0xa4], 0
jne 0x406131
mov edi, dword [ebp - 0x2c]
xor eax, eax
mov dword [ecx + 0x18], eax
jmp 0x4061b3
push 0xd
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov edi, dword [ebp - 0x2c]
mov ecx, edi
call fcn.00406450
jmp 0x4062a6
mov ebx, dword [ecx + 4]
mov edi, dword [edx + 0xa0]
add edi, ebx
mov dword [ebp - 0x38], ebx
mov eax, dword [edi]
test eax, eax
je 0x40619f
mov ecx, dword [edi + 4]
lea edx, [edi + 8]
add ebx, eax
xor esi, esi
lea eax, [ecx - 8]
test eax, 0xfffffffe
jbe 0x40618e
nop dword [eax]
movzx eax, word [edx]
mov ecx, eax
and ecx, 0xf000
cmp ecx, 0x3000
jne 0x40617e
mov ecx, dword [ebp - 0x3c]
and eax, 0xfff
add dword [eax + ebx], ecx
mov ecx, dword [edi + 4]
inc esi
add edx, 2
lea eax, [ecx - 8]
shr eax, 1
cmp esi, eax
jb 0x406160
mov eax, dword [edi + ecx]
add edi, ecx
mov ebx, dword [ebp - 0x38]
test eax, eax
jne 0x406145
mov eax, dword [ebp - 0x2c]
mov ecx, dword [eax]
mov edi, dword [ebp - 0x2c]
mov eax, 1
mov dword [ecx + 0x18], eax
jmp 0x4061b3
mov dword [ecx + 0x18], 1
mov ecx, edi
call fcn.00405c40
test eax, eax
je 0x406125
mov ecx, edi
call fcn.00405ae0
test eax, eax
je 0x406125
mov edx, dword [edi]
mov ecx, edx
mov eax, dword [edx]
mov esi, dword [eax + 0xc0]
test esi, esi
je 0x40620d
mov edi, dword [edx + 4]
mov esi, dword [esi + edi + 0xc]
test esi, esi
je 0x40620a
mov eax, dword [esi]
test eax, eax
je 0x40620a
push 0
push 1
push edi
call eax
mov eax, dword [esi + 4]
lea esi, [esi + 4]
test eax, eax
jne 0x4061f2
mov edi, dword [ebp - 0x2c]
mov ecx, dword [edi]
jmp 0x40620d
mov edi, dword [ebp - 0x2c]
mov eax, dword [ecx]
mov eax, dword [eax + 0x28]
test eax, eax
je 0x40627c
mov edx, dword [ebp - 0x30]
add eax, edx
cmp dword [ecx + 0x14], 0
je 0x406261
push 0
push 1
push edx
call eax
test eax, eax
jne 0x406240
push 0x45a
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov ecx, edi
call fcn.00406450
jmp 0x4062a6
mov eax, dword [edi]
pop edi
pop esi
pop ebx
mov dword [eax + 0x10], 1
mov eax, 1
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00416291
mov esp, ebp
pop ebp
ret 0x20
pop edi
pop esi
mov dword [ecx + 0x38], eax
mov eax, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00416291
mov esp, ebp
pop ebp
ret 0x20
pop edi
pop esi
mov dword [ecx + 0x38], 0
mov eax, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00416291
mov esp, ebp
pop ebp
ret 0x20
push 0xc1
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov ecx, dword [ebp - 4]
xor eax, eax
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00416291
mov esp, ebp
pop ebp
ret 0x20