Function at 0x405f20
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x20
mov eax, dword [0x52afa4]
imul eax, dword [0x52af70]
mov cx, word [0x52af5c]
push ebx
mov ebx, dword [0x52afcc]
push ebp
mov dword [esp + 0x24], eax
mov ebp, 0x1e35
movzx eax, byte [0x52af5f]
or eax, 0x1271
sub ebp, dword [0x52afa4]
mov dword [esp + 0x1c], eax
movzx eax, byte [0x52af5e]
mov dword [esp + 0x20], eax
push esi
mov esi, dword [0x52afc4]
movzx eax, cx
push edi
mov edi, dword [esp + 0x3c]
mov dword [esp + 0x20], ebp
sub ebx, dword [edi + eax*4 + 0x7c]
mov eax, 0xffff
add cx, ax
mov dword [esp + 0x1c], ebx
mov eax, dword [0x52af78]
mov ebx, 0x943
mov dword [esp + 0x18], eax
mov eax, esi
cdq
idiv ebx
mov ebx, dword [esp + 0x48]
dec esi
mov dword [esp + 0x14], eax
xor edx, edx
mov word [0x52af5c], cx
movzx eax, cx
imul ecx, eax, 0xc
mov eax, dword [0x52af84]
mov dword [0x52afc4], esi
div dword [ecx + ebx]
mov ebx, dword [esp + 0x14]
mov byte [esp + 0x3c], al
mov eax, dword [esp + 0x40]
movzx ecx, byte [esi + eax]
movzx eax, byte [esp + 0x5c]
add ecx, eax
mov dword [esp + 0x10], ecx
mov ecx, 0x137f
mov eax, dword [ecx]
mov esi, dword [edi + eax*4]
mov edi, dword [esp + 0x18]
cmp esi, dword [edi + eax*4]
je 0x40602a
mov ecx, 0x299d
mov ebp, 0x137f
mov eax, esi
xor eax, 0x43
cdq
idiv esi
or eax, 0x89e
inc esi
mov dword [0x52afd0], eax
mov eax, dword [ebp]
movzx ecx, byte [ecx]
mov dword [ebx + eax*4 + 4], ecx
mov ecx, 0x299d
mov eax, dword [ebp]
cmp esi, dword [edi + eax*4]
jne 0x405ffc
mov ebp, dword [esp + 0x20]
mov ecx, dword [ebp]
mov esi, dword [esp + 0x4c]
mov eax, dword [0x52af68]
mov edi, dword [esp + 0x54]
cmp eax, dword [esi + ecx*4 + 0x44]
jae 0x4060a5
movzx eax, byte [ecx + 0x159e]
xor edx, edx
mov esi, dword [edi]
mov ecx, dword [0x52af90]
div dword [ecx + esi*4]
mov ecx, dword [0x52af60]
xor edx, edx
sub eax, dword [0x52afa4]
add eax, dword [0x52afd0]
and word [0x52afc8], ax
movzx eax, byte [esp + 0x3c]
sub eax, dword [ebx + ecx*4]
mov dword [ebx + ecx*4], eax
mov ecx, dword [esp + 0x40]
movzx eax, word [0x52afa8]
mov esi, dword [edi]
movzx eax, byte [eax + ecx]
mov ecx, 0x95e
div ecx
mov ecx, dword [0x52af88]
mov eax, edx
xor edx, edx
div dword [ecx + esi*4]
or dword [0x52afcc], edx
mov esi, dword [esp + 0x48]
mov eax, 0x137f
inc dword [eax]
mov edx, dword [eax]
imul ecx, dword [edi], 3
mov eax, dword [0x52af74]
movzx ecx, byte [ecx + eax]
movzx eax, word [0x52afa8]
imul eax, eax, 0xc
xor ecx, dword [eax + esi]
imul ecx, dword [ebp + edx*4 + 8]
mov dword [ebp + edx*4 + 8], ecx
mov ecx, 0x137f
mov al, byte [0x52afd8]
mov ecx, dword [ecx]
or byte [ecx + 0x15b5], al
mov eax, dword [0x52afac]
mov ecx, dword [0x52af8c]
dec dword [edi]
push eax
push 0x1733
push ecx
call fcn.00413d84
imul edx, dword [edi], 0xc
add esp, 0xc
mov ecx, dword [esp + 0x44]
mov esi, dword [esp + 0x4c]
mov dword [edx + ecx + 0x14], eax
mov eax, dword [0x52af84]
dec eax
mov dword [0x52af84], eax
mov edx, dword [edi]
mov ecx, dword [ebx + edx*4]
mov ebx, dword [0x52afac]
add ecx, eax
mov eax, dword [0x52afb0]
or ecx, dword [0x52af70]
sub ecx, dword [eax + edx*4]
or dword [0x52af50], ecx
cmp ebx, dword [esp + 0x10]
jae 0x406301
mov ecx, dword [esp + 0x34]
lea eax, [ecx + ebx*4]
mov dword [esp + 0x4c], eax
mov eax, ebx
shl eax, 4
add eax, dword [esp + 0x24]
mov dword [esp + 0x3c], eax
imul eax, ebx, 0xc
add eax, dword [esp + 0x50]
mov dword [esp + 0x5c], eax
lea eax, [ebx + 3]
lea eax, [esi + eax*4]
mov dword [esp + 0x48], eax
mov eax, dword [esp + 0x14]
lea eax, [eax + ebx*4]
add eax, 0x14
mov dword [esp + 0x40], eax
mov eax, ebp
sub eax, ecx
mov dword [esp + 0x54], eax
mov ecx, dword [0x52afcc]
xor edx, edx
mov eax, 0x137f
mov esi, dword [eax]
mov eax, 0x1b7f
div ecx
mov eax, dword [esp + 0x28]
add esi, 9
add esi, esi
sub edx, dword [eax + esi*8]
mov eax, dword [esp + 0x34]
mov esi, dword [esp + 0x1c]
or edx, dword [eax + 0x2f04]
add dword [0x52afb4], edx
inc ecx
mov eax, dword [esp + 0x40]
mov dword [0x52afcc], ecx
inc dword [edi - 4]
mov edx, dword [edi - 4]
mov eax, dword [eax]
mov ecx, dword [0x52af88]
add dword [ecx + edx*4 + 0xc], eax
movzx eax, byte [0x52af80]
mov ecx, dword [ebp]
push eax
movzx eax, word [0x52afa8]
add ecx, ecx
cdq
idiv dword [esi + ecx*8 + 0x8c]
mov ecx, dword [esp + 0x50]
push eax
movzx eax, byte [ebx + 0xf8]
push eax
mov eax, dword [esp + 0x60]
mov esi, dword [esp + 0x48]
push dword [ecx + eax]
mov eax, dword [esp + 0x6c]
mov ecx, dword [esp + 0x68]
push 0xcd
mov eax, dword [eax]
xor eax, dword [ecx + 0x26fc]
imul ecx, dword [edi - 4], 0xc
push eax
mov eax, dword [esp + 0x30]
push dword [eax + 0x3b20]
movzx eax, word [0x52afa0]
push eax
mov eax, dword [0x52af54]
mov eax, dword [eax + 0x5590]
or eax, dword [esi]
push eax
mov eax, dword [0x52af64]
push dword [ecx + eax]
push ebx
push dword [esp + 0x3c]
call fcn.0041390c
mov ecx, dword [0x52af8c]
add esp, 0x30
mov eax, dword [0x52af74]
mov dword [esp + 0x3c], 0x1ab3
movzx ecx, byte [ecx + eax + 7]
movzx eax, byte [0x52af5e]
or eax, ecx
mov ecx, dword [esp + 0x48]
cdq
idiv dword [ecx]
mov dword [ecx], eax
mov eax, dword [esp + 0x2c]
inc dword [0x52af8c]
movzx ecx, byte [0x52af5f]
mov eax, dword [eax + 0x7f8]
cdq
idiv dword [esp + 0x3c]
mov eax, dword [esp + 0x34]
xor edx, ecx
add edx, dword [eax + 0x1508]
mov eax, edx
xor edx, edx
div ecx
mov eax, dword [0x52af9c]
mov byte [0x52af5f], dl
xor edx, edx
mov ecx, dword [esp + 0x4c]
div ebx
add dword [esp + 0x5c], 0xc
add esi, 0x10
mov eax, edx
add dword [esp + 0x40], 4
xor edx, edx
add dword [esp + 0x48], 4
div ebx
mov dword [esp + 0x3c], esi
mov eax, edx
xor edx, edx
div dword [ecx]
inc ebx
mov dword [ecx], eax
add ecx, 4
mov dword [esp + 0x4c], ecx
cmp ebx, dword [esp + 0x10]
jb 0x40618a
mov ecx, dword [esp + 0x1c]
mov eax, 0x137f
pop edi
pop esi
pop ebp
mov eax, dword [eax]
pop ebx
mov eax, dword [ecx + eax*4 + 0x20]
add esp, 0x20
ret