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

Disassembly:
sub esp, 0xdc
cmp dword [esp + 0xf0], 0
push ebx
push esi
push edi
push ebp
push 0xb0
je 0x4076d5
mov ebx, 0
call fcn.0040f5c0
add esp, 4
test eax, eax
je 0x4076b3
mov ecx, eax
call fcn.0040f600
mov ebx, eax
lea ecx, [esp + 0x28]
call fcn.00422530
lea ecx, [esp + 0x28]
mov dword [esp + 0x30], ebx
mov word [esp + 0x34], 0
mov dword [esp + 0x28], 0x4caf30
jmp 0x40770f
mov ebx, 0
call fcn.0040f5c0
add esp, 4
test eax, eax
je 0x4076ef
mov ecx, eax
call fcn.00406c00
mov ebx, eax
lea ecx, [esp + 0x28]
call fcn.00422530
lea ecx, [esp + 0x28]
mov dword [esp + 0x30], ebx
mov word [esp + 0x34], 0
mov dword [esp + 0x28], 0x4caf30
call fcn.004225b0
mov ebp, dword [esp + 0xfc]
test byte [ebp], 0x40
je 0x40774d
push 0x20
mov ecx, ebp
call fcn.00407610
push eax
lea eax, [esp + 0x78]
push eax
call fcn.00407460
add esp, 0xc
mov ecx, ebp
push 0
call fcn.004075f0
lea ecx, [esp + 0x2c]
push eax
lea eax, [esp + 0x78]
push eax
jmp 0x407776
lea eax, [esp + 0x70]
push eax
push 0x3c
push 0xd
call dword [0x4e7750]
push eax
call dword [0x4e7774]
mov eax, dword [esp + 0x70]
push 0
lea ecx, [esp + 0x90]
push eax
push ecx
lea ecx, [esp + 0x34]
lea edi, [ebx + 0x68]
call fcn.004a1a40
mov esi, eax
mov ecx, 0x12
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
call fcn.00406d20
mov ecx, eax
movzx eax, cx
mov dword [esp + 0x10], eax
movsx eax, word [ebp + 0xe]
imul eax, dword [esp + 0x10]
cdq
shr ecx, 0x10
and edx, 3
add eax, edx
sar eax, 2
mov dword [esp + 0x28], eax
movzx eax, cx
mov dword [esp + 0x14], eax
movsx eax, word [ebp + 0x10]
imul eax, dword [esp + 0x14]
cdq
and edx, 7
add eax, edx
mov edx, dword [esp + 0x28]
sar eax, 3
mov dword [esp + 0x70], edx
cmp dword [esp + 0x100], 0
mov dword [esp + 0x74], eax
jne 0x407808
push 7
mov esi, dword [0x4e7b78]
call esi
add eax, eax
push 8
add eax, dword [esp + 0x2c]
mov dword [esp + 0x74], eax
call esi
lea edi, [eax*2]
push 4
call esi
add edi, eax
add dword [esp + 0x74], edi
push 0x40
mov ecx, ebp
call fcn.004075c0
push eax
lea eax, [esp + 0xb4]
push eax
call fcn.00407460
movsx eax, word [ebp + 0xa]
imul eax, dword [esp + 0x1c]
movsx ecx, word [ebp + 0xc]
cdq
add esp, 0xc
and edx, 3
add eax, edx
sar eax, 2
mov dword [esp + 0x28], eax
mov eax, ecx
imul eax, dword [esp + 0x14]
cdq
and edx, 7
add eax, edx
lea edx, [esp + 0xac]
sar eax, 3
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x70]
mov ecx, dword [ebp]
push ecx
push edx
mov ecx, dword [esp + 0x7c]
mov edx, dword [esp + 0x30]
push ecx
push eax
mov eax, dword [esp + 0x3c]
mov ecx, dword [esp + 0x108]
push eax
push edx
mov edx, dword [esp + 0x10c]
push ecx
mov eax, dword [esp + 0x10c]
push edx
push eax
mov ecx, ebx
call fcn.00406c60
push 0xffff
mov ecx, dword [ebx + 0x52]
push ecx
xor edi, edi
mov ecx, ebx
call fcn.00407a70
mov ecx, ebp
call fcn.00407630
mov di, word [ebp + 8]
mov esi, eax
mov eax, edi
dec edi
test eax, eax
je 0x407a40
movsx eax, word [esi + 8]
movsx ecx, word [esi + 0xa]
imul eax, dword [esp + 0x10]
imul ecx, dword [esp + 0x14]
cdq
and edx, 3
add eax, edx
sar eax, 2
mov dword [esp + 0x20], eax
mov eax, ecx
cdq
and edx, 7
mov ecx, esi
add eax, edx
sar eax, 3
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x20]
mov edx, dword [esp + 0x24]
mov dword [esp + 0x70], eax
mov dword [esp + 0x74], edx
movsx eax, word [esi + 0xc]
imul eax, dword [esp + 0x10]
cdq
and edx, 3
add eax, edx
sar eax, 2
mov dword [esp + 0x18], eax
movsx eax, word [esi + 0xe]
imul eax, dword [esp + 0x14]
cdq
and edx, 7
add eax, edx
sar eax, 3
mov dword [esp + 0x1c], eax
call fcn.004071d0
cmp eax, 0x7da
jne 0x4079cf
mov ecx, esi
call fcn.00407480
movsx ax, byte [eax]
cmp ax, 0xff
je 0x407963
push 0x40
mov ecx, esi
call fcn.00407480
push eax
lea eax, [esp + 0x30]
push eax
call fcn.004bf100
lea ebp, [esp + 0x34]
add esp, 0xc
jmp 0x40796c
mov ecx, esi
call fcn.00407480
mov ebp, eax
push 0x40
mov ecx, esi
call fcn.004074e0
push eax
lea eax, [esp + 0xb4]
push eax
call fcn.00407460
mov edx, dword [esp + 0x28]
add esp, 0xc
mov eax, dword [0x4e2084]
push 0
mov ecx, dword [eax + 0xba]
xor eax, eax
mov ax, word [esi + 0x10]
push ecx
push eax
mov ecx, dword [ebx + 0x52]
mov eax, dword [esp + 0x24]
push ecx
mov ecx, dword [esp + 0x84]
push edx
mov edx, dword [esp + 0x84]
push eax
push ecx
mov eax, dword [esi]
lea ecx, [esp + 0xc8]
push edx
push eax
push ecx
push ebp
push 0
call dword [0x4e7b54]
jmp 0x407a2c
push 1
push eax
call fcn.00416f00
add esp, 8
call dword [eax + 4]
mov ebp, eax
push 0x40
mov ecx, esi
call fcn.004074e0
push eax
lea eax, [esp + 0xb4]
push eax
call fcn.00407460
lea ecx, [esp + 0xb8]
mov edx, dword [esp + 0x24]
add esp, 0xc
mov eax, dword [esi]
push eax
xor eax, eax
mov ax, word [esi + 0x10]
push eax
push ecx
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x30]
push eax
push edx
mov edx, dword [esp + 0x34]
push ecx
push edx
mov eax, dword [ebp]
push ebx
mov ecx, ebp
push ebx
call dword [eax + 0x160]
mov ecx, esi
call fcn.00407530
mov esi, eax
mov eax, edi
dec edi
test eax, eax
jne 0x4078b9
mov eax, ebx
pop ebp
pop edi
pop esi
pop ebx
add esp, 0xdc
ret