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

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x5c
test ecx, ecx
mov dword [esp + 0x48], eax
mov dword [esp + 0x40], ecx
mov dword [esp + 0x34], edx
je 0x40e5e9
mov dword [esp + 0x24], edx
nop
mov edx, dword [esp + 0x40]
mov esi, dword [esp + 0x34]
mov eax, 0x20000
cmp edx, 0x20000
cmovbe eax, edx
mov ebx, eax
mov dword [esp + 0x38], eax
mov eax, esi
add eax, ebx
cmp ebx, 0xf
mov ecx, eax
mov dword [esp + 0x30], eax
jbe 0x40ea11
mov eax, edx
lea edx, [ebx - 4]
lea ebp, [esi + 1]
sub eax, 0x10
mov dword [esp + 0x28], esi
mov dword [esp + 0x1c], 0xffffffff
cmp eax, edx
cmova eax, edx
add eax, esi
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x74]
imul ebx, dword [esi + 1], 0x1e35a7bd
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0x70]
mov dword [esp + 0x2c], eax
mov eax, ecx
sub eax, 4
shr ebx, 0x17
mov dword [esp + 0x44], eax
mov eax, 0x20
lea esi, [eax + 1]
shr eax, 5
add eax, ebp
cmp dword [esp + 0x20], eax
jb 0x40e4f9
mov esi, esi
lea edi, [edi]
imul ecx, dword [eax], 0x1e35a7bd
mov edx, ebp
sub edx, dword [esp + 0x1c]
mov edi, dword [edx]
shr ecx, 0x17
cmp dword [ebp], edi
mov dword [esp + 0x18], ecx
jne 0x40e5f1
cmp ebp, edx
jbe 0x40e5f1
mov edi, ebp
sub edi, dword [esp + 0x24]
mov ecx, dword [esp + 0x78]
mov dword [ecx + ebx*4], edi
mov ebx, ebp
sub ebx, edx
cmp ebx, 0x3fff0
jle 0x40e621
mov ebp, eax
mov eax, esi
mov ebx, dword [esp + 0x18]
lea esi, [eax + 1]
shr eax, 5
add eax, ebp
cmp dword [esp + 0x20], eax
jae 0x40e4a0
mov eax, dword [esp + 0x30]
mov esi, dword [esp + 0x28]
cmp eax, esi
jbe 0x40e53d
mov ebx, eax
sub ebx, esi
cmp ebx, 5
ja 0x40e940
mov eax, dword [esp + 0x2c]
mov dword [eax], ebx
mov esi, dword [esp + 0x3c]
mov eax, dword [esp + 0x28]
mov dword [esp + 8], ebx
add dword [esp + 0x2c], 4
mov dword [esp + 4], eax
mov dword [esp], esi
call sub.msvcrt.dll_memcpy
mov eax, esi
add eax, ebx
mov dword [esp + 0x3c], eax
mov ebx, dword [esp + 0x3c]
sub ebx, dword [esp + 0x74]
mov esi, dword [esp + 0x38]
mov eax, dword [esp + 0x34]
mov ecx, ebx
mov edx, esi
call fcn.0040d2d0
test eax, eax
mov eax, dword [esp + 0x80]
mov ecx, dword [esp + 0x7c]
mov dword [esp], eax
je 0x40e924
mov eax, esi
xor edx, edx
call fcn.0040d140
mov eax, dword [esp + 0x7c]
mov esi, dword [esp + 0x80]
mov eax, dword [eax]
mov edx, eax
add eax, 0xd
shr edx, 3
movzx ecx, byte [esi + edx]
mov dword [esi + edx + 4], 0
mov dword [esi + edx], ecx
mov esi, dword [esp + 0x7c]
mov ecx, ebx
mov edx, dword [esp + 0x74]
mov dword [esi], eax
mov eax, dword [esp + 0x80]
mov dword [esp + 8], esi
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x2c]
sub eax, dword [esp + 0x70]
sar eax, 2
mov dword [esp + 4], eax
mov eax, dword [esp + 0x70]
mov dword [esp], eax
mov eax, dword [esp + 0x48]
call fcn.0040d4a0
mov esi, dword [esp + 0x38]
sub dword [esp + 0x40], esi
mov eax, dword [esp + 0x30]
mov dword [esp + 0x34], eax
jne 0x40e410
add esp, 0x5c
pop ebx
pop esi
pop edi
pop ebp
ret
mov edi, dword [esp + 0x78]
mov ecx, ebp
lea ebx, [edi + ebx*4]
mov edi, dword [esp + 0x24]
mov edx, dword [ebx]
sub ecx, edi
mov dword [ebx], ecx
add edx, edi
mov ebx, dword [edx]
cmp dword [ebp], ebx
jne 0x40e4e3
mov ebx, ebp
sub ebx, edx
cmp ebx, 0x3fff0
jg 0x40e4e3
mov ecx, dword [esp + 0x44]
lea eax, [ebp + 4]
cmp eax, ecx
ja 0x40ec2e
mov esi, dword [ebp + 4]
cmp dword [edx + 4], esi
mov esi, 0
je 0x40e648
jmp 0x40e652
mov edi, dword [edx + esi + 4]
cmp dword [eax], edi
jne 0x40e652
add eax, 4
add esi, 4
cmp eax, ecx
jbe 0x40e640
mov edi, dword [esp + 0x30]
cmp edi, eax
jbe 0x40e681
mov ecx, esi
sub ecx, eax
add ecx, edi
mov edi, eax
movzx eax, byte [eax]
sub edi, esi
cmp byte [edx + esi + 4], al
je 0x40e67a
jmp 0x40e681
movzx eax, byte [edi + esi]
cmp byte [edx + esi + 4], al
jne 0x40e681
add esi, 1
cmp esi, ecx
jne 0x40e670
lea eax, [esi + 4]
mov dword [esp + 0x4c], eax
add eax, ebp
sub ebp, dword [esp + 0x28]
mov dword [esp + 0x18], eax
cmp ebp, 5
ja 0x40ea88
mov eax, dword [esp + 0x2c]
mov dword [eax], ebp
mov edi, dword [esp + 0x3c]
mov eax, dword [esp + 0x28]
mov dword [esp + 8], ebp
mov dword [esp + 4], eax
mov dword [esp], edi
call sub.msvcrt.dll_memcpy
mov eax, edi
add eax, ebp
cmp dword [esp + 0x1c], ebx
mov dword [esp + 0x3c], eax
je 0x40eb69
lea edx, [ebx + 3]
bsr edi, edx
mov eax, edx
lea ecx, [edi - 1]
shr eax, cl
and eax, 1
lea edi, [eax + edi*2 + 0x4c]
add eax, 2
shl eax, cl
sub edx, eax
mov eax, dword [esp + 0x2c]
shl edx, 8
or edx, edi
lea edi, [eax + 8]
mov dword [eax + 4], edx
cmp dword [esp + 0x4c], 0xb
ja 0x40ea2e
lea eax, [edi + 4]
add esi, 0x18
mov dword [edi], esi
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x18]
cmp dword [esp + 0x20], eax
jbe 0x40ea7b
mov esi, dword [eax - 3]
mov edi, dword [eax + 1]
mov ecx, eax
sub ecx, dword [esp + 0x24]
mov ebp, dword [esp + 0x78]
mov eax, esi
shrd eax, edi, 8
imul edx, eax, 0x1e35a7bd
lea eax, [ecx - 2]
shr edx, 0x17
mov dword [ebp + edx*4], eax
lea edx, [ecx - 1]
imul eax, esi, 0x1e35a7bd
shrd esi, edi, 0x18
shr eax, 0x17
mov dword [ebp + eax*4], edx
imul edx, esi, 0x1e35a7bd
shr edx, 0x17
lea eax, [ebp + edx*4]
mov edx, dword [esp + 0x24]
add edx, dword [eax]
mov dword [eax], ecx
mov ecx, dword [esp + 0x18]
mov esi, ecx
sub esi, edx
cmp esi, 0x3fff0
mov dword [esp + 0x1c], esi
jg 0x40ec5a
mov eax, dword [ecx]
cmp dword [edx], eax
mov dword [esp + 0x28], ecx
jne 0x40eadf
mov eax, dword [esp + 0x44]
mov ebx, edx
mov edx, dword [esp + 0x28]
mov dword [esp + 0x18], eax
lea edi, [edx + 4]
cmp edi, dword [esp + 0x18]
mov eax, edi
ja 0x40e8fe
lea esi, [esi]
xor esi, esi
mov edx, dword [edx + 4]
cmp dword [ebx + 4], edx
jne 0x40e8fe
mov edx, dword [esp + 0x18]
jmp 0x40e7ce
mov edi, dword [ebx + ecx + 4]
cmp dword [eax], edi
jne 0x40e7d8
mov esi, ecx
add eax, 4
lea ecx, [esi + 4]
cmp eax, edx
jbe 0x40e7c4
cmp dword [esp + 0x30], eax
mov dword [esp + 0x18], edx
jbe 0x40e80c
movzx edx, byte [eax]
cmp byte [ebx + esi + 8], dl
jne 0x40e80c
mov esi, dword [esp + 0x30]
mov edi, dword [esp + 0x18]
jmp 0x40e7fe
movzx edx, byte [eax]
cmp byte [ebx + ecx + 4], dl
jne 0x40e808
add eax, 1
add ecx, 1
cmp esi, eax
ja 0x40e7f5
mov dword [esp + 0x18], edi
lea eax, [ecx + 4]
add dword [esp + 0x28], eax
cmp eax, 9
ja 0x40e971
add ecx, 0x2a
mov eax, dword [esp + 0x2c]
mov dword [eax], ecx
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x28]
lea ebx, [eax + 3]
bsr esi, ebx
mov eax, ebx
lea ecx, [esi - 1]
shr eax, cl
and eax, 1
lea esi, [eax + esi*2 + 0x4c]
add eax, 2
shl eax, cl
sub ebx, eax
mov eax, dword [esp + 0x2c]
shl ebx, 8
or ebx, esi
mov dword [eax + 4], ebx
add eax, 8
cmp dword [esp + 0x20], edx
mov dword [esp + 0x2c], eax
mov eax, edx
jbe 0x40e4f9
mov esi, dword [edx - 3]
sub eax, dword [esp + 0x24]
mov edi, dword [edx + 1]
mov ebp, dword [esp + 0x78]
imul ecx, esi, 0x1e35a7bd
lea ebx, [eax - 3]
shr ecx, 0x17
mov dword [ebp + ecx*4], ebx
mov ecx, esi
mov ebx, edi
shrd ecx, ebx, 8
imul ebx, ecx, 0x1e35a7bd
lea ecx, [eax - 2]
shr ebx, 0x17
mov dword [ebp + ebx*4], ecx
mov ecx, esi
mov ebx, edi
shrd ecx, ebx, 0x10
shrd esi, edi, 0x18
imul ebx, ecx, 0x1e35a7bd
lea ecx, [eax - 1]
shr ebx, 0x17
mov dword [ebp + ebx*4], ecx
mov ebx, dword [esp + 0x24]
imul ecx, esi, 0x1e35a7bd
shr ecx, 0x17
lea ecx, [ebp + ecx*4]
add ebx, dword [ecx]
mov dword [ecx], eax
mov eax, edx
sub eax, ebx
cmp eax, 0x3fff0
jg 0x40eae3
mov edi, dword [ebx]
cmp dword [edx], edi
jne 0x40eae3
mov edx, dword [esp + 0x28]
mov dword [esp + 0x1c], eax
lea edi, [edx + 4]
cmp edi, dword [esp + 0x18]
mov eax, edi
jbe 0x40e7b0
cmp dword [esp + 0x30], edi
jbe 0x40ec4c
mov esi, dword [esp + 0x28]
movzx edx, byte [ebx + 4]
xor ecx, ecx
cmp byte [esi + 4], dl
je 0x40e7eb
mov dword [esp + 0x28], edi
jmp 0x40e81c
mov edx, dword [esp + 0x38]
mov eax, dword [esp + 0x34]
call fcn.0040d270
jmp 0x40e5d3
cmp ebx, 0x81
ja 0x40e9d0
lea eax, [ebx - 2]
bsr ecx, eax
mov edx, eax
sub ecx, 1
shr edx, cl
lea esi, [edx + ecx*2 + 2]
shl edx, cl
sub eax, edx
shl eax, 8
or eax, esi
mov esi, dword [esp + 0x2c]
mov dword [esi], eax
jmp 0x40e518
cmp eax, 0x85
ja 0x40e9a0
lea eax, [ecx - 2]
bsr ecx, eax
mov ebx, eax
sub ecx, 1
shr ebx, cl
lea esi, [ebx + ecx*2 + 0x2c]
shl ebx, cl
sub eax, ebx
mov ecx, eax
mov eax, dword [esp + 0x2c]
shl ecx, 8
or esi, ecx
mov dword [eax], esi
jmp 0x40e825
cmp eax, 0x845
ja 0x40ea00
lea eax, [ecx - 0x42]
mov esi, 1
bsr ebx, eax
mov ecx, ebx
add ebx, 0x34
shl esi, cl
sub eax, esi
mov ecx, eax
mov eax, dword [esp + 0x2c]
shl ecx, 8
or ebx, ecx
mov dword [eax], ebx
jmp 0x40e825
cmp ebx, 0x841
ja 0x40eac0
lea eax, [ebx - 0x42]
mov edx, 1
bsr ecx, eax
shl edx, cl
add ecx, 0xa
sub eax, edx
shl eax, 8
or ecx, eax
mov eax, dword [esp + 0x2c]
mov dword [eax], ecx
jmp 0x40e518
sub ecx, 0x842
shl ecx, 8
or ecx, 0x3f
jmp 0x40e81f
mov eax, dword [esp + 0x74]
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0x70]
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x34]
mov dword [esp + 0x28], eax
jmp 0x40e4f9
cmp dword [esp + 0x4c], 0x47
jbe 0x40eb1e
cmp dword [esp + 0x4c], 0x87
ja 0x40eb7c
sub esi, 4
mov dword [edi + 4], 0x40
mov eax, esi
shl esi, 8
shr eax, 5
and esi, 0x1f00
add eax, 0x36
or eax, esi
mov dword [edi], eax
lea eax, [edi + 8]
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x18]
cmp dword [esp + 0x20], eax
ja 0x40e71a
mov eax, dword [esp + 0x18]
mov dword [esp + 0x28], eax
jmp 0x40e4f9
cmp ebp, 0x81
jbe 0x40eaf9
cmp ebp, 0x841
ja 0x40ebb8
lea edx, [ebp - 0x42]
mov eax, 1
bsr ecx, edx
shl eax, cl
add ecx, 0xa
sub edx, eax
mov eax, edx
shl eax, 8
or ecx, eax
mov eax, dword [esp + 0x2c]
mov dword [eax], ecx
jmp 0x40e6a1
cmp ebx, 0x1841
ja 0x40eb46
lea eax, [ebx - 0x842]
mov esi, dword [esp + 0x2c]
shl eax, 8
or eax, 0x15
mov dword [esi], eax
jmp 0x40e518
mov dword [esp + 0x1c], ebx
mov eax, dword [esp + 0x28]
imul ebx, dword [eax + 1], 0x1e35a7bd
lea ebp, [eax + 1]
shr ebx, 0x17
jmp 0x40e484
lea eax, [ebp - 2]
bsr ecx, eax
mov edx, eax
sub ecx, 1
shr edx, cl
lea edi, [edx + ecx*2 + 2]
shl edx, cl
sub eax, edx
shl eax, 8
or eax, edi
mov edi, dword [esp + 0x2c]
mov dword [edi], eax
jmp 0x40e6a1
sub esi, 4
bsr ecx, esi
mov eax, esi
sub ecx, 1
shr eax, cl
lea edx, [eax + ecx*2 + 0x1c]
shl eax, cl
sub esi, eax
lea eax, [edi + 4]
shl esi, 8
or edx, esi
mov dword [esp + 0x2c], eax
mov dword [edi], edx
jmp 0x40e70c
cmp ebx, 0x5841
ja 0x40ebdf
lea eax, [ebx - 0x1842]
mov esi, dword [esp + 0x2c]
shl eax, 8
or eax, 0x16
mov dword [esi], eax
jmp 0x40e518
mov eax, dword [esp + 0x2c]
mov dword [eax + 4], 0x40
lea edi, [eax + 8]
jmp 0x40e6f5
cmp dword [esp + 0x4c], 0x847
ja 0x40ec0d
sub esi, 0x44
mov eax, 1
mov dword [edi + 4], 0x40
bsr ecx, esi
shl eax, cl
add ecx, 0x34
sub esi, eax
mov eax, esi
shl eax, 8
or eax, ecx
mov dword [edi], eax
lea eax, [edi + 8]
mov dword [esp + 0x2c], eax
jmp 0x40e70c
cmp ebp, 0x1841
jbe 0x40ebf6
cmp ebp, 0x5841
ja 0x40ec35
lea eax, [ebp - 0x1842]
mov edi, dword [esp + 0x2c]
shl eax, 8
or eax, 0x16
mov dword [edi], eax
jmp 0x40e6a1
lea eax, [ebx - 0x5842]
mov esi, dword [esp + 0x2c]
shl eax, 8
or eax, 0x17
mov dword [esi], eax
jmp 0x40e518
lea eax, [ebp - 0x842]
mov edi, dword [esp + 0x2c]
shl eax, 8
or eax, 0x15
mov dword [edi], eax
jmp 0x40e6a1
lea eax, [esi - 0x844]
mov dword [edi + 4], 0x40
shl eax, 8
or eax, 0x3f
mov dword [edi], eax
lea eax, [edi + 8]
mov dword [esp + 0x2c], eax
jmp 0x40e70c
xor esi, esi
jmp 0x40e652
lea eax, [ebp - 0x5842]
mov edi, dword [esp + 0x2c]
shl eax, 8
or eax, 0x17
mov dword [edi], eax
jmp 0x40e6a1
mov dword [esp + 0x28], edi
mov ecx, 0x2a
jmp 0x40e81f
mov eax, dword [esp + 0x18]
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x28], eax
jmp 0x40eae3