Function at 0x405f7b
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x20
mov eax, dword [0x52b564]
imul eax, dword [0x52b530]
mov cx, word [0x52b51c]
push ebx
mov ebx, dword [0x52b58c]
push ebp
mov dword [esp + 0x24], eax
mov ebp, 0x1e35
movzx eax, byte [0x52b51f]
or eax, 0x1271
sub ebp, dword [0x52b564]
mov dword [esp + 0x1c], eax
movzx eax, byte [0x52b51e]
mov dword [esp + 0x20], eax
push esi
mov esi, dword [0x52b584]
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 [0x52b538]
mov ebx, 0x172d
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 [0x52b51c], cx
movzx eax, cx
imul ecx, eax, 0xc
mov eax, dword [0x52b544]
mov dword [0x52b584], 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 0x406085
mov ecx, 0x299d
mov ebp, 0x137f
mov eax, esi
xor eax, 0x43
cdq
idiv esi
or eax, 0x89e
inc esi
mov dword [0x52b590], 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 0x406057
mov ebp, dword [esp + 0x20]
mov ecx, dword [ebp]
mov esi, dword [esp + 0x4c]
mov eax, dword [0x52b528]
mov edi, dword [esp + 0x54]
cmp eax, dword [esi + ecx*4 + 0x44]
jae 0x406100
movzx eax, byte [ecx + 0x159e]
xor edx, edx
mov esi, dword [edi]
mov ecx, dword [0x52b550]
div dword [ecx + esi*4]
mov ecx, dword [0x52b520]
xor edx, edx
sub eax, dword [0x52b564]
add eax, dword [0x52b590]
and word [0x52b588], 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 [0x52b568]
mov esi, dword [edi]
movzx eax, byte [eax + ecx]
mov ecx, 0x95e
div ecx
mov ecx, dword [0x52b548]
mov eax, edx
xor edx, edx
div dword [ecx + esi*4]
or dword [0x52b58c], edx
mov esi, dword [esp + 0x48]
mov eax, 0x137f
inc dword [eax]
mov edx, dword [eax]
imul ecx, dword [edi], 3
mov eax, dword [0x52b534]
movzx ecx, byte [ecx + eax]
movzx eax, word [0x52b568]
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 [0x52b598]
mov ecx, dword [ecx]
or byte [ecx + 0x15b5], al
mov eax, dword [0x52b56c]
mov ecx, dword [0x52b54c]
dec dword [edi]
push eax
push 0x1733
push ecx
call fcn.00413dc8
imul edx, dword [edi], 0xc
add esp, 0xc
mov ecx, dword [esp + 0x44]
mov esi, dword [esp + 0x4c]
mov dword [edx + ecx + 0x10], eax
mov eax, dword [0x52b544]
dec eax
mov dword [0x52b544], eax
mov edx, dword [edi]
mov ecx, dword [ebx + edx*4]
mov ebx, dword [0x52b56c]
add ecx, eax
mov eax, dword [0x52b570]
or ecx, dword [0x52b530]
sub ecx, dword [eax + edx*4]
or dword [0x52b510], ecx
cmp ebx, dword [esp + 0x10]
jae 0x40635c
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 [0x52b58c]
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 [0x52b574], edx
inc ecx
mov eax, dword [esp + 0x40]
mov dword [0x52b58c], ecx
inc dword [edi - 4]
mov edx, dword [edi - 4]
mov eax, dword [eax]
mov ecx, dword [0x52b548]
add dword [ecx + edx*4 + 0xc], eax
movzx eax, byte [0x52b540]
mov ecx, dword [ebp]
push eax
movzx eax, word [0x52b568]
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 [0x52b560]
push eax
mov eax, dword [0x52b514]
mov eax, dword [eax + 0x5590]
or eax, dword [esi]
push eax
mov eax, dword [0x52b524]
push dword [ecx + eax]
push ebx
push dword [esp + 0x3c]
call fcn.00413956
mov ecx, dword [0x52b54c]
add esp, 0x30
mov eax, dword [0x52b534]
mov dword [esp + 0x3c], 0x1ab3
movzx ecx, byte [ecx + eax + 7]
movzx eax, byte [0x52b51e]
or eax, ecx
mov ecx, dword [esp + 0x48]
cdq
idiv dword [ecx]
mov dword [ecx], eax
mov eax, dword [esp + 0x2c]
inc dword [0x52b54c]
movzx ecx, byte [0x52b51f]
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 [0x52b55c]
mov byte [0x52b51f], 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 0x4061e5
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