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

Disassembly:
push ebp
mov ebp, esp
mov eax, dword [ebp + 0xc]
sub esp, 0x28
push edi
xor edi, edi
cmp eax, 0x40
jae 0x10018afe
push 0xd
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x10018d52
push esi
mov esi, dword [ebp + 8]
mov ecx, 0x5a4d
cmp word [esi], cx
je 0x10018b19
push 0xc1
call dword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x10018b2d
mov ecx, dword [esi + 0x3c]
add ecx, 0xf8
push ecx
call fcn.10018605
pop ecx
test eax, eax
jne 0x10018b34
xor eax, eax
jmp 0x10018d51
push ebx
mov ebx, dword [esi + 0x3c]
add ebx, esi
cmp dword [ebx], 0x4550
jne 0x10018bad
mov eax, 0x14c
cmp word [ebx + 4], ax
jne 0x10018bad
mov edx, dword [ebx + 0x38]
test dl, 1
jne 0x10018bad
movzx ecx, word [ebx + 6]
movzx eax, word [ebx + 0x14]
lea eax, [eax + ebx + 0x18]
test ecx, ecx
je 0x10018b88
lea esi, [eax + 0xc]
mov dword [ebp - 4], ecx
mov ecx, dword [esi + 4]
mov eax, dword [esi]
test ecx, ecx
jne 0x10018b78
add eax, edx
jmp 0x10018b7a
add eax, ecx
cmp eax, edi
jbe 0x10018b80
mov edi, eax
add esi, 0x28
dec dword [ebp - 4]
jne 0x10018b6b
lea eax, [ebp - 0x28]
push eax
call dword [sym.imp.KERNEL32.dll_GetNativeSystemInfo]
mov eax, dword [ebp - 0x24]
mov edx, dword [ebx + 0x50]
lea ecx, [eax - 1]
lea esi, [edx + eax - 1]
not ecx
lea eax, [eax + edi - 1]
and esi, ecx
and eax, ecx
cmp esi, eax
je 0x10018bb4
push 0xc1
jmp 0x10018c09
mov eax, dword [ebx + 0x34]
mov edi, dword [sym.imp.KERNEL32.dll_VirtualAlloc]
push 4
push 0x3000
push esi
push eax
call edi
mov dword [ebp - 4], eax
test eax, eax
jne 0x10018be1
push 4
push 0x3000
push esi
push eax
call edi
mov dword [ebp - 4], eax
test eax, eax
je 0x10018c07
push 0x40
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov esi, eax
test esi, esi
jne 0x10018c14
push 0x8000
push eax
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_VirtualFree]
push 0xe
call dword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x10018d3a
mov eax, dword [ebp - 4]
mov dword [esi + 4], eax
movzx eax, word [ebx + 0x16]
and dword [esi + 0x34], 0
shr eax, 0xd
and eax, 1
mov dword [esi + 0x14], eax
mov dword [esi + 0x1c], 0x10018a86
mov dword [esi + 0x20], 0x10018a9d
mov dword [esi + 0x24], 0x10018ab1
mov dword [esi + 0x28], 0x10018abf
mov dword [esi + 0x2c], 0x10018ad0
mov eax, dword [ebp - 0x24]
mov dword [esi + 0x3c], eax
push dword [ebx + 0x54]
mov eax, dword [ebp + 0xc]
call fcn.10018605
pop ecx
test eax, eax
je 0x10018d35
mov eax, dword [ebx + 0x54]
push 4
push 0x1000
push eax
push dword [ebp - 4]
call edi
push dword [ebx + 0x54]
mov edi, eax
push dword [ebp + 8]
push edi
call fcn.1001ff30
mov ecx, dword [ebp + 8]
mov eax, dword [ecx + 0x3c]
mov edx, dword [ebp - 4]
push ebx
push dword [ebp + 0xc]
add eax, edi
mov dword [esi], eax
push ecx
mov edi, esi
mov dword [eax + 0x34], edx
call fcn.1001861e
add esp, 0x18
test eax, eax
je 0x10018d35
mov eax, dword [esi]
mov eax, dword [eax + 0x34]
sub eax, dword [ebx + 0x34]
je 0x10018cc5
push eax
mov eax, esi
call fcn.100188b0
pop ecx
mov dword [esi + 0x18], eax
jmp 0x10018ccc
mov dword [esi + 0x18], 1
call fcn.10018938
test eax, eax
je 0x10018d35
push esi
call fcn.100187af
pop ecx
test eax, eax
je 0x10018d35
mov eax, dword [esi]
mov eax, dword [eax + 0xc0]
mov ebx, dword [esi + 4]
test eax, eax
je 0x10018d09
mov edi, dword [eax + ebx + 0xc]
test edi, edi
je 0x10018d09
jmp 0x10018d03
push 0
push 1
push ebx
call eax
add edi, 4
mov eax, dword [edi]
test eax, eax
jne 0x10018cf9
mov eax, dword [esi]
mov eax, dword [eax + 0x28]
xor edx, edx
cmp eax, edx
je 0x10018d4b
cmp dword [esi + 0x14], edx
je 0x10018d43
mov ecx, dword [ebp - 4]
push edx
xor edi, edi
inc edi
push edi
add eax, ecx
push ecx
call eax
test eax, eax
jne 0x10018d3e
push 0x45a
call dword [sym.imp.KERNEL32.dll_SetLastError]
call fcn.10018e96
xor eax, eax
jmp 0x10018d50
mov dword [esi + 0x10], edi
jmp 0x10018d4e
add eax, dword [ebp - 4]
mov dword [esi + 0x38], eax
jmp 0x10018d4e
mov dword [esi + 0x38], edx
mov eax, esi
pop ebx
pop esi
pop edi
leave
ret