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

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff8
sub esp, 0x90
mov esi, dword [ebp + 8]
mov edi, dword [esi]
mov eax, dword [esi + 8]
lea ecx, [esp + 0x48]
push 9
push 0x5fdbea
mov dword [esp + 0x10], eax
push eax
push edi
push ecx
call fcn.00428f40
add esp, 0x14
mov eax, dword [esp + 0x78]
mov ebx, dword [esp + 0x7c]
cmp dword [esp + 0x48], 0
mov dword [esp + 0xc], edi
mov dword [esp + 0x14], eax
mov dword [esp + 4], ebx
je 0x50901b
mov edx, dword [esp + 0x68]
mov ecx, dword [esp + 0x84]
mov eax, edx
mov dword [esp + 0x10], ecx
sub eax, ecx
cmp eax, ebx
jae 0x509026
mov dword [esp + 0x20], edx
mov edx, dword [esp + 0x5c]
mov ecx, dword [esp + 0x10]
mov esi, dword [esp + 0x60]
mov edi, dword [esp + 0x80]
cmp edx, ecx
mov ebx, ecx
mov dword [esp + 0x3c], esi
mov dword [esp + 0x28], edx
cmova ebx, edx
cmp dword [esp + 0x6c], 0xffffffff
mov dword [esp + 0x30], ebx
mov ebx, dword [esp + 0x50]
mov dword [esp + 0x1c], ebx
mov ebx, dword [esp + 0x54]
mov dword [esp + 0x34], ebx
je 0x50913d
mov esi, dword [esp + 0x14]
mov edx, dword [esp + 0x70]
mov ebx, ecx
neg ebx
mov dword [esp + 0x24], ebx
mov ebx, eax
sub esi, ecx
mov dword [esp + 0x18], edx
mov dword [esp + 0x2c], esi
mov esi, dword [esp + 0x20]
mov eax, dword [esp + 0x14]
mov edx, 1
movzx ecx, byte [eax + ebx]
xor eax, eax
shld eax, edx, cl
shl edx, cl
test cl, 0x20
mov ecx, 0
cmovne eax, edx
cmovne edx, ecx
and eax, dword [esp + 0x34]
and edx, dword [esp + 0x1c]
or edx, eax
jne 0x508f5c
nop
mov eax, dword [esp + 0x24]
add eax, ebx
cmp eax, dword [esp + 4]
jae 0x509026
mov eax, dword [esp + 0x2c]
mov esi, ebx
mov edx, 1
sub ebx, dword [esp + 0x10]
movzx ecx, byte [eax + esi]
xor eax, eax
shld eax, edx, cl
shl edx, cl
test cl, 0x20
mov ecx, 0
cmovne eax, edx
cmovne edx, ecx
and eax, dword [esp + 0x34]
and edx, dword [esp + 0x1c]
or edx, eax
je 0x508f10
mov eax, dword [esp + 0x10]
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x28]
mov edx, dword [esp + 0x18]
mov ecx, dword [esp + 0x14]
mov dword [esp], ebx
cmp eax, edx
lea ecx, [ecx + ebx]
cmovb edx, eax
dec edx
nop word cs:[eax + eax]
nop
cmp edx, 0xffffffff
je 0x508fbe
cmp edx, dword [esp + 0x10]
jae 0x5096bb
mov eax, dword [esp]
add eax, edx
cmp eax, dword [esp + 4]
jae 0x5096c6
movzx ebx, byte [edi + edx]
lea eax, [edx - 1]
cmp bl, byte [ecx + edx]
mov edx, eax
je 0x508f80
sub esi, dword [esp + 0x28]
lea esi, [esi + eax + 1]
mov eax, dword [esp + 0x10]
mov dword [esp + 0x18], eax
jmp 0x50900b
mov eax, dword [esp + 0x28]
mov ebx, dword [esp + 0x18]
cmp ebx, eax
cmovbe ebx, eax
nop dword [eax + eax]
cmp ebx, eax
je 0x509305
cmp dword [esp + 0x30], eax
je 0x5096e1
mov edx, dword [esp]
add edx, eax
cmp edx, dword [esp + 4]
jae 0x5096f3
movzx edx, byte [edi + eax]
cmp dl, byte [ecx + eax]
lea eax, [eax + 1]
je 0x508fd0
mov eax, dword [esp + 0x3c]
sub esi, eax
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x10]
mov ebx, esi
sub ebx, eax
cmp ebx, dword [esp + 4]
jb 0x508ee0
jmp 0x509026
cmp byte [esp + 0x56], 0
je 0x5090f9
mov edx, dword [esp + 0xc]
mov esi, dword [ebp + 8]
mov dword [esp + 4], 0
xor edi, edi
mov ebx, dword [esi + 4]
mov ecx, dword [esp + 8]
cmp ebx, ecx
jbe 0x50906e
mov eax, dword [0x607460]
test ecx, ecx
mov eax, dword [eax]
je 0x509072
push ecx
push edx
push 0
push eax
call sub.KERNEL32.dll_HeapReAlloc
test eax, eax
jne 0x509080
push dword [esp + 8]
push 1
call fcn.0041a8c0
add esp, 8
jmp 0x509817
mov eax, edx
jmp 0x509080
push edx
push 0
push eax
call sub.KERNEL32.dll_HeapFree
mov eax, 1
mov dword [esp + 0x48], 0
mov dword [esp + 0x4c], eax
mov eax, dword [esp + 8]
mov esi, dword [0x607460]
mov dword [esp + 0x50], eax
mov eax, dword [esp + 4]
mov dword [esp + 0x54], edi
mov dword [esp + 0x58], eax
mov eax, dword [0x607474]
movzx eax, byte [eax]
mov eax, dword [esi]
test eax, eax
jne 0x5090c3
call sub.KERNEL32.dll_GetProcessHeap
test eax, eax
je 0x50980b
mov dword [esi], eax
push 0x14
push 0
push eax
call sub.KERNEL32.dll_HeapAlloc
test eax, eax
je 0x50980b
mov ecx, dword [esp + 0x58]
mov dword [eax + 0x10], ecx
movsd xmm0, qword [esp + 0x48]
movsd xmm1, qword [esp + 0x50]
movsd qword [eax + 8], xmm1
movsd qword [eax], xmm0
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret
mov eax, dword [esp + 0x50]
movzx ebx, byte [esp + 0x55]
test eax, eax
je 0x50928c
cmp eax, dword [esp + 4]
mov dword [esp], eax
jae 0x509297
mov edi, dword [esp + 0x14]
cmp byte [edi + eax], 0xc0
jge 0x5092a1
mov edx, 0x5fcfa0
xor ebx, ebx
mov dword [esp + 0xc], edi
mov eax, dword [esp + 4]
mov dword [esp + 8], eax
jmp 0x5097f0
lea ebx, [edx - 1]
lea edx, [edi + edx - 1]
mov dword [esp + 0x24], edi
mov edi, dword [esp + 0x20]
mov esi, ecx
cmp ebx, ecx
mov dword [esp + 0x38], ebx
mov ebx, dword [esp + 0x14]
mov dword [esp + 0x44], edx
setb byte [esp + 0x18]
neg esi
mov dword [esp + 0x40], esi
sub ebx, ecx
mov dword [esp + 0x2c], ebx
mov ebx, eax
mov eax, dword [esp + 0x14]
movzx ecx, byte [eax + ebx]
nop word [eax + eax]
xor eax, eax
mov edx, 1
shld eax, edx, cl
shl edx, cl
test cl, 0x20
mov ecx, 0
cmovne eax, edx
cmovne edx, ecx
and eax, dword [esp + 0x34]
and edx, dword [esp + 0x1c]
or edx, eax
jne 0x5091d0
lea eax, [esi + ebx]
cmp eax, dword [esp + 4]
jae 0x509026
mov eax, dword [esp + 0x2c]
mov edi, ebx
sub ebx, dword [esp + 0x10]
movzx ecx, byte [eax + edi]
jmp 0x509180
test byte [esp + 0x18], 1
mov dword [esp + 0x20], edi
mov dword [esp], ebx
je 0x509222
mov eax, dword [esp]
mov ecx, dword [esp + 0x38]
mov esi, dword [esp + 0x20]
lea edx, [ecx + eax]
mov ecx, dword [esp + 0x44]
mov eax, dword [esp + 0x28]
nop word cs:[eax + eax]
nop
sub eax, 1
jb 0x50922d
cmp edx, dword [esp + 4]
jae 0x5096d3
movzx ebx, byte [ecx]
mov edi, dword [esp + 0x14]
dec esi
dec ecx
cmp bl, byte [edi + edx]
lea edx, [edx - 1]
je 0x509200
jmp 0x509271
cmp dword [esp + 0x28], 0
jne 0x50982a
mov eax, dword [esp]
mov ecx, dword [esp + 0x14]
mov esi, dword [ebp + 8]
add eax, ecx
mov ecx, dword [esp + 0x28]
nop dword [eax]
cmp dword [esp + 0x30], ecx
je 0x509305
mov edx, dword [esp]
add edx, ecx
cmp edx, dword [esp + 4]
jae 0x5096f6
mov edx, dword [esp + 0x24]
movzx edx, byte [edx + ecx]
cmp dl, byte [eax + ecx]
lea ecx, [ecx + 1]
je 0x509240
mov esi, dword [esp + 0x20]
sub esi, dword [esp + 0x3c]
mov ebx, esi
mov edi, esi
mov esi, dword [esp + 0x40]
sub ebx, dword [esp + 0x10]
cmp ebx, dword [esp + 4]
jb 0x50916f
jmp 0x509026
xor edx, edx
test bl, bl
jne 0x509308
jmp 0x509026
mov edi, dword [esp + 0x14]
jne 0x509125
movzx ecx, byte [edi + eax - 1]
test cl, cl
jns 0x5092fd
movzx edx, byte [edi + eax - 2]
cmp dl, 0xbf
jg 0x5092dc
mov byte [esp + 0x1c], bl
movzx ebx, byte [edi + eax - 3]
cmp bl, 0xbf
mov dword [esp + 0x10], ebx
jg 0x5092e1
movzx eax, byte [edi + eax - 4]
mov esi, dword [esp + 0x10]
and eax, 7
and esi, 0x3f
shl eax, 6
or esi, eax
jmp 0x5092e8
and edx, 0x1f
jmp 0x5092f5
mov esi, dword [esp + 0x10]
and esi, 0xf
movzx ebx, byte [esp + 0x1c]
shl esi, 6
and edx, 0x3f
or edx, esi
shl edx, 6
and ecx, 0x3f
or ecx, edx
test bl, bl
je 0x5094ef
mov edx, dword [esp]
mov edi, dword [esp + 8]
mov ecx, dword [esp + 0xc]
lea esi, [edx + 9]
mov dword [esp], edx
mov dword [esp + 0x24], esi
lea eax, [edi - 0x11]
add ecx, edx
mov dword [esp + 0x1c], eax
mov eax, edx
mov dword [esp + 4], ecx
xor ecx, ecx
sub eax, edi
sub edi, edx
mov edx, esi
add edi, 0xfffffff7
nop word cs:[eax + eax]
nop
mov edx, dword [esp]
lea ebx, [edx + ecx]
lea edx, [eax + ecx]
mov dword [esp + 0x10], edx
mov edx, dword [esp + 8]
cmp ebx, 0xfffffff7
mov dword [esp + 0x14], ebx
je 0x50938d
mov edx, dword [esp]
lea edx, [edx + ecx + 9]
cmp dword [esp + 8], edx
mov ebx, edx
jbe 0x509380
mov edx, dword [esp + 4]
cmp byte [edx + ecx + 9], 0xc0
jl 0x5097e4
mov edx, dword [esp + 8]
sub edx, esi
jmp 0x50938d
cmp dword [esp + 0x10], 0xfffffff7
mov edx, edi
jne 0x5097e4
test edx, edx
je 0x5093a7
mov edx, dword [esp + 4]
movzx edx, byte [edx + ecx + 9]
add dl, 0xd0
cmp dl, 0xa
jae 0x5093a7
inc esi
inc ecx
dec edi
jmp 0x509340
mov eax, dword [esp]
cmp dword [esp + 0x14], 0xfffffff7
mov esi, dword [ebp + 8]
lea ebx, [eax + ecx + 9]
mov eax, dword [esp + 8]
je 0x5093e2
cmp dword [esp + 8], ebx
jbe 0x5093d9
mov eax, dword [esp + 4]
cmp byte [eax + ecx + 9], 0xc0
mov eax, edi
jge 0x5093e2
mov edx, 0x5fdc98
jmp 0x5097e9
cmp dword [esp + 0x10], 0xfffffff7
mov eax, edi
jne 0x5093cf
cmp eax, 8
jae 0x5093fa
xor edi, edi
mov dword [esp + 4], 0
mov edx, dword [esp + 0xc]
jmp 0x509037
mov edi, dword [esp + 4]
mov eax, 0x6c6f6320
mov edx, 0x206e6d75
xor eax, dword [edi + ecx + 9]
xor edx, dword [edi + ecx + 0xd]
or edx, eax
mov edx, dword [esp + 0xc]
je 0x509427
xor edi, edi
mov dword [esp + 4], 0
jmp 0x509037
mov eax, dword [esp]
sub dword [esp + 0x1c], ecx
lea edi, [ecx + 0x11]
lea edx, [ecx + edx + 0x11]
mov dword [esp + 0x28], ebx
mov dword [esp + 0x34], 0
lea esi, [eax + ecx + 0x11]
neg eax
mov dword [esp + 0x2c], eax
mov eax, esi
mov dword [esp + 0x20], esi
mov ebx, dword [esp]
mov esi, dword [esp + 8]
add ebx, edi
je 0x50949f
nop dword [eax]
cmp dword [esp + 8], ebx
jbe 0x509480
mov esi, dword [esp]
cmp byte [edx + esi], 0xc0
jl 0x509819
mov esi, dword [esp + 8]
sub esi, eax
jmp 0x50949f
mov esi, dword [esp + 0x1c]
cmp dword [esp], esi
jne 0x509819
mov dword [esp + 0x30], eax
mov esi, dword [esp + 0x1c]
mov eax, dword [esp + 0x2c]
add esi, eax
mov eax, dword [esp + 0x30]
test esi, esi
mov dword [esp + 0x30], ebx
je 0x5094ce
mov esi, dword [esp]
movzx ebx, byte [edx + esi]
add bl, 0xd0
cmp bl, 0xa
jae 0x5094ce
dec dword [esp + 0x1c]
inc dword [esp + 0x34]
inc eax
inc edi
inc edx
mov ebx, dword [esp]
mov esi, dword [esp + 8]
add ebx, edi
jne 0x509460
jmp 0x50949f
add edi, dword [esp]
cmp dword [esp + 8], edi
mov eax, edi
mov dword [esp + 0x18], edi
jbe 0x509559
mov esi, dword [ebp + 8]
mov dword [esp + 4], 0
xor edi, edi
jmp 0x5093f1
cmp ecx, 0x110000
je 0x509026
mov eax, 0xffffffff
cmp ecx, 0x80
jb 0x509523
mov eax, 0xfffffffe
cmp ecx, 0x800
jb 0x509523
xor eax, eax
cmp ecx, 0x10000
setb al
or eax, 0xfffffffc
mov edx, dword [esp]
add edx, eax
je 0x5095b5
cmp edx, dword [esp + 4]
jae 0x5095fe
mov ecx, dword [esp + 0x14]
cmp byte [ecx + edx], 0xc0
jge 0x509608
mov dword [esp], edx
mov edx, 0x5fcfa0
xor ebx, ebx
mov dword [esp + 0xc], ecx
jmp 0x509130
mov eax, dword [esp + 0x24]
mov ebx, dword [esp + 0x28]
mov esi, dword [ebp + 8]
mov edx, 0x5fdcb8
cmp ebx, eax
jb 0x5095a9
test eax, eax
je 0x50958d
cmp eax, dword [esp + 8]
jae 0x50958b
mov eax, dword [esp + 0xc]
mov edi, dword [esp + 0x24]
cmp byte [eax + edi], 0xc0
mov eax, dword [esp + 0x24]
jge 0x50958d
jmp 0x5095a9
jne 0x5095a9
cmp dword [esp + 0x14], 0xfffffff7
je 0x5095c3
cmp dword [esp + 8], ebx
jbe 0x5095bc
mov eax, dword [esp + 4]
cmp byte [eax + ecx + 9], 0xc0
mov eax, dword [esp + 0x24]
jge 0x5095c3
mov ecx, ebx
mov ebx, eax
mov dword [esp], ecx
jmp 0x5097f0
xor edx, edx
jmp 0x509308
cmp dword [esp + 0x10], 0xfffffff7
jne 0x5095a9
test ecx, ecx
je 0x5095eb
mov edx, dword [esp + 0xc]
add eax, edx
mov edi, eax
movzx eax, byte [eax]
cmp eax, 0x2b
je 0x50961f
cmp eax, 0x2d
jne 0x509630
cmp ecx, 1
mov ebx, ecx
mov eax, edi
je 0x509418
jmp 0x509634
mov edx, dword [esp + 0xc]
xor edi, edi
mov dword [esp + 4], 0
jmp 0x509037
mov ecx, dword [esp + 0x14]
jne 0x509546
cmp byte [ecx + edx - 1], 0
jns 0x509308
cmp byte [ecx + edx - 2], 0xbf
mov eax, edx
jmp 0x509308
cmp ecx, 1
je 0x509418
mov eax, edi
lea ebx, [ecx - 1]
inc eax
jmp 0x509634
mov ebx, ecx
mov eax, edi
cmp ebx, 9
jae 0x50965d
xor edx, edx
mov edi, eax
movzx eax, byte [eax]
add eax, 0xffffffd0
cmp eax, 9
ja 0x5093e7
lea edx, [edx + edx*4]
inc edi
dec ebx
lea edx, [eax + edx*2]
mov eax, edi
jne 0x50963b
jmp 0x50971d
xor edi, edi
test ebx, ebx
je 0x50971b
movzx esi, byte [eax]
mov dword [esp + 0x2c], ebx
mov ebx, eax
mov eax, edi
mov edx, 0xa
mov edi, dword [esp + 0x24]
mul edx
seto dl
add esi, 0xffffffd0
cmp esi, 0xa
cmovb edi, esi
mov dword [esp + 0x24], edi
jae 0x5094dd
test dl, dl
jne 0x5094dd
mov edi, eax
mov eax, ebx
mov ebx, dword [esp + 0x2c]
mov edx, dword [esp + 0xc]
inc eax
dec ebx
add edi, dword [esp + 0x24]
mov dword [esp + 0x24], esi
mov esi, dword [ebp + 8]
jae 0x50965f
jmp 0x50902d
mov eax, dword [esp + 0x10]
mov ecx, 0x5fcf30
jmp 0x5096ee
mov edx, eax
mov eax, dword [esp + 4]
mov ecx, 0x5fcf40
jmp 0x5096ee
mov esi, dword [ebp + 8]
mov eax, dword [esp + 4]
mov ecx, 0x5fcf40
jmp 0x50970b
mov edx, dword [esp + 0x30]
mov eax, dword [esp + 0x10]
mov ecx, 0x5fcf10
mov esi, dword [ebp + 8]
jmp 0x50970b
mov esi, dword [ebp + 8]
mov edx, dword [esp]
mov eax, dword [esp + 4]
mov ecx, 0x5fcf20
add edx, dword [esp + 0x28]
cmp eax, edx
cmova edx, eax
push ecx
push eax
push edx
call fcn.00425270
add esp, 0xc
jmp 0x509817
mov edx, edi
mov eax, dword [esp + 0x20]
mov edi, edx
mov edx, 0x5fdcc8
cmp dword [esp + 0x18], eax
jb 0x509820
cmp dword [esp + 0x14], 0xffffffef
je 0x50975e
mov eax, dword [esp + 0x20]
cmp eax, dword [esp + 8]
jae 0x509753
mov eax, dword [esp + 4]
cmp byte [ecx + eax + 0x11], 0xc0
jge 0x50975e
jmp 0x509820
cmp dword [esp + 0x10], 0xffffffef
jne 0x509820
cmp dword [esp + 0x30], 0
je 0x509772
mov eax, dword [esp + 0x1c]
cmp dword [esp], eax
jne 0x509820
mov eax, dword [esp + 4]
lea eax, [ecx + eax + 0x11]
push dword [esp + 0x34]
push eax
lea eax, [esp + 0x50]
push eax
call fcn.0042b050
add esp, 0xc
cmp byte [esp + 0x48], 0
jne 0x5093e7
mov eax, dword [esp]
mov ecx, dword [esp + 0x4c]
mov edx, dword [esp + 0xc]
cmp dword [esp + 8], eax
mov dword [esp + 4], ecx
jb 0x509037
test eax, eax
je 0x5097d8
cmp dword [esp + 8], eax
jbe 0x5097d6
cmp byte [edx + eax], 0xc0
jge 0x5097d8
push 0x5fcf90
push 0x30
push str.assertion_failed:_self.is_char_boundary_new_len_K
call fcn.004251d0
add esp, 0xc
jmp 0x509817
jne 0x5097c0
mov dword [esi + 8], eax
mov dword [esp + 8], eax
jmp 0x509037
mov edx, 0x5fdc88
mov eax, dword [esp + 8]
mov dword [esp], eax
push edx
push dword [esp + 4]
push ebx
push dword [esp + 0x14]
push dword [esp + 0x1c]
mov esi, dword [ebp + 8]
call fcn.004297c0
add esp, 0x14
jmp 0x509817
push 0x14
push 4
call fcn.0041a8c0
add esp, 8
ud2
mov edx, 0x5fdca8
jmp 0x5097e9
mov ebx, dword [esp + 0x20]
mov eax, dword [esp + 0x18]
jmp 0x5097ed
mov edx, dword [esp + 0x38]
mov eax, dword [esp + 0x10]
mov ecx, 0x5fcf30
jmp 0x5096ee