Function at 0x408770
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x7c
mov eax, dword [0x52fe80]
xor eax, esp
mov dword [esp + 0x78], eax
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
mov esi, ecx
mov dword [esp + 0x14], 0
test edi, edi
je 0x408ac1
push dword [esp + 0x14]
lea eax, [esp + 0x17]
push eax
push dword [edi + 4]
push dword [edi]
call fcn.00409f00
mov eax, dword [edi]
add esp, 0x10
mov dword [edi + 4], eax
cmp dword [esi + 0x10], 0
je 0x408ac1
xor eax, eax
mov dword [esp + 0x18], 0
push 0xffffffffffffffff
push eax
push esi
lea ecx, [esp + 0x48]
mov dword [esp + 0x28], 0
mov dword [esp + 0x2c], 0
mov dword [esp + 0x5c], 7
mov dword [esp + 0x58], 0
mov word [esp + 0x48], ax
call fcn.004072a0
xor eax, eax
mov dword [esp + 0x68], 7
mov dword [esp + 0x64], 0
mov word [esp + 0x54], ax
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x40]
call fcn.00408c80
mov edx, eax
lea ecx, [esp + 0x3c]
call fcn.004083e0
test al, al
sete bl
cmp dword [esp + 0x38], 8
jb 0x408845
push dword [esp + 0x24]
call fcn.0048185e
add esp, 4
lea eax, [esp + 0x24]
lea ecx, [esp + 0x3c]
push eax
call fcn.00408d90
lea ecx, [esp + 0x54]
test bl, bl
je 0x4088d3
cmp ecx, eax
je 0x408869
push 0xffffffffffffffff
push 0
push eax
call fcn.004072a0
cmp dword [esp + 0x38], 8
jb 0x40887c
push dword [esp + 0x24]
call fcn.0048185e
add esp, 4
lea ecx, [esp + 0x54]
call fcn.00408620
test al, al
jne 0x408897
lea eax, [esp + 0x54]
push eax
lea ecx, [esp + 0x1c]
call fcn.00409860
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x40]
call fcn.00408c80
lea ecx, [esp + 0x3c]
cmp ecx, eax
je 0x4088b7
push 0xffffffffffffffff
push 0
push eax
call fcn.004072a0
cmp dword [esp + 0x38], 8
jb 0x408814
push dword [esp + 0x24]
call fcn.0048185e
add esp, 4
jmp 0x408814
cmp ecx, eax
je 0x4088e5
push 0xffffffffffffffff
push 0
push eax
lea ecx, [esp + 0x60]
call fcn.004072a0
cmp dword [esp + 0x38], 8
jb 0x4088f8
push dword [esp + 0x24]
call fcn.0048185e
add esp, 4
cmp dword [esp + 0x64], 0
je 0x408932
mov edx, 0x50e0d8
lea ecx, [esp + 0x54]
call fcn.00409e90
test al, al
je 0x408932
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x40]
call fcn.00408d90
push eax
lea ecx, [esp + 0x1c]
call fcn.00409860
lea ecx, [esp + 0x24]
call fcn.00408720
lea eax, [esp + 0x6c]
push eax
lea ecx, [esp + 0x40]
call fcn.00408c80
lea ecx, [esp + 0x6c]
call fcn.00408370
cmp eax, 0xffffffff
je 0x408997
inc eax
mov dword [esp + 0x38], 7
xor ecx, ecx
mov dword [esp + 0x34], 0
push eax
push ecx
lea eax, [esp + 0x74]
mov word [esp + 0x2c], cx
push eax
lea ecx, [esp + 0x30]
call fcn.004072a0
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x1c]
call fcn.00409790
cmp dword [esp + 0x38], 8
jb 0x408997
push dword [esp + 0x24]
call fcn.0048185e
add esp, 4
mov ebx, dword [esp + 0x1c]
mov eax, 0x2aaaaaab
mov esi, dword [esp + 0x18]
mov ecx, ebx
sub ecx, esi
mov dword [esp + 0x24], 0
imul ecx
lea ecx, [esp + 0x24]
mov dword [esp + 0x28], 0
sar edx, 2
mov eax, edx
mov dword [esp + 0x2c], 0
shr eax, 0x1f
add eax, edx
push eax
call fcn.00409f40
test al, al
je 0x4089f0
push dword [esp + 0x14]
mov ecx, dword [esp + 0x28]
push esi
push ebx
call fcn.0040a080
add esp, 0xc
mov dword [esp + 0x28], eax
lea eax, [esp + 0x24]
mov ecx, edi
push eax
call fcn.00409720
mov edi, dword [esp + 0x24]
test edi, edi
je 0x408a20
push dword [esp + 0x14]
lea eax, [esp + 0x17]
push eax
push dword [esp + 0x30]
push edi
call fcn.00409f00
push edi
call fcn.0048185e
add esp, 0x14
cmp dword [esp + 0x80], 8
jb 0x408a36
push dword [esp + 0x6c]
call fcn.0048185e
add esp, 4
xor eax, eax
mov dword [esp + 0x80], 7
cmp dword [esp + 0x68], 8
mov dword [esp + 0x7c], 0
mov word [esp + 0x6c], ax
jb 0x408a63
push dword [esp + 0x54]
call fcn.0048185e
add esp, 4
xor eax, eax
mov dword [esp + 0x68], 7
cmp dword [esp + 0x50], 8
mov dword [esp + 0x64], 0
mov word [esp + 0x54], ax
jb 0x408a8d
push dword [esp + 0x3c]
call fcn.0048185e
add esp, 4
xor eax, eax
mov dword [esp + 0x50], 7
mov dword [esp + 0x4c], 0
mov word [esp + 0x3c], ax
test esi, esi
je 0x408ac1
push dword [esp + 0x14]
lea eax, [esp + 0x17]
push eax
push ebx
push esi
call fcn.00409f00
push esi
call fcn.0048185e
add esp, 0x14
mov ecx, dword [esp + 0x84]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.004bc1bd
mov esp, ebp
pop ebp
ret 4