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

Disassembly:
sub esp, 0x284
mov edx, dword [esp + 0x288]
push ebx
mov ebx, dword [edx + 0x60]
push ebp
mov ebp, dword [edx]
push esi
mov esi, dword [esp + 0x2a4]
mov al, byte [esi + 1]
test al, al
push edi
mov edi, dword [esp + 0x2ac]
mov dword [esp + 0x1c], ebp
mov dword [esp + 0x2c], edi
jns 0x40e7a2
xor eax, eax
mov ax, word [ebp + 0xea]
mov dword [esp + 0x18], eax
jmp 0x40e7ae
mov dword [esp + 0x18], 0
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x2a0]
movzx esi, word [esi]
add eax, 2
mov dword [esp + 0x14], eax
xor eax, eax
mov ax, word [ecx]
and esi, 0x7fff
mov dword [esp + 0x3c], esi
mov byte [edx + 0x94], 1
and eax, 0x7fff
mov dword [esp + 0x10], eax
add eax, ecx
cmp edi, eax
mov dword [esp + 0x34], eax
jae 0x40e7fb
mov eax, dword [ebp + 0x198]
test al, 1
lea eax, [eax + 1]
mov dword [ebp + 0x198], eax
jne 0x40e810
xor eax, eax
mov ax, word [ebp + 0xea]
lea eax, [eax + ecx + 2]
cmp edi, eax
jne 0x40ec43
mov edi, dword [esp + 0x1c]
mov ebp, dword [esp + 0x29c]
xor edx, edx
mov dx, word [edi + 0xea]
push ebx
lea ecx, [esp + 0x30]
push ecx
push edx
push ebp
call dword [ebp + 0x74]
mov eax, dword [esp + 0x3c]
xor ecx, ecx
mov cx, word [edi + 0xea]
push eax
push ecx
call fcn.00409660
mov edx, dword [esp + 0x2b0]
xor ecx, ecx
push ecx
push ebx
push ecx
push eax
push ebp
push edx
mov dword [esp + 0x68], eax
call fcn.00408e80
add esp, 0x30
test eax, eax
je 0x40f056
mov ecx, dword [esp + 0x1c]
mov edx, dword [esp + 0x2c]
xor eax, eax
mov ax, word [ecx + 0xea]
xor edi, edi
mov di, word [ebx]
lea ecx, [ebx + 2]
push eax
push ecx
sub edx, eax
push edx
and edi, 0x7fff
call fcn.0041bbb0
mov eax, dword [esp + 0x38]
mov edx, dword [esp + 0x2ac]
push eax
mov eax, dword [esp + 0x2a8]
lea ecx, [esp + 0x18c]
push ecx
push edx
push ebp
push eax
call fcn.0040a240
mov eax, dword [esp + 0x2c8]
lea ecx, [esi + eax]
push ecx
lea edx, [esp + 0x88]
push edx
push eax
mov eax, dword [esp + 0x2c4]
push ebp
push eax
call fcn.0040a240
mov eax, dword [esp + 0x48]
lea edx, [esp + 0x74]
push edx
lea edx, [esp + 0x1b4]
push edx
xor edx, edx
mov ecx, edi
sub ecx, eax
cmp esi, eax
sete dl
mov dword [esp + 0x6c], ecx
lea ecx, [eax + ebx]
lea eax, [esp + 0xa0]
dec edx
and edx, eax
push edx
push ecx
mov ecx, dword [esp + 0x5c]
push ecx
push ebp
call fcn.0040f760
mov ecx, dword [esp + 0x7c]
add esp, 0x4c
add eax, ecx
push ecx
add eax, esi
add eax, ebx
add edi, ebx
push edi
push eax
mov dword [esp + 0x30], eax
call fcn.00417b74
mov ecx, esi
mov esi, dword [esp + 0x2b4]
mov edx, ecx
shr ecx, 2
mov edi, ebx
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x48]
lea eax, [esp + 0x4c]
push eax
add ecx, ebx
push ecx
push ebp
call fcn.0040fa10
mov esi, dword [esp + 0x3c]
mov eax, dword [esp + 0x30]
mov edx, dword [esp + 0x4c]
mov edi, dword [esp + 0x34]
mov ecx, dword [esp + 0x2c4]
sub esi, ebx
neg eax
sbb eax, eax
and eax, 0x8000
push edx
mov dword [esp + 0x40], eax
add eax, esi
xor edx, edx
mov word [ebx], ax
mov dx, word [edi + 0xea]
lea eax, [esp + 0x198]
push eax
push ecx
push edx
push ebp
call fcn.0040f080
mov ecx, dword [esp + 0x3c]
mov dx, word [edi + 0xea]
sub ecx, eax
mov eax, dword [esp + 0x2cc]
add esp, 0x2c
neg dx
mov dword [esp + 0x10], ecx
sbb edx, edx
and edx, 0x8000
add edx, ecx
xor ecx, ecx
mov word [eax], dx
mov cx, word [ebp + 2]
cmp esi, ecx
ja 0x40ea05
mov edi, dword [esp + 0x2a8]
mov ecx, esi
mov edx, ecx
shr ecx, 2
mov esi, ebx
rep movsd dword es:[edi], dword [esi]
xor eax, eax
push eax
mov eax, dword [esp + 0x3c]
mov ecx, edx
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x2a0]
push ebp
push ecx
call fcn.00409000
add esp, 0x10
jmp 0x40ebf5
mov edx, dword [esp + 0x2ac]
mov esi, dword [esp + 0x298]
push edx
lea ecx, [esp + 0x180]
push ecx
push eax
push ebp
push esi
call fcn.0040a240
lea edx, [esp + 0x78]
push edx
push ebx
push ebp
push esi
call fcn.0040fae0
mov edi, dword [esp + 0x2cc]
mov dword [esp + 0x44], eax
sub eax, ebx
mov ecx, eax
mov edx, ecx
shr ecx, 2
mov esi, ebx
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
mov edx, dword [esp + 0x2cc]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x48]
add ecx, eax
mov eax, dword [esp + 0x34]
mov word [edx], cx
mov ecx, dword [esp + 0x2c4]
lea edi, [eax + ecx]
mov ecx, dword [esp + 0x3c]
lea edx, [esp + 0x88]
push edx
lea eax, [esp + 0x48]
push eax
push ecx
push ebp
call dword [ebp + 0x74]
mov edx, dword [esp + 0x6c]
mov ecx, dword [esp + 0x2cc]
push edx
lea eax, [esp + eax + 0x9c]
push eax
push ecx
call fcn.004096a0
mov esi, dword [esp + 0x2ec]
add esp, 0x40
lea edx, [esp + 0x40]
push edx
xor edx, edx
cmp esi, edi
sete dl
lea eax, [esp + 0x68]
push eax
lea ecx, [esp + 0x184]
push ecx
mov ecx, dword [esp + 0x28]
xor eax, eax
mov ax, word [ecx + 0xea]
dec edx
and edx, esi
push edx
push eax
push ebp
call fcn.0040f760
add esp, 0x18
test eax, eax
mov dword [esp + 0x30], eax
jl 0x40eaf4
mov edx, edi
sub edx, esi
push edx
push edi
add edi, eax
push edi
call fcn.00417b74
jmp 0x40eb04
sub edi, esi
add edi, eax
mov ecx, esi
push edi
sub ecx, eax
push ecx
push esi
call fcn.0041bbb0
add esp, 0xc
lea edx, [esp + 0x40]
push edx
push esi
push ebp
call fcn.0040fa10
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x3c]
mov esi, dword [esp + 0x24]
add eax, ecx
mov ecx, dword [esp + 0x28]
mov dx, word [ecx + 0xea]
add esp, 0xc
neg dx
mov dword [esp + 0x10], eax
sbb edx, edx
and edx, 0x8000
add edx, eax
test esi, esi
mov eax, dword [esp + 0x2a0]
mov word [eax], dx
je 0x40eb62
mov ecx, dword [esp + 0x20]
push esi
sub ecx, esi
push ecx
lea eax, [ebx + 2]
push eax
call fcn.0041bbb0
add esp, 0xc
lea edx, [esp + 0x64]
push edx
lea eax, [esp + 0x24]
push eax
push esi
push ebp
call dword [ebp + 0x74]
lea ecx, [esp + 0x50]
push ecx
lea edx, [esp + 0x78]
push edx
push 0
push 0
push esi
push ebp
call fcn.0040f760
mov edx, dword [esp + 0x3c]
mov edi, eax
mov eax, dword [esp + 0x48]
xor ecx, ecx
mov cl, byte [eax]
xor esi, esi
mov dword [esp + 0x74], ecx
mov si, word [ebx]
and esi, 0x7fff
sub esi, eax
add esi, ebx
push esi
push eax
lea eax, [edi + edx]
add eax, ebx
push eax
call fcn.0041bbb0
mov edx, dword [esp + 0x48]
lea ecx, [esp + 0x74]
push ecx
lea eax, [edx + ebx]
push eax
push ebp
call fcn.0040fa10
mov ecx, dword [esp + 0x54]
mov eax, dword [esp + 0x64]
mov edx, dword [esp + 0x78]
add eax, ecx
add eax, edi
add esp, 0x40
add eax, esi
mov word [ebx], ax
push ebx
xor eax, eax
push eax
mov eax, dword [esp + 0x2a0]
push edx
push ebp
push eax
call fcn.00408f10
add esp, 0x14
test eax, eax
jne 0x40f056
mov ecx, dword [esp + 0x2a8]
mov edx, dword [esp + 0x2a4]
push ecx
push eax
mov eax, dword [esp + 0x2a0]
push edx
push ebp
push eax
call fcn.00408f10
add esp, 0x14
test eax, eax
jne 0x40f056
mov edx, dword [esp + 0x10]
xor ecx, ecx
mov cx, word [ebp + 2]
pop edi
pop esi
pop ebp
pop ebx
shr ecx, 1
cmp ecx, edx
sbb eax, eax
inc eax
add esp, 0x284
ret
push edi
mov edi, dword [esp + 0x2a0]
lea eax, [esp + 0x180]
push eax
push ecx
push edi
push edx
call fcn.0040a240
xor ecx, ecx
mov cx, word [ebp + 0xea]
push eax
mov dword [esp + 0x2c4], eax
push ecx
call fcn.00409660
mov edx, dword [esp + 0x2b4]
xor ecx, ecx
push ecx
push ebx
push ecx
push eax
push edi
push edx
mov dword [esp + 0x6c], eax
call fcn.00408e80
add esp, 0x34
test eax, eax
je 0x40f056
mov ecx, dword [esp + 0x2a8]
mov edx, dword [esp + 0x2c]
xor eax, eax
mov ax, word [ebx]
add ecx, 2
and eax, 0x7fff
mov dword [esp + 0x28], eax
add eax, ebx
mov dword [esp + 0x24], eax
xor eax, eax
mov ax, word [ebp + 0xea]
push eax
push ecx
sub edx, eax
push edx
call fcn.0041bbb0
mov eax, dword [esp + 0x2b8]
mov dword [esp + 0x38], eax
xor eax, eax
mov ax, word [ebp + 0xea]
lea ecx, [esp + 0x188]
push ecx
lea edx, [esp + 0x3c]
push edx
push eax
push edi
call dword [edi + 0x74]
mov ecx, dword [esp + 0x40]
mov eax, dword [esp + 0x2b4]
push ecx
lea edx, [esp + 0x84]
push edx
push ebx
push edi
push eax
call fcn.0040a240
mov ebp, dword [esp + 0x44]
mov ecx, dword [esp + 0x2d8]
lea edx, [esp + 0x70]
push edx
xor edx, edx
cmp esi, ebp
sete dl
lea eax, [ecx + ebp]
lea ecx, [esp + 0x1b0]
push ecx
lea ecx, [esp + 0x9c]
mov dword [esp + 0x74], eax
dec edx
and edx, ecx
push edx
mov edx, dword [esp + 0x54]
push eax
push edx
push edi
call fcn.0040f760
mov ebp, eax
add esp, 0x48
test ebp, ebp
jl 0x40ed6b
mov edx, dword [esp + 0x14]
mov ecx, dword [esp + 0x3c]
mov eax, esi
sub eax, edx
mov edx, dword [esp + 0x28]
push eax
lea eax, [edx + ebx]
push ecx
add eax, ebp
jmp 0x40ed89
mov eax, dword [esp + 0x14]
mov edx, dword [esp + 0x28]
mov ecx, ebp
sub ecx, eax
add ecx, esi
push ecx
mov ecx, dword [esp + 0x2ac]
sub eax, ebp
add eax, ecx
push eax
lea eax, [edx + ebx]
push eax
call fcn.0041bbb0
mov ecx, dword [esp + 0x34]
add esp, 0xc
lea eax, [esp + 0x40]
push eax
lea eax, [ecx + ebx]
push eax
push edi
call fcn.0040fa10
sub ebp, dword [esp + 0x20]
mov ecx, dword [esp + 0x40]
add ebp, esi
mov esi, dword [esp + 0x34]
add esi, ebp
mov ebp, dword [esp + 0x24]
neg ebp
sbb ebp, ebp
mov edx, esi
push ecx
mov ecx, dword [esp + 0x2c]
and ebp, 0x8000
lea eax, [edx + ebp]
mov word [ebx], ax
xor eax, eax
mov ax, word [ecx + 0xea]
lea edx, [esp + 0x18c]
push edx
mov dword [esp + 0x3c], esi
mov esi, dword [esp + 0x2c0]
push esi
push eax
push edi
call fcn.0040f080
mov edx, dword [esp + 0x3c]
mov dx, word [edx + 0xea]
mov ecx, dword [esp + 0x30]
sub ecx, eax
mov eax, dword [esp + 0x2c0]
add esp, 0x20
neg dx
mov dword [esp + 0x10], ecx
sbb edx, edx
and edx, 0x8000
add edx, ecx
xor ecx, ecx
mov word [eax], dx
mov cx, word [edi + 2]
cmp dword [esp + 0x28], ecx
ja 0x40ee4f
mov edx, dword [esp + 0x2a4]
mov eax, dword [esp + 0x298]
push 0
push edx
push edi
push eax
call fcn.00409000
add esp, 0x10
jmp 0x40f036
mov edx, dword [esp + 0x298]
push esi
lea ecx, [esp + 0x180]
push ecx
push eax
push edi
push edx
call fcn.0040a240
mov ecx, dword [esp + 0x2ac]
lea eax, [esp + 0x78]
push eax
push ebx
push edi
push ecx
call fcn.0040fae0
mov ecx, dword [esp + 0x3c]
lea edx, [esp + 0x88]
push edx
mov dword [esp + 0x48], eax
mov dword [esp + 0x4c], eax
lea eax, [esp + 0x48]
push eax
push ecx
push edi
call dword [edi + 0x74]
mov edx, dword [esp + 0x2d8]
mov ecx, dword [esp + 0x2cc]
push edx
lea eax, [esp + eax + 0x9c]
push eax
push ecx
call fcn.004096a0
mov edx, dword [esp + 0x50]
mov eax, dword [esp + 0x2e0]
add eax, edx
add esp, 0x40
lea ecx, [esp + 0x40]
push ecx
lea edx, [esp + 0x68]
push edx
xor edx, edx
cmp esi, eax
sete dl
lea ecx, [esp + 0x184]
push ecx
mov ecx, dword [esp + 0x28]
mov dword [esp + 0x40], eax
xor eax, eax
mov ax, word [ecx + 0xea]
dec edx
and edx, esi
push edx
push eax
push edi
call fcn.0040f760
mov ecx, dword [esp + 0x4c]
add esp, 0x18
test eax, eax
mov dword [esp + 0x30], eax
jle 0x40ef1a
mov edx, ecx
sub edx, esi
push edx
push ecx
add ecx, eax
push ecx
call fcn.00417b74
jmp 0x40ef2a
sub ecx, esi
add ecx, eax
push ecx
mov ecx, esi
sub ecx, eax
push ecx
push esi
call fcn.0041bbb0
add esp, 0xc
lea edx, [esp + 0x40]
push edx
push esi
push edi
call fcn.0040fa10
mov edx, dword [esp + 0x3c]
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x28]
mov esi, dword [esp + 0x24]
add eax, edx
mov dx, word [ecx + 0xea]
add esp, 0xc
neg dx
mov dword [esp + 0x10], eax
sbb edx, edx
and edx, 0x8000
add edx, eax
test esi, esi
mov eax, dword [esp + 0x2a0]
mov word [eax], dx
je 0x40ef8f
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + 0x2a8]
push esi
sub ecx, esi
push ecx
lea eax, [edx + 2]
push eax
call fcn.0041bbb0
add esp, 0xc
lea eax, [esp + 0x64]
push eax
lea ecx, [esp + 0x24]
push ecx
push esi
push edi
call dword [edi + 0x74]
lea edx, [esp + 0x50]
push edx
lea eax, [esp + 0x78]
push eax
push 0
push 0
push esi
push edi
call fcn.0040f760
mov edx, dword [esp + 0x3c]
xor ecx, ecx
mov esi, eax
mov eax, dword [esp + 0x48]
mov cl, byte [eax]
mov dword [esp + 0x74], ecx
mov ecx, dword [esp + 0x50]
sub ecx, eax
add ecx, ebx
push ecx
push eax
lea eax, [esi + edx]
add eax, dword [esp + 0x2d8]
push eax
mov dword [esp + 0x64], ecx
call fcn.0041bbb0
mov edx, dword [esp + 0x70]
lea ecx, [esp + 0x74]
push ecx
push edx
push edi
call fcn.0040fa10
mov eax, dword [esp + 0x54]
mov edx, dword [esp + 0x70]
lea ecx, [eax + ebp]
mov eax, dword [esp + 0x2e8]
add esp, 0x40
push eax
add ecx, esi
mov esi, dword [esp + 0x28]
add ecx, edx
mov edx, dword [esp + 0x2a8]
push 0
push edx
mov word [eax], cx
mov eax, dword [esp + 0x2a4]
sub ebp, ebx
push edi
add ebp, esi
push eax
mov word [ebx], bp
call fcn.00408f10
add esp, 0x14
test eax, eax
jne 0x40f056
mov ecx, dword [esp + 0x38]
mov edx, dword [esp + 0x298]
push ebx
push eax
push ecx
push edi
push edx
call fcn.00408f10
add esp, 0x14
test eax, eax
je 0x40f064
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x284
ret
mov edx, dword [esp + 0x10]
xor eax, eax
mov ax, word [edi + 2]
pop edi
pop esi
pop ebp
pop ebx
shr eax, 1
cmp eax, edx
sbb eax, eax
inc eax
add esp, 0x284
ret