Function at 0x403b70
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x1c
imul eax, dword [0x52afc4], 6
xor edx, edx
mov ecx, dword [esp + 0x2c]
push ebx
push ebp
push esi
mov esi, dword [esp + 0x48]
push edi
movzx eax, word [eax + ecx + 0x16]
mov ecx, 0x1ef2
div ecx
xor edx, edx
mov byte [esp + 0x13], al
mov al, byte [esp + 0x54]
or al, 0x77
mov byte [esp + 0x12], al
mov al, byte [esp + 0x5c]
movzx ecx, al
dec al
mov byte [esp + 0x5c], al
mov eax, dword [0x52af9c]
mov dword [esp + 0x18], ecx
mov ecx, 0x8c1
div ecx
mov eax, dword [0x52af58]
dec dword [esi]
mov ecx, dword [esi]
mov dword [esp + 0x1c], eax
mov eax, dword [0x52af64]
movzx edi, word [0x52afa8]
mov dword [esp + 0x28], edx
mov edx, dword [0x52af9c]
mov eax, dword [eax + ecx*4 + 0x8c]
imul ecx, dword [0x52af6c], 6
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x44]
movzx ebp, word [ecx + eax]
movzx eax, word [0x52afc8]
sub ebp, dword [esi + edx*8]
inc edx
mov cl, byte [esp + 0x12]
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x40]
mov dword [0x52af9c], edx
mov dword [esp + 0x20], ebp
mov ebx, dword [eax + 0x674c]
mov eax, dword [0x52af7c]
xor ebx, dword [eax + 0x494c]
movzx eax, cl
mov dword [esp + 0x44], ebx
cmp edi, eax
jbe 0x403c84
movzx ebp, byte [esp + 0x5c]
mov ebx, dword [esp + 0x34]
mov eax, dword [esp + 0x1c]
dec cl
mov esi, dword [esp + 0x14]
mov eax, dword [eax + ebp*4]
cdq
idiv edi
mov eax, dword [esi]
mov esi, dword [esp + 0x4c]
mov dword [ebx + eax*8], edx
dec dword [esi]
mov eax, dword [esi]
mov al, byte [esi + eax*4]
or byte [0x52afa2], al
inc edi
movzx eax, cl
cmp edi, eax
jg 0x403c44
mov edx, dword [0x52af9c]
mov ebx, dword [esp + 0x44]
mov ebp, dword [esp + 0x20]
mov byte [esp + 0x12], cl
or byte [edx + 0x14ac], bl
mov eax, 0xf1a
xor edx, edx
mov ecx, dword [0x52af80]
div dword [esi + 0x6cf8]
mov eax, dword [0x52af64]
mov esi, dword [esp + 0x18]
or edx, dword [eax + ecx*4]
mov eax, dword [esp + 0x14]
sub edx, ecx
mov ecx, dword [0x52af54]
mov dword [0x52af80], edx
movzx edx, byte [esp + 0x5c]
mov eax, dword [eax]
movzx eax, word [esi + eax*2]
imul eax, eax, 0x6b9
mov dword [0x52afd8], eax
mov eax, dword [0x52afd0]
add dword [ecx + edx*8], eax
mov al, 0xb9
sub al, byte [0x52afa2]
movzx edx, byte [esp + 0x13]
mov ecx, dword [0x52af80]
mov byte [0x52afa2], al
movzx eax, byte [edx*4 + 0x14ac]
movzx ecx, byte [ecx + 0x14ac]
sub eax, ecx
movzx ecx, word [esi + edx*2]
add eax, 0x19c8
cdq
idiv ecx
cdq
idiv dword [esp + 0x24]
mov al, byte [esp + 0x12]
dec al
mov dword [esp + 0x5c], edx
movzx edi, al
cmp edi, dword [0x52af58]
jle 0x403dc1
mov ebx, dword [esp + 0x50]
mov esi, edi
sub esi, edi
add esi, ebp
mov ebp, dword [esp + 0x30]
add ebp, 0x1e
lea ebp, [ebp + edi*2]
movzx eax, word [0x52af5c]
mov ecx, dword [esp + 0x18]
mov ax, word [ecx + eax*8 + 6]
mov ecx, dword [esp + 0x28]
xor word [ecx + edi*4], ax
mov eax, dword [esp + 0x3c]
movzx ecx, word [eax + edi*2]
mov eax, esi
cdq
idiv ecx
mov ecx, dword [esp + 0x58]
mov word [ebp], dx
xor edx, edx
mov eax, dword [0x52af9c]
lea ebp, [ebp + 2]
shl eax, 4
add ecx, eax
mov eax, dword [0x52af60]
sub eax, dword [esp + 0x5c]
div dword [0x52afb4]
xor edx, edx
div dword [ecx + 0x48]
mov eax, 0x1511
inc dword [esp + 0x5c]
mov dword [ecx + 0x48], edx
cdq
idiv ebx
movzx ecx, byte [0x52af5f]
sub eax, edi
cdq
idiv ecx
xor dword [0x52afbc], eax
dec ebx
inc edi
inc esi
cmp edi, dword [0x52af58]
jg 0x403d41
mov ebx, dword [esp + 0x44]
xor ebx, dword [esp + 0x54]
pop edi
pop esi
pop ebp
mov eax, ebx
pop ebx
add esp, 0x1c
ret