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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x40
mov eax, dword [0x41e008]
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 0x4045b1
mov eax, 0x5a4d
cmp word [edx], ax
jne 0x4049bb
mov ecx, dword [edx + 0x3c]
lea eax, [ecx + 0xf8]
cmp ebx, eax
jae 0x4045b8
push 0xd
jmp 0x4049c0
cmp dword [edx + ecx], 0x4550
lea ebx, [edx + ecx]
jne 0x4049bb
mov eax, 0x14c
cmp word [ebx + 4], ax
jne 0x4049bb
mov ecx, dword [ebx + 0x38]
test cl, 1
jne 0x4049bb
movzx edx, word [ebx + 0x14]
movzx edi, word [ebx + 6]
add edx, 0x24
test edi, edi
je 0x404611
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 0x4045f4
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 0x4049bb
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 0x404666
push 4
push 0x3000
push edi
push eax
call esi
mov dword [ebp - 0x30], eax
test eax, eax
je 0x404690
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 0x404697
push 0x8000
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_VirtualFree]
push 0xe
jmp 0x4049c0
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], 0x4044f0
mov eax, dword [edi]
mov dword [eax + 0x20], 0x404510
mov eax, dword [edi]
mov dword [eax + 0x24], 0x404530
mov eax, dword [edi]
mov dword [eax + 0x28], 0x404540
mov eax, dword [edi]
mov dword [eax + 0x2c], 0x404560
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.00404100
test eax, eax
je 0x404845
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 sub.VCRUNTIME140.dll_memcpy
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 0x404813
mov eax, ecx
lea edi, [edx + 0x24]
mov dword [ebp - 0x38], eax
nop
mov edx, dword [edi + 4]
test edx, edx
jne 0x4047a5
mov esi, dword [ebx + 0x38]
test esi, esi
jle 0x4047ea
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 0x404842
mov eax, dword [edi]
add eax, dword [ebp - 0x34]
push esi
push 0
push eax
mov dword [edi - 4], eax
call sub.VCRUNTIME140.dll_memset
jmp 0x4047e7
mov eax, dword [edi + 8]
add eax, edx
cmp dword [ebp + 0xc], eax
jb 0x40483a
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 0x404842
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 sub.VCRUNTIME140.dll_memcpy
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 0x404810
mov esi, dword [ebp - 0x34]
mov eax, ecx
jmp 0x404760
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 0x4048cc
cmp dword [edx + 0xa4], 0
jne 0x404851
mov edi, dword [ebp - 0x2c]
xor eax, eax
mov dword [ecx + 0x18], eax
jmp 0x4048d3
push 0xd
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov edi, dword [ebp - 0x2c]
mov ecx, edi
call fcn.00404b70
jmp 0x4049c6
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 0x4048bf
mov ecx, dword [edi + 4]
lea edx, [edi + 8]
add ebx, eax
xor esi, esi
lea eax, [ecx - 8]
test eax, 0xfffffffe
jbe 0x4048ae
nop dword [eax]
movzx eax, word [edx]
mov ecx, eax
and ecx, 0xf000
cmp ecx, 0x3000
jne 0x40489e
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 0x404880
mov eax, dword [edi + ecx]
add edi, ecx
mov ebx, dword [ebp - 0x38]
test eax, eax
jne 0x404865
mov eax, dword [ebp - 0x2c]
mov ecx, dword [eax]
mov edi, dword [ebp - 0x2c]
mov eax, 1
mov dword [ecx + 0x18], eax
jmp 0x4048d3
mov dword [ecx + 0x18], 1
mov ecx, edi
call fcn.00404360
test eax, eax
je 0x404845
mov ecx, edi
call fcn.00404200
test eax, eax
je 0x404845
mov edx, dword [edi]
mov ecx, edx
mov eax, dword [edx]
mov esi, dword [eax + 0xc0]
test esi, esi
je 0x40492d
mov edi, dword [edx + 4]
mov esi, dword [esi + edi + 0xc]
test esi, esi
je 0x40492a
mov eax, dword [esi]
test eax, eax
je 0x40492a
push 0
push 1
push edi
call eax
mov eax, dword [esi + 4]
lea esi, [esi + 4]
test eax, eax
jne 0x404912
mov edi, dword [ebp - 0x2c]
mov ecx, dword [edi]
jmp 0x40492d
mov edi, dword [ebp - 0x2c]
mov eax, dword [ecx]
mov eax, dword [eax + 0x28]
test eax, eax
je 0x40499c
mov edx, dword [ebp - 0x30]
add eax, edx
cmp dword [ecx + 0x14], 0
je 0x404981
push 0
push 1
push edx
call eax
test eax, eax
jne 0x404960
push 0x45a
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov ecx, edi
call fcn.00404b70
jmp 0x4049c6
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.00413d41
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.00413d41
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.00413d41
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.00413d41
mov esp, ebp
pop ebp
ret 0x20