Function at 0x582164
Capabilities:
Parse pe header

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffdc
push ebx
push esi
push edi
mov dword [ebp - 8], ecx
mov dword [ebp - 4], edx
mov edi, eax
mov eax, dword [ebp - 4]
call fcn.00573a10
mov eax, dword [ebp - 8]
call fcn.00573a10
mov eax, dword [ebp + 8]
call fcn.00573a10
xor eax, eax
push ebp
push 0x5823ca
push dword fs:[eax]
mov dword fs:[eax], esp
xor eax, eax
mov dword [ebp - 0xc], eax
test edi, edi
je 0x5823a7
xor eax, eax
mov dword [ebp - 0x20], eax
mov eax, edi
mov esi, dword [eax + 0x3c]
add esi, edi
cmp word [eax], 0x5a4d
jne 0x5823a7
cmp dword [esi], 0x4550
jne 0x5823a7
mov eax, dword [esi + 0x80]
mov dword [ebp - 0x18], eax
mov edx, dword [ebp - 0x18]
mov eax, esi
call fcn.00581d18
mov edx, eax
mov eax, edi
call fcn.00581e2c
mov dword [ebp - 0x1c], eax
mov edx, dword [ebp - 0x18]
mov eax, esi
call fcn.00581d18
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x18]
add eax, edi
mov ebx, eax
jmp 0x582207
add ebx, 0x14
add dword [ebp - 0x20], 0x14
push 0x14
push ebx
call sub.kernel32.dll_IsBadReadPtr
test eax, eax
jne 0x58221f
cmp dword [ebx + 0x10], 0
je 0x58221f
cmp dword [ebx + 0xc], 0
jne 0x582200
add dword [ebp - 0x20], 0x28
mov eax, dword [ebp - 4]
call fcn.00573820
mov ebx, eax
add ebx, dword [ebp - 0x20]
mov eax, dword [ebp - 8]
call fcn.00573820
add ebx, eax
add ebx, 0xc
mov dword [ebp - 0x24], ebx
mov eax, dword [ebp + 0xc]
push eax
push 1
mov eax, dword [ebp + 8]
call fcn.00573a20
mov edx, eax
mov ecx, dword [ebp - 0x24]
mov eax, edi
call fcn.00581fd0
mov ebx, edi
add ebx, eax
test ebx, ebx
jbe 0x5823a7
mov eax, dword [ebp - 0x1c]
mov eax, dword [eax + 0x24]
test eax, 0x80000000
jne 0x58227e
sub eax, 0x80000000
mov edx, dword [ebp - 0x1c]
mov dword [edx + 0x24], eax
mov edx, dword [ebp - 0x24]
mov eax, ebx
call fcn.005750dc
mov dword [ebp - 0x10], ebx
mov eax, dword [ebp - 4]
call fcn.00573820
push eax
lea eax, [ebp - 4]
call fcn.00573a78
mov edx, eax
mov eax, ebx
pop ecx
call fcn.005750d4
mov eax, dword [ebp - 4]
call fcn.00573820
cdq
push edx
push eax
mov eax, ebx
xor edx, edx
add eax, dword [esp]
adc edx, dword [esp + 4]
add esp, 8
add eax, 3
adc edx, 0
mov ebx, eax
mov eax, dword [ebp - 8]
call fcn.00573820
push eax
lea eax, [ebp - 8]
call fcn.00573a78
mov edx, eax
mov eax, ebx
pop ecx
call fcn.005750d4
mov eax, dword [ebp - 8]
call fcn.00573820
cdq
push edx
push eax
mov eax, ebx
xor edx, edx
add eax, dword [esp]
adc edx, dword [esp + 4]
add esp, 8
add eax, 1
adc edx, 0
mov ebx, eax
mov dword [ebp - 0x14], ebx
mov eax, dword [ebp - 8]
call fcn.00573820
mov edx, ebx
sub edx, edi
sub edx, eax
sub edx, 3
mov eax, esi
call fcn.00581d80
mov dword [ebx], eax
add ebx, 4
xor eax, eax
mov dword [ebx], eax
add ebx, 4
mov edx, ebx
sub edx, edi
mov eax, esi
call fcn.00581d80
mov dword [esi + 0x80], eax
xor eax, eax
mov dword [esi + 0xd0], eax
xor eax, eax
mov dword [esi + 0xd4], eax
xor eax, eax
mov dword [esi + 0xd8], eax
xor eax, eax
mov dword [esi + 0xdc], eax
mov eax, dword [ebp - 0x18]
add eax, edi
mov ecx, dword [ebp - 0x20]
sub ecx, 0x28
mov edx, eax
mov eax, ebx
call fcn.005750d4
add ebx, dword [ebp - 0x20]
sub ebx, 0x28
mov edx, dword [ebp - 0x14]
sub edx, edi
mov eax, esi
call fcn.00581d80
mov dword [ebx], eax
mov edx, dword [ebp - 0x10]
sub edx, edi
mov eax, esi
call fcn.00581d80
mov dword [ebx + 0xc], eax
mov edx, dword [ebp - 0x14]
sub edx, edi
mov eax, esi
call fcn.00581d80
mov dword [ebx + 0x10], eax
mov eax, dword [ebx + 0x10]
mov dword [ebp - 0xc], eax
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x5823d1
lea eax, [ebp - 8]
mov edx, 2
call fcn.00573590
lea eax, [ebp + 8]
call fcn.0057356c
ret