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

Disassembly:
mov eax, dword [esp + 4]
sub esp, 0x24
push ebp
mov ecx, 0x5a4d
xor ebp, ebp
cmp word [eax], cx
je 0x401886
push 0xc1
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
pop ebp
add esp, 0x24
ret
push ebx
mov ebx, dword [eax + 0x3c]
add ebx, eax
cmp dword [ebx], 0x4550
jne 0x4018a7
mov edx, 0x14c
cmp word [ebx + 4], dx
jne 0x4018a7
mov edx, dword [ebx + 0x38]
test dl, 1
je 0x4018ba
push 0xc1
call dword [sym.imp.KERNEL32.dll_SetLastError]
pop ebx
xor eax, eax
pop ebp
add esp, 0x24
ret
movzx eax, word [ebx + 0x14]
lea ecx, [eax + ebx + 0x18]
movzx eax, word [ebx + 6]
push esi
push edi
test eax, eax
jbe 0x4018ee
lea esi, [ecx + 0xc]
mov edi, eax
mov ecx, dword [esi + 4]
mov eax, dword [esi]
test ecx, ecx
jne 0x4018de
add eax, edx
jmp 0x4018e0
add eax, ecx
cmp eax, ebp
jbe 0x4018e6
mov ebp, eax
add esi, 0x28
sub edi, 1
jne 0x4018d1
lea ecx, [esp + 0x10]
push ecx
call dword [sym.imp.KERNEL32.dll_GetNativeSystemInfo]
mov ecx, dword [esp + 0x14]
mov edx, dword [ebx + 0x50]
lea eax, [ecx - 1]
lea esi, [edx + ecx - 1]
not eax
lea ecx, [ecx + ebp - 1]
and esi, eax
and ecx, eax
cmp esi, ecx
je 0x40192a
push 0xc1
call dword [sym.imp.KERNEL32.dll_SetLastError]
pop edi
pop esi
pop ebx
xor eax, eax
pop ebp
add esp, 0x24
ret
mov edi, dword [esp + 0x50]
mov edx, dword [ebx + 0x34]
push edi
push 4
push 0x3000
push esi
push edx
call dword [esp + 0x50]
mov ebp, eax
add esp, 0x14
test ebp, ebp
jne 0x40195f
push edi
push 4
push 0x3000
push esi
push eax
call dword [esp + 0x50]
mov ebp, eax
add esp, 0x14
test ebp, ebp
je 0x401985
push 0x40
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov esi, eax
push edi
test esi, esi
jne 0x401997
push 0x8000
push eax
push ebp
call dword [esp + 0x50]
add esp, 0x10
push 0xe
call dword [sym.imp.KERNEL32.dll_SetLastError]
pop edi
pop esi
pop ebx
xor eax, eax
pop ebp
add esp, 0x24
ret
mov ecx, dword [esp + 0x44]
mov edx, dword [esp + 0x48]
mov dword [esi + 4], ebp
movzx eax, word [ebx + 0x16]
shr eax, 0xd
and eax, 1
mov dword [esi + 0x14], eax
mov eax, dword [esp + 0x40]
mov dword [esi + 0x20], ecx
mov ecx, dword [esp + 0x4c]
mov dword [esi + 0x24], edx
mov edx, dword [esp + 0x50]
mov dword [esi + 0x1c], eax
mov dword [esi + 0x28], ecx
mov dword [esi + 0x2c], edx
mov dword [esi + 0x34], edi
mov ecx, dword [esp + 0x18]
push 4
mov dword [esi + 0x3c], ecx
mov edx, dword [ebx + 0x54]
push 0x1000
push edx
push ebp
call eax
mov ecx, dword [esp + 0x4c]
mov edi, eax
mov eax, dword [ebx + 0x54]
push eax
push ecx
push edi
call fcn.00401b00
mov eax, dword [esp + 0x58]
mov edx, dword [eax + 0x3c]
add edi, edx
mov dword [esi], edi
mov dword [edi + 0x34], ebp
push ebx
push eax
mov edi, esi
call fcn.00401090
add esp, 0x28
test eax, eax
je 0x401a7a
mov eax, dword [esi]
mov eax, dword [eax + 0x34]
sub eax, dword [ebx + 0x34]
je 0x401a2b
push eax
mov eax, esi
call fcn.004013b0
add esp, 4
mov dword [esi + 0x18], eax
jmp 0x401a32
mov dword [esi + 0x18], 1
call fcn.00401440
test eax, eax
je 0x401a7a
push esi
call fcn.00401230
add esp, 4
test eax, eax
je 0x401a7a
mov eax, esi
call fcn.00401370
test eax, eax
je 0x401a7a
mov ecx, dword [esi]
mov eax, dword [ecx + 0x28]
test eax, eax
je 0x401aab
add eax, ebp
cmp dword [esi + 0x14], 0
je 0x401a9e
push 0
push 1
push ebp
call eax
test eax, eax
jne 0x401a8d
push 0x45a
call dword [sym.imp.KERNEL32.dll_SetLastError]
push esi
call fcn.004017c0
add esp, 4
pop edi
pop esi
pop ebx
xor eax, eax
pop ebp
add esp, 0x24
ret
pop edi
mov dword [esi + 0x10], 1
mov eax, esi
pop esi
pop ebx
pop ebp
add esp, 0x24
ret
pop edi
mov dword [esi + 0x38], eax
mov eax, esi
pop esi
pop ebx
pop ebp
add esp, 0x24
ret
pop edi
mov dword [esi + 0x38], 0
mov eax, esi
pop esi
pop ebx
pop ebp
add esp, 0x24
ret