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

Disassembly:
mov ecx, dword [esp + 8]
sub esp, 0x24
push ebp
xor ebp, ebp
cmp ecx, 0x40
jae 0x1000511e
push 0xd
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
pop ebp
add esp, 0x24
ret
mov eax, dword [esp + 0x2c]
mov edx, 0x5a4d
cmp word [eax], dx
je 0x1000513e
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]
lea edx, [ebx + 0xf8]
cmp ecx, edx
jae 0x1000515c
push 0xd
call dword [sym.imp.KERNEL32.dll_SetLastError]
pop ebx
xor eax, eax
pop ebp
add esp, 0x24
ret
add ebx, eax
cmp dword [ebx], 0x4550
jne 0x10005179
mov eax, 0x14c
cmp word [ebx + 4], ax
jne 0x10005179
mov edx, dword [ebx + 0x38]
test dl, 1
je 0x1000518c
push 0xc1
call dword [sym.imp.KERNEL32.dll_SetLastError]
pop ebx
xor eax, eax
pop ebp
add esp, 0x24
ret
movzx eax, word [ebx + 6]
movzx ecx, word [ebx + 0x14]
push esi
push edi
lea ecx, [ecx + ebx + 0x18]
test eax, eax
jbe 0x100051c0
lea esi, [ecx + 0xc]
mov edi, eax
mov ecx, dword [esi + 4]
mov eax, dword [esi]
test ecx, ecx
jne 0x100051b0
add eax, edx
jmp 0x100051b2
add eax, ecx
cmp eax, ebp
jbe 0x100051b8
mov ebp, eax
add esi, 0x28
sub edi, 1
jne 0x100051a3
lea edx, [esp + 0x10]
push edx
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 0x100051fc
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 + 0x54]
mov edx, dword [ebx + 0x34]
push edi
push 4
push 0x3000
push esi
push edx
call dword [esp + 0x54]
mov ebp, eax
add esp, 0x14
test ebp, ebp
jne 0x10005231
push edi
push 4
push 0x3000
push esi
push eax
call dword [esp + 0x54]
mov ebp, eax
add esp, 0x14
test ebp, ebp
je 0x10005257
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 0x10005269
push edi
push 0x8000
push eax
push ebp
call dword [esp + 0x54]
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 + 0x40]
mov edx, dword [esp + 0x44]
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 + 0x48]
mov dword [esi + 0x1c], ecx
mov ecx, dword [esp + 0x4c]
mov dword [esi + 0x20], edx
mov edx, dword [esp + 0x50]
mov dword [esi + 0x24], eax
mov dword [esi + 0x28], ecx
mov dword [esi + 0x2c], edx
mov dword [esi + 0x34], edi
mov eax, dword [esp + 0x14]
mov dword [esi + 0x3c], eax
mov ecx, dword [ebx + 0x54]
mov eax, dword [esp + 0x3c]
push ecx
call fcn.10004900
add esp, 4
test eax, eax
je 0x1000536c
mov edx, dword [ebx + 0x54]
push edi
push 4
push 0x1000
push edx
push ebp
call dword [esp + 0x54]
mov ecx, dword [esp + 0x4c]
mov edi, eax
mov eax, dword [ebx + 0x54]
push eax
push ecx
push edi
call fcn.10006410
mov eax, dword [esp + 0x58]
mov edx, dword [eax + 0x3c]
mov ecx, dword [esp + 0x5c]
add edi, edx
push ebx
mov dword [esi], edi
push ecx
mov dword [edi + 0x34], ebp
push eax
mov edi, esi
call fcn.10004920
add esp, 0x2c
test eax, eax
je 0x1000536c
mov edx, dword [esi]
mov eax, dword [edx + 0x34]
sub eax, dword [ebx + 0x34]
je 0x1000531d
push eax
mov eax, esi
call fcn.10004c50
add esp, 4
mov dword [esi + 0x18], eax
jmp 0x10005324
mov dword [esi + 0x18], 1
call fcn.10004ce0
test eax, eax
je 0x1000536c
push esi
call fcn.10004ac0
add esp, 4
test eax, eax
je 0x1000536c
mov eax, esi
call fcn.10004c10
test eax, eax
je 0x1000536c
mov eax, dword [esi]
mov eax, dword [eax + 0x28]
test eax, eax
je 0x100053b1
add eax, ebp
cmp dword [esi + 0x14], 0
je 0x100053a4
push 0
push 1
push ebp
call eax
test eax, eax
jne 0x1000537f
push 0x45a
call dword [sym.imp.KERNEL32.dll_SetLastError]
push esi
call fcn.10005060
add esp, 4
pop edi
pop esi
pop ebx
xor eax, eax
pop ebp
add esp, 0x24
ret
push str.Edge
push esi
mov dword [esi + 0x10], 1
call fcn.10004f20
add esp, 8
test eax, eax
je 0x100053b8
call eax
pop edi
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
mov dword [esi + 0x38], 0
pop edi
mov eax, esi
pop esi
pop ebx
pop ebp
add esp, 0x24
ret