Function at 0x413d84
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x1c
mov ecx, dword [0x52af50]
mov edx, dword [0x52af9c]
inc ecx
mov eax, dword [0x52af74]
mov dword [0x52af50], ecx
push ebx
mov ebx, dword [esp + 0x2c]
movzx eax, byte [edx + eax]
xor edx, edx
sub ecx, eax
push ebp
mov al, byte [ebx + 0xf52]
mov byte [esp + 0x30], al
mov eax, dword [0x52afd4]
push esi
movzx esi, byte [ebx]
push edi
mov edi, dword [0x52af80]
mov dword [esp + 0x10], ecx
mov ecx, dword [0x52af94]
movzx eax, word [eax + edi*2]
mov dword [esp + 0x28], eax
movzx eax, byte [ebx + 0x65a]
xor eax, 0xe99
mov dword [esp + 0x14], eax
mov eax, 0xda6
div dword [ecx + esi*4]
movzx ecx, byte [ebx + 0x1ce6]
xor edx, edx
mov dword [esp + 0x18], eax
movzx eax, byte [ebx + 0xbbc]
div ecx
mov esi, dword [0x52af70]
mov eax, 0x18b4
mov dword [esp + 0x24], edx
xor edx, edx
div esi
mov edx, dword [esp + 0x34]
mov dword [esp + 0x20], eax
lea ebp, [eax - 1]
cmp edi, dword [edx + ebp*4 + 8]
mov edi, dword [esp + 0x10]
jl 0x413e83
mov eax, dword [esp + 0x30]
mov ecx, 0x1af5
mov esi, dword [0x52afc4]
or cx, word [eax + 0x2c80]
mov word [0x52afa8], cx
mov ecx, dword [edx + esi*8 + 0x1c]
xor edx, edx
or ecx, dword [eax + ebp*8]
mov eax, dword [0x52afd4]
movzx eax, word [eax + ebp*8 + 0xc]
sub ecx, eax
xor dword [0x52af68], ecx
movzx eax, byte [edi + ebp]
div dword [0x52afac]
xor al, byte [ebx + ebp]
mov ebp, dword [esp + 0x20]
xor al, 0x39
mov byte [edi + esi*4], al
mov esi, dword [0x52af70]
mov eax, dword [0x52afbc]
xor edx, edx
mov dword [0x52afac], eax
dec ebp
mov eax, dword [0x52af9c]
movzx ecx, byte [eax + edi]
mov eax, dword [0x52af8c]
imul eax, ebp
div ecx
movzx ecx, byte [esp + 0x38]
mov eax, edx
imul ecx, ecx, 0x199f
xor edx, edx
movzx ecx, cx
div ecx
mov ecx, dword [0x52afc4]
movzx eax, dx
mov edx, ebp
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x34]
shl edx, 2
mov dword [esp + 0x38], edx
mov eax, dword [edx + eax]
xor edx, edx
div esi
movzx eax, byte [ebx]
mov esi, dword [esp + 0x30]
add eax, eax
add dl, byte [esi + eax*8]
mov eax, dword [0x52af9c]
add dl, byte [esi + eax*4]
mov eax, ebp
sub dl, byte [ecx + ebx + 4]
xor eax, 0x13d3
mov byte [ecx + ebx + 4], dl
movzx ecx, byte [ebx + ebp]
cdq
idiv ecx
mov ecx, dword [esp + 0x24]
mov edx, 0x97
mov byte [ebx + ebp], al
movzx eax, word [0x52af5c]
mov dword [esp + 0x34], edx
cmp dword [ecx + eax*4 + 0x2c], edx
jle 0x41403d
lea eax, [edi + ebp]
mov dword [esp + 0x20], 0x1c5
mov ebp, dword [esp + 0x14]
add dword [esp + 0x38], 4
inc eax
mov edi, dword [esp + 0x38]
mov dword [esp + 0x14], eax
mov eax, dword [0x52af7c]
mov ecx, dword [0x52af8c]
mov al, byte [edi + eax]
or al, byte [0x52afd0]
sub al, byte [edi + esi]
mov edi, dword [esp + 0x18]
add byte [ecx + edi], al
imul eax, dword [0x52afc4], 0xc
movzx ecx, byte [0x52af5f]
and ecx, edx
mov edi, dword [esp + 0x1c]
add esi, eax
mov eax, dword [0x52af9c]
movzx eax, byte [ebx + eax*2 + 3]
xor eax, ecx
mov ecx, dword [esp + 0x34]
cdq
idiv dword [esi]
mov dword [esi], edx
xor edx, edx
inc byte [0x52af5f]
movzx eax, byte [ebx + 0xf00]
movzx ecx, byte [ebp + ecx*2]
add eax, 0x1310
movzx esi, di
imul eax, esi
div ecx
mov eax, dword [esp + 0x14]
add byte [eax], dl
movzx eax, word [0x52af5c]
movzx ecx, byte [eax + ebp + 3]
mov eax, dword [esp + 0x34]
sub eax, ecx
mov ecx, dword [esp + 0x18]
cdq
idiv dword [0x52af50]
mov eax, dword [0x52af80]
mov dword [0x52afd0], edx
movzx ecx, byte [eax + ecx]
mov eax, dword [esp + 0x14]
movzx eax, byte [eax]
sub eax, ecx
add eax, esi
mov esi, dword [esp + 0x20]
cdq
movzx ecx, byte [esi + ebx + 4]
idiv ecx
inc edi
mov byte [esi + ebx + 4], dl
add esi, 3
dec byte [ebx]
mov edx, dword [esp + 0x34]
movzx eax, byte [ebx]
mov dword [esp + 0x1c], edi
mov edi, dword [esp + 0x10]
mov dword [esp + 0x20], esi
mov esi, dword [esp + 0x30]
mov cl, byte [edi + edx + 3]
and cl, byte [esp + 0x28]
inc edx
mov byte [eax + edi], cl
movzx eax, word [0x52af5c]
mov ecx, dword [esp + 0x24]
mov dword [esp + 0x34], edx
cmp edx, dword [ecx + eax*4 + 0x2c]
mov eax, dword [esp + 0x14]
jl 0x413f32
movzx eax, byte [ebx]
pop edi
pop esi
pop ebp
movzx eax, byte [eax + ebx]
add eax, dword [0x52afb4]
pop ebx
add esp, 0x1c
ret