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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
push edi
xor edi, edi
mov dword [ebp - 8], edi
mov dword [ebp - 0xc], edi
cmp ebx, edi
jne 0x40a9ad
mov eax, 0xffffff9a
pop edi
mov esp, ebp
pop ebp
ret
cmp dword [ebx + 0x2c], edi
je 0x40a9a3
cmp dword [ebx + 0x80], 8
push esi
mov dword [ebx + 0x34], edi
jne 0x40aa09
cmp dword [ebx + 0x84], edi
jne 0x40aa09
cmp dword [ebx + 0x40], 0
jne 0x40a9e4
mov esi, ebx
call fcn.0040a5f0
lea eax, [ebx + 0x88]
mov dword [ebx + 0x40], 0x4000
mov dword [ebx + 0x3c], eax
mov esi, dword [ebx + 0x44]
push 4
lea edi, [ebx + 0x30]
call fcn.00404a60
mov ecx, dword [ebx + 0x44]
sub ecx, esi
add dword [ebx + 0x6c], ecx
mov edi, eax
add esp, 4
test edi, edi
je 0x40a9c7
cmp edi, 1
jne 0x40aa09
xor edi, edi
cmp dword [ebx + 0x6c], 0
jbe 0x40aa21
test edi, edi
jne 0x40aa21
mov esi, ebx
call fcn.0040a5f0
cmp eax, 0xffffffff
jne 0x40aa21
or edi, eax
cmp dword [ebx + 0x80], 8
jne 0x40aa44
cmp dword [ebx + 0x84], 0
jne 0x40aa5c
lea esi, [ebx + 0x30]
call fcn.00404c90
mov edi, eax
mov dword [ebx + 0x68], 0
cmp dword [ebx + 0x84], 0
jne 0x40aa5c
mov edx, dword [ebx + 0x408c]
mov eax, dword [ebx + 0x38]
mov dword [ebp - 8], edx
mov dword [ebp - 0xc], eax
mov edx, dword [ebx + 0x40a4]
mov eax, dword [ebp - 8]
add edx, dword [ebx + 0x44]
mov ecx, dword [ebx + 0x74]
mov esi, eax
mov byte [ecx + 0x10], al
shr esi, 8
mov eax, esi
mov byte [ecx + 0x11], al
shr eax, 8
mov byte [ecx + 0x12], al
shr eax, 8
mov byte [ecx + 0x13], al
shr eax, 8
mov dword [ebp - 0x10], edx
mov dword [ebp - 0x1c], eax
test eax, eax
je 0x40aa98
mov dword [ecx + 0x10], 0xffffffff
mov ecx, dword [ebx + 0x74]
mov eax, edx
shr eax, 8
mov dword [ebp - 0x14], eax
mov byte [ecx + 0x15], al
shr eax, 8
mov byte [ecx + 0x16], al
shr eax, 8
mov byte [ecx + 0x17], al
shr eax, 8
mov byte [ecx + 0x14], dl
mov dword [ebp - 0x1c], eax
test eax, eax
je 0x40aac6
mov dword [ecx + 0x14], 0xffffffff
cmp dword [ebx + 0x5c], 1
jne 0x40aad5
mov eax, dword [ebx + 0x74]
mov word [eax + 0x24], 1
mov ecx, dword [ebx + 0x74]
mov eax, dword [ebp - 0xc]
mov byte [ecx + 0x18], al
shr eax, 8
mov dword [ebp - 0x18], eax
mov byte [ecx + 0x19], al
shr eax, 8
mov byte [ecx + 0x1a], al
shr eax, 8
mov byte [ecx + 0x1b], al
shr eax, 8
mov dword [ebp - 0x1c], eax
test eax, eax
je 0x40ab04
mov dword [ecx + 0x18], 0xffffffff
test edi, edi
jne 0x40ab1e
mov ecx, dword [ebx + 0x78]
mov edx, dword [ebx + 0x74]
push ecx
push edx
lea eax, [ebx + 0x24]
push eax
call fcn.004098a0
add esp, 0xc
mov edi, eax
mov ecx, dword [ebx + 0x74]
push ecx
call fcn.004163a3
add esp, 4
test edi, edi
jne 0x40ac47
mov edx, dword [ebx + 0x20]
mov eax, dword [ebx + 0x1c]
mov ecx, dword [ebx + 0xc]
push edx
push eax
call ecx
mov edx, dword [ebx + 0x70]
mov ecx, dword [ebx + 0x1c]
push edi
add edx, 0xe
push edx
mov edx, dword [ebx + 0x10]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebx + 0x20]
push eax
push ecx
call edx
add esp, 0x18
or edi, 0xffffffff
test eax, eax
jne 0x40ac2a
mov al, byte [ebp - 8]
mov ecx, dword [ebx + 0x20]
mov byte [ebp - 4], al
mov eax, esi
mov byte [ebp - 3], al
shr eax, 8
mov byte [ebp - 2], al
shr eax, 8
mov byte [ebp - 1], al
shr eax, 8
mov dword [ebp - 0x20], eax
test eax, eax
je 0x40ab8c
mov dword [ebp - 4], edi
mov eax, dword [ebx + 0x1c]
push 4
lea edx, [ebp - 4]
push edx
push ecx
mov ecx, dword [ebx + 8]
push eax
call ecx
add esp, 0x10
cmp eax, 4
jne 0x40ac2a
mov eax, dword [ebp - 0x14]
mov dl, byte [ebp - 0x10]
mov ecx, dword [ebx + 0x20]
mov byte [ebp - 3], al
shr eax, 8
mov byte [ebp - 2], al
shr eax, 8
mov byte [ebp - 1], al
shr eax, 8
mov byte [ebp - 4], dl
mov dword [ebp - 0x20], eax
test eax, eax
je 0x40abd0
mov dword [ebp - 4], edi
mov edx, dword [ebx + 8]
push 4
lea eax, [ebp - 4]
push eax
push ecx
mov ecx, dword [ebx + 0x1c]
push ecx
call edx
add esp, 0x10
cmp eax, 4
jne 0x40ac2a
mov al, byte [ebp - 0xc]
mov ecx, dword [ebx + 0x20]
mov byte [ebp - 4], al
mov eax, dword [ebp - 0x18]
mov byte [ebp - 3], al
shr eax, 8
mov byte [ebp - 2], al
shr eax, 8
mov byte [ebp - 1], al
shr eax, 8
mov dword [ebp - 0x20], eax
test eax, eax
je 0x40ac10
mov dword [ebp - 4], edi
mov eax, dword [ebx + 0x1c]
push 4
lea edx, [ebp - 4]
push edx
push ecx
mov ecx, dword [ebx + 8]
push eax
call ecx
add esp, 0x10
lea edi, [eax - 4]
neg edi
sbb edi, edi
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebx + 0x20]
mov ecx, dword [ebx + 0x1c]
push 0
push edx
mov edx, dword [ebx + 0x10]
push eax
push ecx
call edx
add esp, 0x10
test eax, eax
je 0x40ac47
or edi, 0xffffffff
inc dword [ebx + 0x40b0]
pop esi
mov eax, edi
mov dword [ebx + 0x2c], 0
pop edi
mov esp, ebp
pop ebp
ret