Function at 0x41af91
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x14
push ebx
push ebp
push esi
mov esi, ecx
push edi
xor edi, edi
mov dword [esp + 0x20], esi
mov ecx, dword [esi]
add ecx, 0x1000
mov dword [esi + 0x48], edi
mov dword [esi + 0x4c], edi
mov dword [esi + 0x50], edi
mov dword [esi + 0x54], edi
mov dword [esi + 0x58], edi
mov dword [esi + 0x5c], edi
call fcn.004185cd
mov ebx, 0x40000
mov dword [esi + 0x48], eax
mov ecx, ebx
call fcn.004185cd
mov dword [esi + 0x4c], eax
mov eax, dword [esi]
lea ecx, [eax*4 + 0x2000]
call fcn.004185cd
mov dword [esi + 0x50], eax
mov eax, dword [esi]
lea ecx, [eax*4 + 0x2000]
call fcn.004185cd
mov ecx, ebx
mov dword [esi + 0x54], eax
call fcn.004185cd
mov ecx, ebx
mov dword [esi + 0x58], eax
call fcn.004185cd
mov ebx, dword [esi + 0x48]
mov dword [esi + 0x5c], eax
test ebx, ebx
je 0x41b189
cmp dword [esi + 0x4c], edi
je 0x41b189
cmp dword [esi + 0x50], edi
je 0x41b189
cmp dword [esi + 0x54], edi
je 0x41b189
cmp dword [esi + 0x58], edi
je 0x41b189
test eax, eax
je 0x41b189
mov edx, dword [esi]
mov ebp, 0x800
mov dword [esi + 4], ebp
mov dword [esi + 8], ebp
lea ecx, [edx + 0x800]
lea eax, [ecx + 0x800]
mov dword [esi + 0x38], ecx
cmp eax, 0xffffffff
jb 0x41b067
xor eax, eax
inc eax
jmp 0x41b18c
mov dword [esi + 0x40], edx
lea eax, [ecx + ebx]
mov edx, 0x40000
mov dword [esi + 0x3c], eax
push edx
push edi
push dword [esi + 0x58]
call fcn.0041869b
push edx
push 0xffffffffffffffff
push dword [esi + 0x5c]
call fcn.0041869b
mov eax, dword [esi + 0x1c]
mov dword [esi + 0x2c], edi
mov dword [esi + 0x24], edi
mov dword [esi + 0x28], edi
mov ecx, dword [eax + 0x24]
mov edx, dword [eax + 0x1c]
sub ecx, edx
mov dword [esi + 0x30], edi
mov eax, edi
mov dword [esi + 0x44], edi
mov dword [esi + 0x14], ecx
je 0x41b0cd
cmp ecx, ebp
jbe 0x41b0b4
mov dword [esi + 0x14], ebp
mov ecx, ebp
push ecx
push edx
push dword [esi + 0x48]
call fcn.0041863c
mov eax, dword [esi + 0x1c]
mov ecx, dword [esi + 0x14]
add dword [eax + 0x1c], ecx
add dword [esi + 0x2c], ecx
mov eax, dword [esi + 0x2c]
cmp eax, dword [esi + 0x38]
jne 0x41b0d5
mov dword [esi + 0x2c], edi
cmp ecx, 2
jb 0x41b16f
mov edx, dword [esi + 0x28]
test edx, edx
je 0x41b16f
mov eax, dword [esi]
mov ebx, dword [esi + 0x54]
sub eax, edx
mov ebp, dword [esi + 0x48]
mov dword [esi + 0x40], eax
mov eax, dword [esi + 0x4c]
mov dword [esp + 0x10], eax
mov eax, dword [esi + 0x58]
mov dword [esp + 0x18], eax
mov eax, dword [esi + 0x5c]
mov dword [esp + 0x1c], eax
mov eax, dword [esi + 0x50]
sub eax, ebx
mov dword [esi + 0x44], edi
mov esi, eax
movzx ecx, byte [edi + ebp]
movzx eax, byte [edi + ebp + 1]
shl ecx, 5
xor ecx, eax
movzx eax, byte [edi + ebp + 2]
shl ecx, 5
xor ecx, eax
imul eax, ecx, 0x9f5f
shr eax, 5
movzx ecx, ax
mov eax, dword [esp + 0x10]
mov eax, dword [eax + ecx*4]
mov dword [esi + ebx], eax
mov eax, dword [esp + 0x10]
mov dword [eax + ecx*4], edi
mov eax, dword [esp + 0x18]
mov dword [ebx], 0x801
lea ebx, [ebx + 4]
inc dword [eax + ecx*4]
movzx eax, word [edi + ebp]
mov ecx, dword [esp + 0x1c]
mov dword [ecx + eax*4], edi
inc edi
sub edx, 1
jne 0x41b115
mov esi, dword [esp + 0x20]
mov eax, dword [esi + 0x44]
cmp eax, dword [esi + 0x40]
jb 0x41b17c
sub eax, dword [esi + 0x40]
jmp 0x41b182
sub eax, dword [esi + 0x40]
add eax, dword [esi + 0x38]
mov dword [esi + 0x34], eax
xor eax, eax
jmp 0x41b18c
push 3
pop eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret 4