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

Disassembly:
sub esp, 0xa0
push ebx
push ebp
push esi
push edi
mov edi, ecx
xor ebx, ebx
mov dword [esp + 0x10], edi
mov dword [esp + 0x18], ebx
mov ebp, dword [edi + 0x1c]
mov dword [esp + 0x20], 1
test ebp, ebp
je 0x40ef72
lea eax, [esp + 0x4c]
mov dword [esp + 0x2c], eax
jmp 0x40eab9
mov edi, dword [esp + 0x10]
mov ebx, dword [esp + 0x18]
mov eax, dword [ebp + 0xc]
xor esi, esi
cmp eax, esi
jne 0x40ef57
cmp ebx, 8
mov dword [esp + 0x20], esi
mov dword [esp + 0x1c], esi
jge 0x40eaf6
mov ecx, edi
call fcn.0040e55e
mov esi, eax
test esi, esi
mov dword [esp + 0x1c], esi
je 0x40eaf6
mov eax, dword [esp + 0x2c]
inc ebx
mov dword [esp + 0x18], ebx
mov dword [eax], esi
add eax, 4
mov dword [esp + 0x2c], eax
mov eax, dword [ebp + 0x1c]
mov dword [esp + 0x14], esi
mov dword [esp + 0x28], eax
mov eax, dword [eax]
mov ecx, eax
mov edx, eax
sar ecx, 2
and dl, 2
and ecx, 3
neg dl
sbb edx, edx
and al, 1
neg edx
inc edx
mov edi, dword [ecx*4 + 0x44748c]
neg al
sbb eax, eax
mov ecx, edi
neg eax
inc eax
mov dword [esp + 0x44], edi
imul edx, eax
mov eax, dword [esp + 0x10]
mov dword [esp + 0x24], edx
mov ebx, dword [eax + 0x28]
mov eax, dword [ebp + 0x74]
sar ebx, cl
test eax, eax
je 0x40ece9
mov ecx, dword [esp + 0xb4]
test ebx, ebx
mov dword [ebp + ecx*4 + 0x7c], 0
jle 0x40ec6c
mov esi, dword [ebp + 0x104]
cmp ebx, esi
jge 0x40eb6b
mov esi, ebx
test esi, esi
jle 0x40ebf3
mov al, byte [ebp + 0x10e]
test al, al
je 0x40eba2
mov eax, dword [esp + 0x14]
test eax, eax
je 0x40ebb3
mov ecx, esi
mov edi, dword [esp + 0x14]
imul ecx, dword [esp + 0x24]
mov edx, ecx
xor eax, eax
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
jmp 0x40ebb3
mov ecx, dword [ebp + 0x124]
mov edx, dword [esp + 0x14]
push esi
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov al, byte [ebp + 0x10f]
test al, al
jne 0x40ebc8
mov eax, dword [esp + 0xb4]
add dword [ebp + eax*4 + 0x7c], esi
mov eax, dword [esp + 0x14]
test eax, eax
je 0x40ebe1
mov eax, esi
mov ecx, dword [esp + 0x14]
imul eax, dword [esp + 0x24]
add ecx, eax
mov dword [esp + 0x14], ecx
mov eax, dword [ebp + 0x104]
sub ebx, esi
sub eax, esi
mov dword [ebp + 0x104], eax
jmp 0x40ec64
push ebp
call dword [ebp + 0x74]
add esp, 4
test eax, eax
mov eax, dword [ebp + 0x104]
sete cl
test eax, eax
mov byte [ebp + 0x10f], cl
jg 0x40ec5d
mov al, byte [ebp + 0x10c]
test al, al
je 0x40ec47
mov eax, dword [ebp + 0x108]
mov byte [ebp + 0x10c], 0
test eax, eax
jge 0x40ec54
mov edx, eax
mov dword [ebp + 0x108], 0
neg edx
mov dword [ebp + 0x104], edx
mov byte [ebp + 0x10e], 1
jmp 0x40ec64
mov eax, dword [esp + 0x28]
mov ecx, dword [eax + 4]
mov dword [ebp + 0x104], ecx
mov byte [ebp + 0x10e], 1
jmp 0x40ec64
mov byte [ebp + 0x10e], 0
test ebx, ebx
jg 0x40eb5f
mov al, byte [ebp + 0x10d]
test al, al
je 0x40edce
mov edi, dword [esp + 0x10]
mov byte [ebp + 0x10d], 0
xor edx, edx
mov dword [esp + 0x6c], 2
mov eax, dword [edi + 0x28]
mov dword [esp + 0x70], edx
cmp eax, 0x2b11
mov word [esp + 0x76], dx
mov word [esp + 0x74], dx
mov dword [esp + 0x78], eax
jl 0x40ecb3
mov dword [esp + 0x78], 0x2b11
mov esi, dword [esp + 0x1c]
mov ecx, 0x8000
cmp esi, edx
mov word [esp + 0x7e], cx
mov word [esp + 0x7c], cx
je 0x40ee60
lea ecx, [esp + 0x6c]
push ecx
push edx
mov edx, dword [ebp + 0x1c]
push eax
push esi
mov eax, dword [edx]
push eax
call fcn.0040fb2e
add esp, 0x14
jmp 0x40edd2
test ebx, ebx
jle 0x40edd2
mov esi, dword [ebp + 0x118]
mov ecx, dword [ebp + 0x114]
sub esi, ecx
cmp ebx, esi
jge 0x40ed05
mov esi, ebx
test esi, esi
jg 0x40ed48
mov ecx, dword [ebp + 0x68]
dec ecx
mov eax, ecx
mov dword [ebp + 0x68], ecx
test eax, eax
jle 0x40ed8c
mov edx, dword [ebp + 0x6c]
mov ecx, edi
sar edx, cl
mov ecx, dword [ebp + 0x124]
push 1
mov dword [ebp + 0x114], edx
mov edx, dword [esp + 0x2c]
mov eax, dword [ecx]
push edx
call dword [eax]
mov ecx, dword [ebp + 0x124]
mov edx, dword [ebp + 0x114]
push edx
push 0
mov eax, dword [ecx]
call dword [eax + 4]
mov ecx, dword [ebp + 0x124]
mov edx, dword [esp + 0x14]
push esi
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [esp + 0x14]
test eax, eax
je 0x40ed72
mov eax, esi
mov ecx, dword [esp + 0x14]
imul eax, dword [esp + 0x24]
add ecx, eax
mov dword [esp + 0x14], ecx
mov ecx, dword [ebp + 0x114]
sub ebx, esi
add ecx, esi
test ebx, ebx
mov dword [ebp + 0x114], ecx
jg 0x40ecf1
jmp 0x40edce
mov eax, dword [esp + 0x14]
test eax, eax
je 0x40edc7
mov edx, dword [esp + 0x28]
mov ecx, ebx
imul ecx, dword [esp + 0x24]
mov eax, dword [edx]
mov edi, dword [esp + 0x14]
not eax
and eax, 2
mov edx, ecx
shl eax, 6
mov bl, al
mov bh, bl
mov eax, ebx
shl eax, 0x10
mov ax, bx
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov dword [ebp + 0xc], 1
mov esi, dword [esp + 0x1c]
test esi, esi
je 0x40ee5c
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x44]
mov edx, dword [esp + 0x1c]
lea edi, [esp + 0x48]
mov esi, dword [eax + 0x28]
sar esi, cl
mov ecx, dword [esp + 0x24]
dec esi
imul esi, ecx
mov ebx, ecx
add esi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebp + 0x11c]
test ecx, ecx
jne 0x40ee31
mov ecx, ebx
mov esi, edx
lea edi, [ebp + 0x120]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov dword [ebp + 0x11c], 1
mov ecx, dword [eax]
lea esi, [ebp + 0x120]
push esi
mov eax, dword [eax + 0x28]
push ecx
mov ecx, dword [esp + 0x30]
mov ecx, dword [ecx]
and cl, 0xf
push ecx
push eax
push edx
call fcn.0040f79e
mov ecx, dword [esp + 0x5c]
add esp, 0x14
mov dword [esi], ecx
mov esi, dword [esp + 0x1c]
mov edi, dword [esp + 0x10]
mov ecx, dword [ebp + 0x20]
lea eax, [ebp + 0x20]
test ecx, ecx
jle 0x40ee97
test esi, esi
je 0x40ee86
mov edx, dword [ebp + 0x110]
mov ecx, dword [edi]
push eax
mov eax, dword [edi + 0x28]
push edx
push eax
push esi
push ecx
call fcn.0040fb2e
add esp, 0x14
mov edx, dword [edi + 0x28]
mov eax, dword [ebp + 0x110]
add eax, edx
mov dword [ebp + 0x110], eax
test esi, esi
je 0x40ef57
mov eax, dword [ebp + 0x14]
test eax, eax
je 0x40ef57
mov ebx, dword [eax + 0x58]
mov esi, dword [eax + 0x5c]
mov eax, dword [eax + 0x1c]
add ebx, 0x2c
mov edi, dword [eax + 0x1ac]
mov eax, 0x64
mov dword [esp + 0x30], eax
mov dword [esp + 0x40], eax
mov dword [esp + 0x34], eax
add edi, 0xaf8
xor eax, eax
cmp esi, ebx
mov dword [esp + 0x3c], eax
mov dword [esp + 0x38], eax
je 0x40ef1b
mov ecx, dword [esi + 0x10]
xor eax, eax
mov al, byte [ecx + 0xa]
cmp eax, 0x62
je 0x40eef8
cmp eax, 6
je 0x40eef8
cmp eax, 0x61
jne 0x40ef14
mov edx, dword [esi + 0x20]
lea eax, [esp + 0x30]
add edx, 0xa8
lea ecx, [esp + 0x30]
push edx
push eax
push ecx
call fcn.0040e86e
add esp, 0xc
mov esi, dword [esi + 4]
cmp esi, ebx
jne 0x40eee1
lea edx, [esp + 0x30]
push edi
lea eax, [esp + 0x34]
push edx
push eax
call fcn.0040e86e
mov ecx, dword [esp + 0x1c]
lea edx, [esp + 0x3c]
push edx
mov eax, dword [ecx]
mov edx, dword [ecx + 0x28]
push eax
sar eax, 2
and eax, 3
mov ecx, dword [eax*4 + 0x44748c]
mov eax, dword [esp + 0x30]
sar edx, cl
push edx
push eax
call fcn.0040e95e
add esp, 0x1c
mov ebp, dword [ebp + 4]
test ebp, ebp
jne 0x40eab1
mov eax, dword [esp + 0x20]
mov edi, dword [esp + 0x10]
test eax, eax
je 0x40ef77
mov ebx, dword [esp + 0x18]
inc dword [edi + 0x24]
jmp 0x40ef82
mov ebx, dword [esp + 0x18]
mov dword [edi + 0x24], 0
mov eax, dword [edi]
mov edx, dword [esp + 0xb4]
mov ecx, eax
mov edx, dword [edi + edx*4 + 0x3c]
not ecx
test cl, 2
je 0x40f0bb
test ebx, ebx
jne 0x40efc1
mov eax, dword [esp + 0x10]
mov ecx, dword [eax + 0x38]
mov eax, 0x80808080
mov edi, edx
mov edx, ecx
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
jmp 0x40f1c8
cmp ebx, 1
jne 0x40efe6
mov eax, dword [esp + 0x10]
mov esi, dword [esp + 0x4c]
mov edi, edx
mov ecx, dword [eax + 0x38]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
jmp 0x40f1c8
cmp ebx, 2
jne 0x40f039
mov esi, dword [esp + 0x4c]
mov edi, dword [edi + 0x34]
test al, 1
mov ecx, edx
je 0x40effa
add edi, edi
mov eax, edi
dec edi
test eax, eax
je 0x40f1c8
mov edx, dword [esp + 0x50]
sub edx, esi
inc edi
xor eax, eax
xor ebx, ebx
mov al, byte [edx + esi]
mov bl, byte [esi]
inc esi
lea eax, [eax + ebx - 0x80]
test eax, 0xffff00
je 0x40f02e
test eax, eax
setge al
dec eax
and al, 1
add eax, 0xff
mov byte [ecx], al
inc ecx
dec edi
jne 0x40f00c
jmp 0x40f1c8
mov ebx, dword [esp + 0x18]
lea esi, [esp + 0x4c]
mov ecx, ebx
lea edi, [esp + 0x4c]
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [esp + 0x10]
mov ebp, edx
shl ebx, 7
mov ecx, dword [ecx + 0x34]
mov edx, 0x80
sub edx, ebx
test al, 1
je 0x40f062
add ecx, ecx
mov eax, ecx
dec ecx
test eax, eax
je 0x40f1c8
inc ecx
mov dword [esp + 0x20], ecx
mov edi, dword [esp + 0x18]
mov ecx, edx
lea eax, [esp + edi*4 + 0x48]
mov esi, dword [eax]
xor ebx, ebx
sub eax, 4
mov bl, byte [esi]
add ecx, ebx
inc esi
mov dword [eax + 4], esi
dec edi
test edi, edi
ja 0x40f07c
test ecx, 0xffff00
je 0x40f0a7
test ecx, ecx
setge cl
dec ecx
and cl, 1
add ecx, 0xff
mov eax, dword [esp + 0x20]
mov byte [ebp], cl
inc ebp
dec eax
mov dword [esp + 0x20], eax
jne 0x40f072
jmp 0x40f1c8
test ebx, ebx
jne 0x40f0cd
mov eax, dword [esp + 0x10]
mov ecx, dword [eax + 0x38]
xor eax, eax
jmp 0x40efac
cmp ebx, 1
jne 0x40f0f2
mov eax, dword [esp + 0x10]
mov esi, dword [esp + 0x4c]
mov edi, edx
mov ecx, dword [eax + 0x38]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
jmp 0x40f1c8
cmp ebx, 2
jne 0x40f14f
mov esi, dword [esp + 0x4c]
mov edi, dword [edi + 0x34]
test al, 1
mov ecx, edx
je 0x40f106
add edi, edi
mov eax, edi
dec edi
test eax, eax
je 0x40f1c8
mov ebp, dword [esp + 0x50]
sub ebp, esi
inc edi
movsx eax, word [esi + ebp]
movsx edx, word [esi]
add eax, edx
add esi, 2
movsx edx, ax
cmp edx, eax
je 0x40f144
xor edx, edx
test eax, eax
setge dl
dec edx
and edx, 0xffff0001
add edx, 0x7fff
mov word [ecx], dx
jmp 0x40f147
mov word [ecx], ax
add ecx, 2
dec edi
jne 0x40f118
jmp 0x40f1c8
mov ebx, dword [esp + 0x18]
lea esi, [esp + 0x4c]
mov ecx, ebx
lea edi, [esp + 0x4c]
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [esp + 0x10]
mov edi, edx
test al, 1
mov ecx, dword [ecx + 0x34]
je 0x40f16e
add ecx, ecx
mov edx, ecx
dec ecx
test edx, edx
je 0x40f1c8
inc ecx
mov dword [esp + 0x20], ecx
xor esi, esi
lea eax, [esp + ebx*4 + 0x48]
lea edx, [ebx]
mov ecx, dword [eax]
sub eax, 4
movsx ebp, word [ecx]
add ecx, 2
add esi, ebp
mov dword [eax + 4], ecx
dec edx
test edx, edx
ja 0x40f182
movsx eax, si
cmp eax, esi
je 0x40f1b7
xor ecx, ecx
test esi, esi
setge cl
dec ecx
and ecx, 0xffff0001
add ecx, 0x7fff
mov word [edi], cx
jmp 0x40f1ba
mov word [edi], si
mov eax, dword [esp + 0x20]
add edi, 2
dec eax
mov dword [esp + 0x20], eax
jne 0x40f17a
mov edx, dword [esp + 0x10]
pop edi
pop esi
pop ebp
mov dword [edx + 0xc0], 0
pop ebx
add esp, 0xa0
ret 4