Function at 0x40a508
Capabilities:
Parse pe header
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
push ecx
mov ecx, 0xe
push 0
push 0
dec ecx
jne 0x40a511
push ecx
xchg dword [ebp - 4], ecx
push ebx
push esi
push edi
mov dword [ebp - 8], ecx
mov dword [ebp - 4], edx
mov ebx, eax
xor eax, eax
push ebp
push 0x40a8b6
push dword fs:[eax]
mov dword fs:[eax], esp
mov byte [ebp - 9], 0
test ebx, ebx
je 0x40a88e
cmp dword [ebp - 4], 0
je 0x40a88e
push ebp
push 0x40a887
push dword fs:[0]
mov dword fs:[0], esp
mov dword [ebp - 0x10], ebx
mov eax, dword [ebp - 0x10]
cmp word [eax], 0x5a4d
je 0x40a576
call fcn.004043f0
jmp 0x40a88e
mov eax, ebx
xor edx, edx
push edx
push eax
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 0x3c]
cdq
add eax, dword [esp]
adc edx, dword [esp + 4]
jno 0x40a591
call fcn.00403d38
add esp, 8
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x14]
cmp dword [eax], 0x4550
je 0x40a5ac
call fcn.004043f0
jmp 0x40a88e
mov eax, dword [ebp - 0x14]
cmp dword [eax + 0x78], 0
jne 0x40a5bf
call fcn.004043f0
jmp 0x40a88e
mov eax, dword [ebp - 0x14]
add eax, 0x78
mov edx, dword [eax]
mov dword [ebp - 0x1c], edx
add edx, dword [eax + 4]
jae 0x40a5d4
call fcn.00403d38
mov dword [ebp - 0x20], edx
mov eax, dword [ebp - 0x1c]
add eax, ebx
jae 0x40a5e3
call fcn.00403d38
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x18]
mov edx, dword [eax + 0x10]
mov eax, dword [ebp - 0x18]
mov esi, dword [eax + 0x14]
mov eax, dword [ebp - 0x18]
mov eax, dword [eax + 0x18]
mov ecx, dword [ebp - 0x18]
mov ecx, dword [ecx + 0x1c]
add ecx, ebx
jae 0x40a607
call fcn.00403d38
mov dword [ebp - 0x24], ecx
mov ecx, dword [ebp - 0x18]
mov ecx, dword [ecx + 0x20]
add ecx, ebx
jae 0x40a619
call fcn.00403d38
mov dword [ebp - 0x28], ecx
mov ecx, dword [ebp - 0x18]
mov ecx, dword [ecx + 0x24]
add ecx, ebx
jae 0x40a62b
call fcn.00403d38
mov dword [ebp - 0x2c], ecx
xor ecx, ecx
mov dword [ebp - 0x30], ecx
mov ecx, dword [ebp - 4]
cmp ecx, 0xffff
ja 0x40a663
sub ecx, edx
jae 0x40a647
call fcn.00403d38
mov dword [ebp - 0x30], ecx
cmp dword [ebp - 0x30], 0
jb 0x40a659
cmp esi, dword [ebp - 0x30]
jae 0x40a6ff
call fcn.004043f0
jmp 0x40a88e
mov byte [ebp - 0x35], 0
mov edi, eax
sub edi, 1
jae 0x40a673
call fcn.00403d38
test edi, edi
jb 0x40a6ef
inc edi
xor esi, esi
mov eax, 4
mul esi
jae 0x40a688
call fcn.00403d38
add eax, dword [ebp - 0x28]
jae 0x40a692
call fcn.00403d38
mov eax, dword [eax]
add eax, ebx
jae 0x40a69d
call fcn.00403d38
mov dword [ebp - 0x34], eax
lea eax, [ebp - 0x58]
mov edx, dword [ebp - 4]
call fcn.00404b54
mov eax, dword [ebp - 0x58]
push eax
lea eax, [ebp - 0x5c]
mov edx, dword [ebp - 0x34]
call fcn.00404b54
mov eax, dword [ebp - 0x5c]
pop edx
call fcn.0040da64
test eax, eax
jne 0x40a6eb
mov eax, 2
mul esi
jae 0x40a6d5
call fcn.00403d38
add eax, dword [ebp - 0x2c]
jae 0x40a6df
call fcn.00403d38
movzx eax, word [eax]
mov dword [ebp - 0x30], eax
mov byte [ebp - 0x35], 1
jmp 0x40a6ef
inc esi
dec edi
jne 0x40a67a
cmp byte [ebp - 0x35], 0
jne 0x40a6ff
call fcn.004043f0
jmp 0x40a88e
mov eax, dword [ebp - 0x30]
mov edx, 4
mul edx
jae 0x40a710
call fcn.00403d38
add eax, dword [ebp - 0x24]
jae 0x40a71a
call fcn.00403d38
mov eax, dword [eax]
cmp eax, dword [ebp - 0x1c]
jbe 0x40a867
cmp eax, dword [ebp - 0x20]
ja 0x40a867
add ebx, eax
jae 0x40a737
call fcn.00403d38
mov dword [ebp - 0x3c], ebx
lea eax, [ebp - 0x60]
mov edx, dword [ebp - 0x3c]
call fcn.00404b54
mov edx, dword [ebp - 0x60]
mov eax, 0x40a8d0
call fcn.00404f04
mov ebx, eax
test ebx, ebx
jbe 0x40a875
lea eax, [ebp - 0x64]
push eax
lea eax, [ebp - 0x68]
mov edx, dword [ebp - 0x3c]
call fcn.00404b54
mov eax, dword [ebp - 0x68]
mov ecx, ebx
sub ecx, 1
jae 0x40a77a
call fcn.00403d38
mov edx, 1
call fcn.00404e7c
mov edx, dword [ebp - 0x64]
lea eax, [ebp - 0x40]
mov ecx, 0x40a8dc
call fcn.00404c68
lea eax, [ebp - 0x44]
push eax
lea eax, [ebp - 0x6c]
mov edx, dword [ebp - 0x3c]
call fcn.00404b54
mov eax, dword [ebp - 0x6c]
call fcn.00404c1c
push eax
lea eax, [ebp - 0x70]
mov edx, dword [ebp - 0x3c]
call fcn.00404b54
mov eax, dword [ebp - 0x70]
mov edx, ebx
add edx, 1
jae 0x40a7c6
call fcn.00403d38
pop ecx
call fcn.00404e7c
xor ebx, ebx
mov eax, dword [ebp - 0x44]
cmp byte [eax], 0x23
jne 0x40a811
mov bl, 1
lea eax, [ebp - 0x78]
push eax
mov eax, dword [ebp - 0x44]
call fcn.00404c1c
mov ecx, eax
mov edx, 2
mov eax, dword [ebp - 0x44]
call fcn.00404e7c
mov eax, dword [ebp - 0x78]
call fcn.00404e1c
mov edx, eax
lea eax, [ebp - 0x74]
call fcn.00404b54
mov eax, dword [ebp - 0x74]
call fcn.0040c3ac
mov word [ebp - 0x46], ax
mov eax, dword [ebp - 0x40]
call fcn.00404e1c
lea edx, [ebp - 0x50]
call fcn.0040a420
test al, al
jne 0x40a82c
call fcn.004043f0
jmp 0x40a88e
test bl, bl
je 0x40a839
movzx eax, word [ebp - 0x46]
mov dword [ebp - 0x4c], eax
jmp 0x40a844
mov eax, dword [ebp - 0x44]
call fcn.00404e1c
mov dword [ebp - 0x4c], eax
lea ecx, [ebp - 0x54]
mov edx, dword [ebp - 0x4c]
mov eax, dword [ebp - 0x50]
call fcn.0040a508
test al, al
jne 0x40a85d
call fcn.004043f0
jmp 0x40a88e
mov eax, dword [ebp - 8]
mov edx, dword [ebp - 0x54]
mov dword [eax], edx
jmp 0x40a875
add ebx, eax
jae 0x40a870
call fcn.00403d38
mov eax, dword [ebp - 8]
mov dword [eax], ebx
mov byte [ebp - 9], 1
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x40a88e
ret
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x40a8bd
lea eax, [ebp - 0x78]
mov edx, 9
call fcn.00404980
lea eax, [ebp - 0x44]
mov edx, 2
call fcn.00404980
ret