Function at 0x40521a
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x30
mov eax, dword [0x507990]
xor edx, edx
mov dword [esp + 0xc], eax
mov eax, dword [0x50795c]
mov dword [esp + 0x24], eax
mov ax, word [0x5079a8]
inc ax
mov cx, word [0x507980]
mov word [0x5079a8], ax
push ebx
push ebp
push esi
movzx esi, ax
mov eax, 0xef7
div esi
mov eax, 0xffff
mov ebx, dword [0x507958]
add cx, ax
mov dword [esp + 0x14], edx
mov eax, dword [esp + 0x50]
mov word [0x507980], cx
push edi
mov edi, dword [esp + 0x60]
mov eax, dword [eax]
movzx edx, byte [edi + eax*4]
movzx eax, cx
and edx, eax
mov ecx, dword [0x507970]
mov eax, dword [esp + 0x4c]
mov ebp, ecx
mov dword [esp + 0x28], edx
mov dword [esp + 0x24], ecx
mov al, byte [eax + 0x3946]
mov byte [esp + 0x13], al
mov eax, dword [0x50797c]
sub eax, dword [0x50794c]
mov dword [esp + 0x20], eax
mov eax, dword [0x507954]
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x44]
mov eax, dword [eax]
movzx edx, byte [eax + edi + 1]
mov eax, dword [0x507944]
xor edx, ebx
mov dword [esp + 0x3c], eax
dec ebx
mov eax, dword [esp + 0x50]
inc ecx
mov dword [0x507970], ecx
mov ecx, dword [esp + 0x34]
imul ecx, dword [esp + 0x64]
mov dword [0x507958], ebx
movzx eax, byte [eax + 0x8cf]
mov dword [esp + 0x2c], eax
movzx eax, byte [esi + edi]
mov edi, dword [esp + 0x1c]
sub ecx, dword [esp + 0x34]
imul eax, eax, 0x1ed0
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x44]
mov esi, dword [eax]
movzx eax, word [esi + esi + 0x1129]
imul eax, dword [edx + edi*4]
xor edx, edx
div ecx
mov eax, dword [esp + 0x28]
mov dword [esp + 0x38], edx
mov ecx, dword [esp + 0x2c]
mov eax, dword [eax + 0x76f0]
cdq
idiv ebx
movzx eax, word [ecx + esi*2 + 0xa]
movzx ecx, dx
imul ecx, eax
sub cx, word [0x50798c]
mov word [0x50798c], cx
mov ecx, dword [esp + 0x44]
sub ecx, 4
inc ebx
mov dword [esp + 0x44], ecx
mov dword [0x507958], ebx
mov esi, dword [esp + 0x14]
mov eax, 0xacf
cdq
idiv dword [esi + edi*4]
mov edi, dword [esp + 0x60]
add byte [ebx + edi + 0x27], dl
inc dword [ecx]
mov esi, dword [ecx]
mov ebx, dword [esp + 0x14]
mov edi, dword [esp + 0x30]
mov edx, dword [0x5079a4]
mov ecx, dword [esp + 0x58]
mov eax, dword [ebx]
and ecx, 0x15b1
or ecx, dword [edi + eax*4 + 0x10]
mov edi, 0x2d1
add dword [edx + esi*4 + 0x1c], ecx
xor edx, edx
mov ecx, dword [esp + 0x1c]
mov eax, dword [esp + 0x20]
mov esi, dword [ebx]
movzx eax, word [eax + ecx*2 + 8]
imul eax, ebp
mov ebp, dword [esp + 0x18]
div edi
mov edi, dword [esp + 0x60]
xor dl, cl
movzx ecx, dl
movzx eax, byte [edi + esi*4 + 2]
imul ecx, eax
mov eax, dword [esp + 0x5c]
mov byte [edi + esi*4 + 2], cl
mov ecx, dword [esp + 0x28]
mov ebx, dword [ecx + eax*4 + 0x60]
mov ax, word [0x5079a8]
inc ax
mov word [0x5079a8], ax
movzx eax, ax
cmp ebx, dword [ebp + eax*4]
jl 0x4054cf
movzx esi, byte [esp + 0x13]
mov edi, ebx
mov ebp, dword [esp + 0x24]
shl edi, 4
mov dword [esp + 0x58], esi
add edi, 0x102f
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x54]
mov eax, dword [eax]
lea ecx, [ecx + eax*4]
mov eax, dword [0x507964]
cdq
idiv dword [ecx]
mov dword [ecx], eax
mov cx, word [edi]
lea edi, [edi + 0x10]
xor cx, word [0x507960]
movzx eax, byte [0x50794a]
add cx, ax
mov eax, dword [esp + 0x2c]
mov word [eax + esi*8], cx
mov esi, dword [esp + 0x44]
mov eax, dword [esi]
lea ecx, [eax*4]
mov eax, dword [esp + 0x64]
cdq
idiv dword [ecx + ebp]
mov eax, dword [esp + 0x14]
mov dword [ecx + ebp], edx
inc dword [esi]
mov ecx, dword [esp + 0x4c]
mov eax, dword [eax]
mov esi, dword [esi]
shl esi, 4
movzx ecx, word [ecx + eax*8]
mov eax, ebx
cdq
idiv ecx
mov eax, edx
cdq
idiv dword [esi + 0x106b]
mov eax, dword [esp + 0x44]
mov dword [esi + 0x106b], edx
xor edx, edx
mov ecx, dword [0x507978]
mov esi, dword [eax]
movzx eax, byte [0x50794a]
div dword [ecx + ebx*4]
mov ecx, dword [esp + 0x60]
sub al, byte [esp + 0x38]
add byte [esi + ecx], al
inc ebx
mov ax, word [0x5079a8]
mov ecx, dword [esp + 0x18]
inc ax
mov esi, dword [esp + 0x58]
mov word [0x5079a8], ax
movzx eax, ax
cmp ebx, dword [ecx + eax*4]
jge 0x40540c
mov edi, dword [esp + 0x60]
mov ebp, ecx
mov eax, dword [esp + 0x54]
mov edx, dword [esp + 0x20]
mov eax, dword [eax]
mov ecx, eax
shl ecx, 4
movzx eax, word [edx + eax*2 + 8]
xor eax, dword [0x50795c]
or dword [ecx + 0x102f], eax
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x50]
dec eax
imul esi, eax, 0xc
movzx eax, byte [esp + 0x13]
movzx ecx, byte [eax + edi + 5]
mov eax, dword [0x507958]
movzx eax, byte [eax + edx + 4]
xor edx, edx
div ecx
movzx ecx, word [0x5079a8]
add eax, ecx
mov ecx, dword [esp + 0x24]
add dword [esi + ecx], eax
mov eax, dword [0x50796c]
movzx esi, byte [eax + edi]
cmp esi, dword [ebp + 0x400]
je 0x405586
mov edi, dword [esp + 0x3c]
mov ebx, dword [esp + 0x30]
add edi, 0x88
imul eax, esi, 0xc
add ebx, eax
add edi, eax
mov eax, dword [0x507984]
xor edx, edx
mov eax, dword [eax + 0x3b00]
xor dword [edi], eax
lea edi, [edi + 0xc]
mov eax, dword [ecx + esi*4]
div dword [ebx]
imul ecx, dword [0x50797c], 6
lea ebx, [ebx + 0xc]
mov edx, dword [esp + 0x20]
movzx ecx, word [ecx + edx]
add eax, ecx
mov ecx, dword [esp + 0x24]
inc esi
mov dword [0x50795c], eax
cmp esi, dword [ebp + 0x400]
jne 0x405549
mov eax, dword [0x507940]
and eax, dword [esp + 0x34]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x30
ret