Function at 0x507d20
Capabilities:
Enumerate pe sections
Get system information on windows
Parse pe header

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x5c
mov dword [ebp - 0x44], 0
mov dword [ebp - 0x10], 0
push 0x40
mov eax, dword [ebp + 0xc]
push eax
call fcn.00508170
add esp, 8
test eax, eax
jne 0x507d4d
xor eax, eax
jmp 0x508142
mov ecx, dword [ebp + 8]
mov dword [ebp - 0xc], ecx
mov edx, dword [ebp - 0xc]
movzx eax, word [edx]
cmp eax, 0x5a4d
je 0x507d72
push 0xc1
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x508142
mov ecx, dword [ebp - 0xc]
mov edx, dword [ecx + 0x3c]
add edx, 0xf8
push edx
mov eax, dword [ebp + 0xc]
push eax
call fcn.00508170
add esp, 8
test eax, eax
jne 0x507d96
xor eax, eax
jmp 0x508142
mov ecx, dword [ebp - 0xc]
mov edx, dword [ebp + 8]
add edx, dword [ecx + 0x3c]
mov dword [ebp - 0x4c], edx
mov eax, dword [ebp - 0x4c]
cmp dword [eax], 0x4550
je 0x507dbf
push 0xc1
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x508142
mov ecx, dword [ebp - 0x4c]
movzx edx, word [ecx + 4]
cmp edx, 0x14c
je 0x507de0
push 0xc1
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x508142
mov eax, dword [ebp - 0x4c]
mov ecx, dword [eax + 0x38]
and ecx, 1
je 0x507dfd
push 0xc1
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x508142
mov edx, dword [ebp - 0x4c]
movzx eax, word [edx + 0x14]
mov ecx, dword [ebp - 0x4c]
lea edx, [ecx + eax + 0x18]
mov dword [ebp - 0x50], edx
mov eax, dword [ebp - 0x4c]
mov ecx, dword [eax + 0x38]
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 8], 0
jmp 0x507e32
mov edx, dword [ebp - 8]
add edx, 1
mov dword [ebp - 8], edx
mov eax, dword [ebp - 0x50]
add eax, 0x28
mov dword [ebp - 0x50], eax
mov ecx, dword [ebp - 0x4c]
movzx edx, word [ecx + 6]
cmp dword [ebp - 8], edx
jae 0x507e74
mov eax, dword [ebp - 0x50]
cmp dword [eax + 0x10], 0
jne 0x507e55
mov ecx, dword [ebp - 0x50]
mov edx, dword [ecx + 0xc]
add edx, dword [ebp - 0x1c]
mov dword [ebp - 0x54], edx
jmp 0x507e64
mov eax, dword [ebp - 0x50]
mov ecx, dword [eax + 0xc]
mov edx, dword [ebp - 0x50]
add ecx, dword [edx + 0x10]
mov dword [ebp - 0x54], ecx
mov eax, dword [ebp - 0x54]
cmp eax, dword [ebp - 0x10]
jbe 0x507e72
mov ecx, dword [ebp - 0x54]
mov dword [ebp - 0x10], ecx
jmp 0x507e20
lea edx, [ebp - 0x40]
push edx
call dword [sym.imp.KERNEL32.dll_GetNativeSystemInfo]
mov eax, dword [ebp - 0x3c]
push eax
mov ecx, dword [ebp - 0x4c]
mov edx, dword [ecx + 0x50]
push edx
call fcn.00508150
add esp, 8
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x3c]
push eax
mov ecx, dword [ebp - 0x10]
push ecx
call fcn.00508150
add esp, 8
cmp dword [ebp - 0x18], eax
je 0x507ebb
push 0xc1
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x508142
mov edx, dword [ebp + 0x24]
push edx
push 4
push 0x3000
mov eax, dword [ebp - 0x18]
push eax
mov ecx, dword [ebp - 0x4c]
mov edx, dword [ecx + 0x34]
push edx
call dword [ebp + 0x10]
add esp, 0x14
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jne 0x507f0f
mov eax, dword [ebp + 0x24]
push eax
push 4
push 0x3000
mov ecx, dword [ebp - 0x18]
push ecx
push 0
call dword [ebp + 0x10]
add esp, 0x14
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jne 0x507f0f
push 0xe
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x508142
push 0x3c
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp - 0x44], eax
cmp dword [ebp - 0x44], 0
jne 0x507f4d
mov edx, dword [ebp + 0x24]
push edx
push 0x8000
push 0
mov eax, dword [ebp - 0x14]
push eax
call dword [ebp + 0x14]
add esp, 0x10
push 0xe
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x508142
mov ecx, dword [ebp - 0x44]
mov edx, dword [ebp - 0x14]
mov dword [ecx + 4], edx
mov eax, dword [ebp - 0x4c]
movzx ecx, word [eax + 0x16]
and ecx, 0x2000
neg ecx
sbb ecx, ecx
neg ecx
mov edx, dword [ebp - 0x44]
mov dword [edx + 0x14], ecx
mov eax, dword [ebp - 0x44]
mov ecx, dword [ebp + 0x10]
mov dword [eax + 0x1c], ecx
mov edx, dword [ebp - 0x44]
mov eax, dword [ebp + 0x14]
mov dword [edx + 0x20], eax
mov ecx, dword [ebp - 0x44]
mov edx, dword [ebp + 0x18]
mov dword [ecx + 0x24], edx
mov eax, dword [ebp - 0x44]
mov ecx, dword [ebp + 0x1c]
mov dword [eax + 0x28], ecx
mov edx, dword [ebp - 0x44]
mov eax, dword [ebp + 0x20]
mov dword [edx + 0x2c], eax
mov ecx, dword [ebp - 0x44]
mov edx, dword [ebp + 0x24]
mov dword [ecx + 0x30], edx
mov eax, dword [ebp - 0x44]
mov ecx, dword [ebp - 0x3c]
mov dword [eax + 0x38], ecx
mov edx, dword [ebp - 0x4c]
mov eax, dword [edx + 0x54]
push eax
mov ecx, dword [ebp + 0xc]
push ecx
call fcn.00508170
add esp, 8
test eax, eax
jne 0x507fcf
jmp 0x508134
mov edx, dword [ebp + 0x24]
push edx
push 4
push 0x1000
mov eax, dword [ebp - 0x4c]
mov ecx, dword [eax + 0x54]
push ecx
mov edx, dword [ebp - 0x14]
push edx
call dword [ebp + 0x10]
add esp, 0x14
mov dword [ebp - 4], eax
mov eax, dword [ebp - 0x4c]
mov ecx, dword [eax + 0x54]
push ecx
mov edx, dword [ebp - 0xc]
push edx
mov eax, dword [ebp - 4]
push eax
call fcn.005b5620
add esp, 0xc
mov ecx, dword [ebp - 0xc]
mov edx, dword [ebp - 4]
add edx, dword [ecx + 0x3c]
mov eax, dword [ebp - 0x44]
mov dword [eax], edx
mov ecx, dword [ebp - 0x44]
mov edx, dword [ecx]
mov eax, dword [ebp - 0x14]
mov dword [edx + 0x34], eax
mov ecx, dword [ebp - 0x44]
push ecx
mov edx, dword [ebp - 0x4c]
push edx
mov eax, dword [ebp + 0xc]
push eax
mov ecx, dword [ebp + 8]
push ecx
call fcn.00508190
add esp, 0x10
test eax, eax
jne 0x508044
jmp 0x508134
mov edx, dword [ebp - 0x44]
mov eax, dword [edx]
mov ecx, dword [ebp - 0x4c]
mov edx, dword [eax + 0x34]
sub edx, dword [ecx + 0x34]
mov dword [ebp - 0x48], edx
je 0x50806f
mov eax, dword [ebp - 0x48]
push eax
mov ecx, dword [ebp - 0x44]
push ecx
call fcn.005086d0
add esp, 8
mov edx, dword [ebp - 0x44]
mov dword [edx + 0x18], eax
jmp 0x508079
mov eax, dword [ebp - 0x44]
mov dword [eax + 0x18], 1
mov ecx, dword [ebp - 0x44]
push ecx
call fcn.005087e0
add esp, 4
test eax, eax
jne 0x508093
jmp 0x508134
mov edx, dword [ebp - 0x44]
push edx
call fcn.00508300
add esp, 4
test eax, eax
jne 0x5080ad
jmp 0x508134
mov eax, dword [ebp - 0x44]
push eax
call fcn.00508660
add esp, 4
test eax, eax
jne 0x5080c1
jmp 0x508134
mov ecx, dword [ebp - 0x44]
mov edx, dword [ecx]
cmp dword [edx + 0x28], 0
je 0x508125
mov eax, dword [ebp - 0x44]
cmp dword [eax + 0x14], 0
je 0x508112
mov ecx, dword [ebp - 0x44]
mov edx, dword [ecx]
mov eax, dword [ebp - 0x14]
add eax, dword [edx + 0x28]
mov dword [ebp - 0x5c], eax
push 0
push 1
mov ecx, dword [ebp - 0x14]
push ecx
call dword [ebp - 0x5c]
mov dword [ebp - 0x58], eax
cmp dword [ebp - 0x58], 0
jne 0x508106
push 0x45a
call dword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x508134
mov edx, dword [ebp - 0x44]
mov dword [edx + 0x10], 1
jmp 0x508123
mov eax, dword [ebp - 0x44]
mov ecx, dword [eax]
mov edx, dword [ebp - 0x14]
add edx, dword [ecx + 0x28]
mov eax, dword [ebp - 0x44]
mov dword [eax + 0x34], edx
jmp 0x50812f
mov ecx, dword [ebp - 0x44]
mov dword [ecx + 0x34], 0
mov eax, dword [ebp - 0x44]
jmp 0x508142
mov edx, dword [ebp - 0x44]
push edx
call fcn.00508b70
add esp, 4
xor eax, eax
mov esp, ebp
pop ebp
ret