Function at 0x4a9680
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 0x4a969e
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 0x4a96be
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 0x4a96dc
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 0x4a96f9
mov eax, 0x14c
cmp word [ebx + 4], ax
jne 0x4a96f9
mov edx, dword [ebx + 0x38]
test dl, 1
je 0x4a970c
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 esi, [ecx + ebx + 0x18]
test eax, eax
jbe 0x4a9740
add esi, 0xc
mov edi, eax
mov ecx, dword [esi + 4]
mov eax, dword [esi]
test ecx, ecx
jne 0x4a9730
add eax, edx
jmp 0x4a9732
add eax, ecx
cmp eax, ebp
jbe 0x4a9738
mov ebp, eax
add esi, 0x28
sub edi, 1
jne 0x4a9723
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 0x4a977c
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 eax, dword [ebx + 0x34]
mov edi, dword [sym.imp.KERNEL32.dll_VirtualAlloc]
push 4
push 0x3000
push esi
push eax
call edi
mov ebp, eax
test ebp, ebp
jne 0x4a97a7
push 4
push 0x3000
push esi
push eax
call edi
mov ebp, eax
test ebp, ebp
je 0x4a97cb
push 0x3c
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 0x4a97dd
push 0x8000
push eax
push ebp
call dword [sym.imp.KERNEL32.dll_VirtualFree]
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 dword [esi + 4], ebp
movzx edx, word [ebx + 0x16]
shr edx, 0xd
and edx, 1
mov dword [esi + 0x14], edx
mov dword [esi + 0x1c], 0x4a9600
mov dword [esi + 0x20], 0x4a9620
mov dword [esi + 0x24], 0x4a9640
mov dword [esi + 0x28], 0x4a9650
mov dword [esi + 0x2c], 0x4a9670
mov dword [esi + 0x30], 0
mov eax, dword [esp + 0x14]
mov dword [esi + 0x38], eax
mov ecx, dword [ebx + 0x54]
mov eax, dword [esp + 0x3c]
push ecx
call fcn.004a90a0
add esp, 4
test eax, eax
je 0x4a98e1
mov eax, dword [ebx + 0x54]
push 4
push 0x1000
push eax
push ebp
call edi
mov edx, dword [ebx + 0x54]
mov edi, eax
mov eax, dword [esp + 0x38]
push edx
push eax
push edi
call fcn.00530500
mov eax, dword [esp + 0x44]
mov ecx, dword [eax + 0x3c]
mov edx, dword [esp + 0x48]
add edi, ecx
push ebx
mov dword [esi], edi
push edx
mov dword [edi + 0x34], ebp
push eax
mov edi, esi
call fcn.004a90c0
add esp, 0x18
test eax, eax
je 0x4a98e1
mov eax, dword [esi]
mov eax, dword [eax + 0x34]
sub eax, dword [ebx + 0x34]
je 0x4a9892
push eax
mov eax, esi
call fcn.004a93f0
add esp, 4
mov dword [esi + 0x18], eax
jmp 0x4a9899
mov dword [esi + 0x18], 1
call fcn.004a9480
test eax, eax
je 0x4a98e1
push esi
call fcn.004a9260
add esp, 4
test eax, eax
je 0x4a98e1
mov eax, esi
call fcn.004a93b0
test eax, eax
je 0x4a98e1
mov ecx, dword [esi]
mov eax, dword [ecx + 0x28]
test eax, eax
je 0x4a990e
add eax, ebp
cmp dword [esi + 0x14], 0
je 0x4a9901
push 0
push 1
push ebp
call eax
test eax, eax
jne 0x4a98f0
push 0x45a
call dword [sym.imp.KERNEL32.dll_SetLastError]
call fcn.004a9a00
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 + 0x34], eax
mov eax, esi
pop esi
pop ebx
pop ebp
add esp, 0x24
ret
pop edi
mov dword [esi + 0x34], 0
mov eax, esi
pop esi
pop ebx
pop ebp
add esp, 0x24
ret