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

Disassembly:
sub esp, 0x18
test ebx, ebx
mov eax, 1
mov byte [esp + 3], al
je 0x406e75
cmp word [ebx + 4], 0
jne 0x406c73
mov ax, 2
add esp, 0x18
ret
test byte [ebx + 6], al
je 0x406c80
mov ax, 3
add esp, 0x18
ret
mov eax, dword [esp + 0x24]
add eax, 3
and eax, 0xfffffffc
movzx eax, ax
lea ecx, [eax + 0xc]
push ebp
movzx ebp, cx
movzx ecx, word [ebx + 0x78]
cmp cx, ax
mov dword [esp + 0x28], eax
jbe 0x406ca6
movzx eax, cx
jmp 0x406ca9
movzx eax, ax
push esi
push edi
mov edi, dword [ebx + 0x74]
test edi, edi
mov word [ebx + 0x78], ax
jne 0x406cd3
mov esi, ebx
call fcn.004045c0
test eax, eax
je 0x406cc8
mov edi, dword [ebx + 0x74]
test edi, edi
jne 0x406cdf
pop edi
pop esi
mov ax, 2
pop ebp
add esp, 0x18
ret
lea edx, [ebx + 0x64]
push edx
call fcn.004081e0
add esp, 4
mov dx, di
sub dx, word [eax]
movsx ecx, bp
movsx eax, dx
movsx edx, word [ebx + 0x6c]
sub edx, eax
cmp edx, ecx
mov dword [esp + 0x10], ecx
jg 0x406d16
mov esi, ebx
call fcn.004045c0
test eax, eax
jne 0x406d0f
pop edi
pop esi
mov ax, 3
pop ebp
add esp, 0x18
ret
mov edi, dword [ebx + 0x74]
test edi, edi
je 0x406cc8
movsx ebp, word [esp + 0x28]
mov esi, dword [esp + 0x10]
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x2c]
mov dword [edi], ebp
add edi, 4
push eax
add esi, 0xfffffffc
mov dword [edi], esi
add edi, 4
push ecx
push edi
mov dword [esp + 0x1c], edi
call fcn.00404360
movsx edx, word [esp + 0x3c]
add edi, edx
mov dword [edi], esi
add ebp, 0xffffffff
add esp, 0xc
add edi, 4
cmp ebp, 0x14
ja case.0x406d62.0
movzx eax, byte [ebp + 0x406ea0]
jmp dword [eax*4 + 0x406e7c]
mov ecx, dword [esp + 0x2c]
mov eax, dword [ecx]
mov ecx, dword [ecx + 4]
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], ecx
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], ecx
jmp 0x406e46
mov ecx, dword [esp + 0x2c]
push 0x10
push ecx
lea edx, [esp + 0x1c]
push edx
call fcn.00404360
add esp, 0xc
jmp 0x406e46
mov eax, dword [esp + 0x2c]
push 0x10
push eax
lea ecx, [esp + 0x1c]
push ecx
call fcn.00404360
add esp, 0xc
jmp 0x406e46
mov edx, dword [esp + 0x2c]
push 0x10
push edx
lea eax, [esp + 0x1c]
push eax
call fcn.00404360
add esp, 0xc
jmp 0x406e46
mov eax, dword [esp + 0x10]
lea ecx, [eax + 8]
lea edx, [esp + 0x14]
mov dword [eax + 4], ecx
movzx eax, word [eax + 2]
push edx
push ecx
push eax
call fcn.00404f50
add esp, 0xc
jmp 0x406e46
mov eax, dword [esp + 0x2c]
test word [eax + 0x18], 0x8000
je 0x406e04
mov ecx, dword [esp + 0x10]
lea edx, [ecx + 0x38]
mov dword [ecx + 0x10], edx
push 0x10
push eax
lea eax, [esp + 0x1c]
push eax
call fcn.00404360
add esp, 0xc
jmp 0x406e46
mov ecx, dword [esp + 0x2c]
movsx eax, word [ecx + 8]
mov edx, dword [ecx]
mov ecx, dword [ecx + 4]
mov esi, edx
sub esi, eax
mov dword [esp + 0x14], esi
mov esi, ecx
sub esi, eax
add edx, eax
add ecx, eax
mov dword [esp + 0x18], esi
mov dword [esp + 0x1c], edx
mov dword [esp + 0x20], ecx
jmp 0x406e46
mov byte [esp + 0xf], 0
cmp byte [esp + 0xf], 0
mov dword [ebx + 0x74], edi
je 0x406e6f
lea edx, [esp + 0x14]
push edx
mov eax, edx
push eax
call fcn.00404c90
lea ecx, [esp + 0x1c]
lea eax, [ebx + 0x30]
push ecx
push eax
push eax
call fcn.00404d00
add esp, 0x14
pop edi
pop esi
xor ax, ax
pop ebp
add esp, 0x18
ret