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

Disassembly:
push ebx
push ebp
mov ebp, dword [esp + 0xc]
push edi
mov ebx, dword [ebp + 8]
mov edi, dword [ebx + 0x4c]
cmp byte [ebx + 0x1d], 2
mov dword [esp + 0x10], edi
mov dword [ebx + 0x4c], 0xfffffffd
ja 0x40f884
lea eax, [ebx + 0x24]
mov dword [ebx + 0x2c], 0
mov dword [ebx + 0x28], eax
mov dword [ebx + 0x30], 0
mov dword [ebx + 0x34], 0
mov byte [ebx + 0x1d], 3
mov dword [ebx + 0x20], 0
push esi
mov al, byte [ebx + 0x1d]
cmp al, 3
je 0x40f894
cmp al, 4
jne 0x40fa41
mov esi, dword [ebp + 8]
movzx eax, byte [esi + 0x1d]
cmp eax, 5
ja case.default.0x40f8a0
jmp dword [eax*4 + 0x40fa74]
mov eax, dword [esi + 0x74]
mov dword [esi + 0x2c], 0
mov dword [esi + 0x30], 0
mov dword [esi + 0x34], 0
test byte [eax + 4], 3
je 0x40f8d2
push eax
push esi
call fcn.0040eac0
mov eax, dword [esi + 0x74]
add esp, 8
mov eax, dword [eax + 0x24]
test byte [eax + 4], 3
je 0x40f8e5
push eax
push esi
call fcn.0040eac0
add esp, 8
mov eax, dword [esi + 0x7c]
add eax, 4
cmp eax, 0xfffffff6
jbe 0x40f903
mov eax, dword [esi + 0x78]
test byte [eax + 4], 3
je 0x40f903
push eax
push esi
call fcn.0040eac0
add esp, 8
push esi
call fcn.0040eb60
add esp, 4
mov byte [esi + 0x1d], 1
jmp case.default.0x40f8a0
cmp dword [esi + 0x2c], 0
je 0x40f929
push esi
call fcn.0040fbe0
add esp, 4
jmp case.default.0x40f8a0
mov byte [esi + 0x1d], 2
jmp case.default.0x40f8a0
cmp dword [esi + 0xe0], 0
jne case.default.0x40f8a0
push ebp
push esi
call fcn.0040e6e0
add esp, 8
mov byte [esi + 0x1d], 3
mov dword [esi + 0x20], 0
jmp case.default.0x40f8a0
mov ecx, dword [esi + 0x20]
mov edi, dword [esi + 0x14]
push 0xffffffffffffffff
lea eax, [ecx + 1]
mov dword [esi + 0x20], eax
mov eax, dword [esi]
lea eax, [eax + ecx*4]
push eax
push esi
call fcn.0040f080
mov eax, dword [esi + 0x20]
add esp, 0xc
cmp eax, dword [esi + 4]
jbe 0x40f982
mov byte [esi + 0x1d], 4
mov eax, dword [esi + 0x14]
sub eax, edi
add dword [esi + 0x40], eax
jmp case.default.0x40f8a0
mov edi, dword [esi + 0x14]
push 0x28
push dword [esi + 0x28]
push esi
call fcn.0040f080
mov ecx, dword [esi + 0x14]
add esp, 0xc
sub ecx, edi
mov dword [esi + 0x28], eax
add dword [esi + 0x40], ecx
cmp dword [eax], 0
jne case.default.0x40f8a0
mov ecx, dword [esi + 4]
mov eax, ecx
shr eax, 2
cmp dword [esi + 8], eax
ja 0x40f9d5
cmp ecx, 0x1ff
jbe 0x40f9d5
shr ecx, 1
push ecx
push ebp
call fcn.004102e0
add esp, 8
cmp dword [esi + 0x38], 0
je 0x40fa31
mov word [esi + 0x1d], 0x105
jmp case.default.0x40f8a0
cmp dword [esi + 0x38], 0
je 0x40fa19
cmp dword [esi + 0xe0], 0
jne case.default.0x40f8a0
push ebp
call fcn.0040e9d0
mov eax, dword [esi + 0x40]
add esp, 4
cmp eax, 0x64
jbe case.default.0x40f8a0
add eax, 0xffffff9c
mov dword [esi + 0x40], eax
jmp case.default.0x40f8a0
cmp byte [esi + 0x1e], 0
jne 0x40fa31
mov eax, dword [esi + 0xe4]
push dword [eax + 0x14]
push ebp
call fcn.00410c30
add esp, 8
mov byte [esi + 0x1d], 0
mov dword [esi + 0x3c], 0
jmp case.default.0x40f8a0
mov byte [ebx + 0x1d], 0
pop esi
push ebp
call fcn.0040ec20
add esp, 4
cmp byte [ebx + 0x1d], 0
jne 0x40fa46
mov eax, 0x51eb851f
mul dword [ebx + 0x40]
mov eax, dword [esp + 0x10]
shr edx, 5
imul edx, dword [ebx + 0x48]
pop edi
pop ebp
mov dword [ebx + 0x18], edx
mov dword [ebx + 0x4c], eax
pop ebx
ret