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

Disassembly:
push 0xffffffffffffffff
push 0x45e086
mov eax, dword fs:[0]
push eax
sub esp, 0x4f0
mov eax, dword [0x478354]
xor eax, esp
mov dword [esp + 0x4e8], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x478354]
xor eax, esp
push eax
lea eax, [esp + 0x504]
mov dword fs:[0], eax
mov eax, dword [esp + 0x514]
push edx
xor ebx, ebx
push eax
mov dword [esp + 0x24], ecx
mov byte [esp + 0x1f], bl
call fcn.0042f8c0
mov ebp, eax
add esp, 8
cmp ebp, ebx
je 0x40f9c8
push 0x22c
lea eax, [esp + 0xa4]
push ebx
push eax
call fcn.0043eb30
xor eax, eax
add esp, 0xc
cmp dword [ebp], 1
mov dword [esp + 0x9c], eax
mov word [esp + 0xa0], bx
mov dword [esp + 0x2c8], ebx
je 0x40f6ee
push ebp
mov dword [0x47de7c], 0x80000
call fcn.0042fa10
add esp, 4
mov al, bl
jmp 0x40f9ca
mov esi, dword [ebp + 4]
mov edi, dword [esi]
or ecx, 0xffffffff
cmp dword [edi + 4], ecx
jg 0x40f702
mov ecx, 0x10000
jmp 0x40f767
cmp dword [esi + 4], ecx
je 0x40f70f
call fcn.0042f100
or ecx, 0xffffffff
mov dword [esi + 4], ecx
mov ecx, dword [esi]
mov eax, dword [ecx + 4]
mov dword [esp + 0x9c], eax
mov word [esp + 0xa0], bx
mov dword [esp + 0x2a8], ebx
mov dword [esp + 0x2ac], ebx
mov dword [esp + 0x2b0], ebx
mov dword [esp + 0x2b4], ebx
mov dword [esp + 0x2b8], ebx
mov dword [esp + 0x2bc], ebx
mov dword [esp + 0x2c0], ebx
mov dword [esp + 0x2c4], ebx
mov dword [esp + 0x2c8], ebx
xor ecx, ecx
cmp ecx, ebx
mov dword [0x47de7c], ecx
jne 0x40f994
cmp eax, ebx
mov byte [esp + 0x17], 1
mov dword [esp + 0x20], eax
mov dword [esp + 0x18], ebx
jle 0x40f994
lea ebx, [ebx]
push 0x22c
lea edx, [esp + 0x2d4]
push ebx
push edx
call fcn.0043eb30
add esp, 0xc
cmp dword [ebp], 1
mov dword [esp + 0x2cc], ebx
mov word [esp + 0x2d0], bx
mov dword [esp + 0x4f8], ebx
jne 0x40f986
mov edx, dword [esp + 0x18]
mov eax, dword [ebp + 4]
lea ecx, [esp + 0x2cc]
push ecx
push edx
push eax
call fcn.0042f230
cmp eax, ebx
mov dword [0x47de7c], eax
jne 0x40f990
mov al, byte [esp + 0x4d8]
test al, 0x10
je 0x40f87b
mov dword [esp + 0x78], 7
mov dword [esp + 0x74], ebx
mov word [esp + 0x64], bx
mov dword [esp + 0x98], 0xf
mov dword [esp + 0x94], ebx
mov byte [esp + 0x84], bl
mov dword [esp + 0x50c], ebx
mov eax, dword [esp + 0x4d8]
mov dword [esp + 0x7c], eax
lea eax, [esp + 0x2d0]
lea edx, [eax + 2]
mov edi, edi
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x40f840
sub eax, edx
sar eax, 1
push eax
lea ecx, [esp + 0x2d4]
push ecx
lea esi, [esp + 0x68]
call fcn.0040cf00
mov edi, esi
call fcn.0040f5d0
mov edx, esi
mov esi, dword [esp + 0x1c]
push edx
call fcn.00410060
mov esi, edi
jmp 0x40f952
test al, 0x20
je 0x40f990
mov dword [esp + 0x3c], 7
mov dword [esp + 0x38], ebx
mov word [esp + 0x28], bx
mov dword [esp + 0x5c], 0xf
mov dword [esp + 0x58], ebx
mov byte [esp + 0x48], bl
mov dword [esp + 0x50c], 1
mov eax, dword [esp + 0x4d8]
mov dword [esp + 0x40], eax
lea eax, [esp + 0x2d0]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x40f8c4
sub eax, edx
sar eax, 1
push eax
lea ecx, [esp + 0x2d4]
push ecx
lea esi, [esp + 0x2c]
call fcn.0040cf00
mov edi, esi
call fcn.0040f5d0
mov eax, dword [esp + 0x4f8]
cmp eax, ebx
jle 0x40f940
mov ecx, dword [esp + 0x58]
cmp eax, ecx
ja 0x40f90d
push 0xffffffffffffffff
push eax
lea ecx, [esp + 0x4c]
call fcn.00407050
jmp 0x40f919
push ebx
sub eax, ecx
lea edi, [esp + 0x48]
call fcn.00406980
cmp dword [esp + 0x5c], 0x10
mov eax, dword [esp + 0x48]
jae 0x40f928
lea eax, [esp + 0x48]
mov edx, dword [esp + 0x18]
mov ecx, dword [esp + 0x58]
push eax
push edx
mov eax, ebp
call fcn.0042f9d0
add esp, 8
cmp eax, ebx
jne 0x40f9a3
mov esi, dword [esp + 0x1c]
lea eax, [esp + 0x24]
push eax
call fcn.00410060
lea esi, [esp + 0x24]
mov dword [esp + 0x50c], 0xffffffff
call fcn.00408a40
mov eax, dword [esp + 0x18]
add eax, 1
cmp eax, dword [esp + 0x20]
mov dword [esp + 0x18], eax
jl 0x40f790
push ebp
call fcn.0042fa10
mov al, byte [esp + 0x1b]
add esp, 4
jmp 0x40f9ca
mov dword [0x47de7c], 0x80000
mov byte [esp + 0x17], bl
push ebp
call fcn.0042fa10
mov al, byte [esp + 0x1b]
add esp, 4
jmp 0x40f9ca
lea esi, [esp + 0x24]
mov byte [esp + 0x17], bl
mov dword [esp + 0x50c], 0xffffffff
call fcn.00408a40
push ebp
call fcn.0042fa10
add esp, 4
mov al, bl
jmp 0x40f9ca
mov al, bl
mov ecx, dword [esp + 0x504]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x4e8]
xor ecx, esp
call fcn.0043c23a
add esp, 0x4fc
ret