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

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x64
mov eax, dword [esp + 0x7c]
mov esi, dword [esp + 0x78]
mov edi, edx
mov ebx, ecx
mov dword [esp + 0x10], eax
push 0x100
call 0x40b6c5
pop ecx
mov ebp, eax
mov edx, ebx
mov ecx, eax
push edi
call fcn.00409970
pop ecx
test eax, eax
jne 0x40b50f
mov ecx, ebx
mov edx, edi
push dword [esp + 0x80]
push ebp
push 0
call fcn.00429528
mov dword [esp], eax
mov dword [esp + 4], edx
xor edx, edx
xor eax, eax
mov ecx, str._..._begin___end_______when_slicing____
inc edx
cmp ebp, edi
setb al
cmovae ecx, edx
cmp esi, edi
lea eax, [eax + eax*4]
mov dword [esp + 8], ecx
mov dword [esp + 0xc], eax
ja 0x40b541
mov eax, dword [esp + 0x10]
cmp eax, edi
jbe 0x40b591
mov esi, eax
lea ecx, [esp + 0x44]
lea eax, [esp + 0x1c]
lea edx, [esp + 8]
mov dword [eax], ecx
mov dword [ecx], esi
mov ecx, esp
mov dword [eax + 4], fcn.00409c21
mov dword [eax + 8], ecx
mov ecx, fcn.00409991
mov dword [eax + 0xc], ecx
mov dword [eax + 0x10], edx
mov dword [eax + 0x14], ecx
lea ecx, [esp + 0x4c]
mov dword [ecx], str.byte_index__is_not_a_char_boundary__it_is_inside___bytes___of__
push 3
pop edx
mov dword [ecx + 4], edx
and dword [ecx + 0x10], 0
mov dword [ecx + 8], eax
mov dword [ecx + 0xc], edx
mov edx, dword [esp + 0x80]
call fcn.004291cb
cmp esi, eax
jbe 0x40b5d6
lea ecx, [esp + 0x78]
lea eax, [esp + 0x1c]
lea edx, [esp + 0x7c]
mov dword [eax], ecx
mov ecx, fcn.00409c21
mov dword [eax + 4], ecx
mov dword [eax + 8], edx
mov dword [eax + 0xc], ecx
mov ecx, esp
lea edx, [esp + 8]
mov dword [eax + 0x10], ecx
mov ecx, fcn.00409991
mov dword [eax + 0x14], ecx
mov dword [eax + 0x18], edx
mov dword [eax + 0x1c], ecx
lea ecx, [esp + 0x4c]
mov dword [ecx], 0x42bf44
push 4
jmp 0x40b577
test esi, esi
je 0x40b5e4
cmp esi, edi
jae 0x40b5e4
cmp byte [ebx + esi], 0xc0
jl 0x40b5e6
mov esi, eax
mov dword [esp + 0x14], esi
mov ecx, ebx
mov edx, edi
push esi
call 0x40b6c5
pop ecx
mov esi, dword [esp + 0x80]
mov ebp, eax
mov ecx, ebx
mov edx, edi
push esi
push eax
call fcn.0040b4a3
pop ecx
pop ecx
lea edi, [esp + 0x1c]
add edx, eax
mov ecx, edi
mov dword [edi], eax
mov dword [edi + 4], edx
call fcn.0040f224
cmp eax, 0x110000
jne 0x40b62b
mov ecx, esi
call fcn.00429466
cmp eax, 0x80
mov ecx, 1
mov dword [esp + 0x18], eax
jb 0x40b652
cmp eax, 0x800
jae 0x40b647
push 2
pop ecx
jmp 0x40b652
cmp eax, 0x10000
push 4
pop ecx
sbb ecx, 0
lea eax, [esp + 0x44]
add ecx, ebp
mov dword [eax], ebp
mov dword [eax + 4], ecx
lea ecx, [esp + 0x14]
mov dword [esp + 0x1c], ecx
lea ecx, [esp + 0x18]
mov dword [esp + 0x20], fcn.00409c21
mov dword [esp + 0x24], ecx
mov dword [esp + 0x28], 0x40b1e4
mov dword [esp + 0x2c], eax
mov eax, esp
mov dword [esp + 0x30], 0x40a364
lea ecx, [esp + 8]
mov dword [esp + 0x34], eax
mov eax, fcn.00409991
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], ecx
lea ecx, [esp + 0x4c]
mov dword [esp + 0x40], eax
mov dword [ecx], str.byte_index__is_not_a_char_boundary__it_is_inside___bytes___of__
push 5
pop eax
mov dword [ecx + 4], eax
and dword [ecx + 0x10], 0
mov edx, esi
mov dword [ecx + 8], edi
mov dword [ecx + 0xc], eax
call fcn.004291cb
push edi
push esi
mov esi, dword [esp + 0xc]
cmp edx, esi
jbe 0x40b6f9
mov eax, ecx
mov ecx, esi
xor edx, edx
sub ecx, 3
cmovb ecx, edx
lea edx, [esi + 1]
cmp ecx, edx
ja 0x40b6fe
add edx, eax
add esi, eax
sub edx, eax
sub edx, ecx
test edx, edx
je 0x40b6f7
dec edx
cmp byte [esi], 0xc0
lea esi, [esi - 1]
jl 0x40b6ea
add edx, ecx
mov eax, edx
pop esi
pop edi
ret
push 0x42d7c8
call fcn.004293a5