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

Disassembly:
push ebx
push edi
mov edi, dword [esp + 0xc]
xor ebx, ebx
cmp edi, ebx
je 0x408711
cmp dword [edi + 0x2c], ebx
jne 0x40871b
pop edi
mov eax, 0xffffff9a
pop ebx
ret 0xc
cmp dword [edi + 0x80], 8
push ebp
push esi
mov dword [edi + 0x34], ebx
jne 0x408787
cmp dword [edi + 0x84], ebx
jne 0x408787
lea ebp, [edi + 0x30]
mov eax, dword [edi + 0x40]
test eax, eax
jne 0x408762
mov eax, dword [edi + 0x6c]
mov ecx, dword [edi + 0x20]
mov edx, dword [edi + 0x1c]
push eax
lea esi, [edi + 0x88]
push esi
push ecx
push edx
call dword [edi + 8]
mov dword [edi + 0x6c], 0
mov dword [edi + 0x40], 0x4000
mov dword [edi + 0x3c], esi
mov esi, dword [edi + 0x44]
push 4
push ebp
call fcn.00409a10
mov ecx, dword [edi + 0x6c]
mov ebx, eax
mov eax, dword [edi + 0x44]
sub eax, esi
add ecx, eax
test ebx, ebx
mov dword [edi + 0x6c], ecx
je 0x408734
cmp ebx, 1
jne 0x408787
xor ebx, ebx
mov eax, dword [edi + 0x6c]
test eax, eax
jbe 0x4087ad
test ebx, ebx
jne 0x4087ad
mov edx, dword [edi + 0x20]
push eax
mov eax, dword [edi + 0x1c]
lea ecx, [edi + 0x88]
push ecx
push edx
push eax
call dword [edi + 8]
cmp eax, dword [edi + 0x6c]
je 0x4087ad
or ebx, 0xffffffff
cmp dword [edi + 0x80], 8
jne 0x4087d2
mov eax, dword [edi + 0x84]
test eax, eax
jne 0x4087eb
lea ecx, [edi + 0x30]
push ecx
call fcn.00409ca0
mov ebx, eax
mov dword [edi + 0x68], 0
mov eax, dword [edi + 0x84]
test eax, eax
jne 0x4087eb
mov edx, dword [edi + 0x38]
mov ebp, dword [edi + 0x408c]
mov dword [esp + 0x18], edx
jmp 0x4087ef
mov ebp, dword [esp + 0x1c]
mov esi, dword [edi + 0x74]
mov eax, dword [edi + 0x44]
add esi, 0x10
mov edx, 4
mov ecx, ebp
mov dword [esp + 0x14], eax
call fcn.00408470
mov esi, dword [edi + 0x74]
mov ecx, dword [esp + 0x14]
add esi, 0x14
call fcn.00408470
mov eax, dword [edi + 0x5c]
mov ecx, 1
cmp eax, ecx
jne 0x408833
mov esi, dword [edi + 0x74]
add esi, 0x24
mov edx, 2
call fcn.00408470
mov esi, dword [edi + 0x74]
mov ecx, dword [esp + 0x18]
add esi, 0x18
mov edx, 4
call fcn.00408470
test ebx, ebx
jne 0x408861
mov ecx, dword [edi + 0x78]
mov edx, dword [edi + 0x74]
push ecx
push edx
lea eax, [edi + 0x24]
push eax
call fcn.00408390
add esp, 0xc
mov ebx, eax
mov ecx, dword [edi + 0x74]
push ecx
call sub.MSVCRT.dll_free
add esp, 4
test ebx, ebx
jne 0x408900
mov edx, dword [edi + 0x20]
mov eax, dword [edi + 0x1c]
push edx
push eax
call dword [edi + 0xc]
mov ecx, dword [edi + 0x70]
mov edx, dword [edi + 0x20]
push ebx
add ecx, 0xe
push ecx
mov dword [esp + 0x24], eax
mov eax, dword [edi + 0x1c]
push edx
push eax
call dword [edi + 0x10]
test eax, eax
je 0x4088a0
or ebx, 0xffffffff
jmp 0x4088e7
mov ecx, dword [edi + 0x20]
push ecx
mov esi, 4
mov ecx, ebp
mov edx, edi
call fcn.00408440
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x4088e7
mov edx, dword [edi + 0x20]
mov ecx, dword [esp + 0x14]
push edx
mov edx, edi
call fcn.00408440
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x4088e7
mov eax, dword [edi + 0x20]
mov ecx, dword [esp + 0x18]
push eax
mov edx, edi
call fcn.00408440
add esp, 4
mov ebx, eax
mov ecx, dword [esp + 0x1c]
mov edx, dword [edi + 0x20]
mov eax, dword [edi + 0x1c]
push 0
push ecx
push edx
push eax
call dword [edi + 0x10]
test eax, eax
je 0x408900
or ebx, 0xffffffff
mov eax, dword [edi + 0x4094]
pop esi
inc eax
pop ebp
mov dword [edi + 0x4094], eax
mov dword [edi + 0x2c], 0
pop edi
mov eax, ebx
pop ebx
ret 0xc