Function at 0x401ff0
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x5c
mov eax, dword [0x51f584]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
mov dword [ebp - 0x28], eax
mov eax, dword [ebp + 0x10]
mov ebx, edx
mov dword [eax], 0
mov esi, dword [ebx + 8]
add esi, esi
push edi
add esi, esi
push esi
mov dword [ebp - 0x40], ebx
mov dword [ebp - 0x2c], ecx
mov dword [ebp - 0x5c], eax
call fcn.00482680
push esi
mov edi, eax
call fcn.00482680
add esp, 8
xor edx, edx
mov dword [ebp - 0x3c], eax
test esi, esi
jle 0x40205d
mov ecx, dword [ebp + 0x14]
sub ecx, edi
mov dword [ebp - 0x34], ecx
xor cl, cl
cmp edx, dword [ebp + 0x18]
jg 0x402055
mov ecx, dword [ebp - 0x34]
add ecx, edx
mov cl, byte [ecx + edi]
mov byte [edx + edi], cl
inc edx
cmp edx, esi
jl 0x402046
mov edx, dword [ebx + 8]
add edx, edx
push esi
add edx, edx
push edx
push edi
mov edx, edi
mov ecx, eax
call fcn.00401b60
push edi
call fcn.00482624
push 9
call fcn.00482680
mov ebx, eax
mov eax, dword [ebp - 0x28]
mov ecx, dword [eax]
mov dword [ebx], ecx
mov edx, dword [eax + 4]
push 0x10
mov dword [ebp - 0x4c], ebx
mov dword [ebx + 4], edx
mov byte [ebx + 8], 0
call fcn.00482680
movzx ecx, byte [ebx]
mov byte [eax], cl
movzx edx, byte [ebx + 1]
mov byte [eax + 1], dl
movzx ecx, byte [ebx + 2]
mov byte [eax + 2], cl
movzx edx, byte [ebx + 3]
mov edi, dword [ebp - 0x40]
mov byte [eax + 3], dl
movzx ecx, byte [ebx + 4]
mov byte [eax + 4], cl
movzx edx, byte [ebx + 5]
mov byte [eax + 5], dl
movzx ecx, byte [ebx + 6]
mov byte [eax + 6], cl
movzx edx, byte [ebx + 7]
mov byte [eax + 7], dl
mov dword [ebp - 0x38], eax
mov eax, 4
mov dword [edi + 4], eax
mov dword [edi + 8], eax
mov eax, dword [edi + 0x14]
add esp, 0xc
mov dword [edi], 0xa
test eax, eax
je 0x4020fa
push eax
call fcn.00482624
add esp, 4
push 0x10
call fcn.00482680
xor ecx, ecx
mov dword [edi + 0x14], eax
mov dword [eax], ecx
mov dword [eax + 4], ecx
add esp, 4
mov dword [eax + 8], ecx
mov dword [eax + 0xc], ecx
cmp esi, 0x10
jl 0x40211e
mov esi, 0x10
mov eax, dword [ebp - 0x3c]
mov ecx, dword [edi + 0x14]
push esi
push eax
push ecx
call fcn.004868f0
add esp, 0xc
mov esi, edi
call fcn.004010f0
call fcn.00401160
mov eax, dword [ebp + 0xc]
add eax, 0xfffffff8
test al, 0xf
je 0x40214b
shr eax, 4
inc eax
jmp 0x40214e
shr eax, 4
mov dword [ebp - 0x30], eax
shl eax, 4
lea edi, [eax + 1]
push edi
call fcn.00482680
push edi
mov esi, eax
push 0
push esi
mov dword [ebp - 0x58], esi
call fcn.00486870
mov eax, dword [ebp + 0xc]
mov edx, dword [ebp - 0x28]
add eax, 0xfffffff8
push eax
add edx, 8
push edx
push esi
call fcn.004868f0
xor edi, edi
add esp, 0x1c
cmp dword [ebp - 0x30], edi
jle 0x4022b8
mov ecx, dword [ebp + 0xc]
mov eax, dword [ebp - 0x2c]
add ecx, 0xfffffff8
lea edx, [ebp - 0x24]
sub esi, edx
mov dword [ebp - 0x44], eax
mov dword [ebp - 0x34], edi
mov dword [ebp - 0x28], ecx
mov dword [ebp - 0x48], esi
jmp 0x4021b0
mov eax, edi
and eax, 0x80000000
mov dword [ebp - 0x50], eax
lea eax, [edi + 1]
mov dword [ebp - 0x2c], eax
fild dword [ebp - 0x2c]
fmul qword [0x511330]
fsub qword [0x511328]
call fcn.00487ab0
mov ebx, dword [ebp - 0x38]
mov dword [ebp - 0x54], eax
xor eax, eax
add ebx, 0xb
nop
mov esi, eax
and esi, 0x1f
cmp dword [ebp - 0x50], 0
mov edx, edi
je 0x4021fa
sar edx, 1
or edx, 0x7fffffff
lea ecx, [esi - 1]
jmp 0x4021fc
mov ecx, esi
sar edx, cl
mov byte [ebx + 4], dl
mov edx, dword [ebp - 0x54]
test edx, edx
jns 0x402215
sar edx, 1
or edx, 0x7fffffff
lea ecx, [esi - 1]
jmp 0x402217
mov ecx, esi
sar edx, cl
add eax, 8
dec ebx
mov byte [ebx + 1], dl
cmp eax, 0x20
jl 0x4021e0
mov eax, dword [ebp - 0x38]
lea ecx, [ebp - 0x24]
push ecx
mov ecx, dword [ebp - 0x40]
call fcn.004016c0
mov edx, dword [ebp - 0x34]
xor eax, eax
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x10], eax
mov dword [ebp - 0xc], eax
mov dword [ebp - 8], eax
mov eax, dword [ebp + 0xc]
sub eax, edx
sub eax, 8
mov esi, 0x10
cmp eax, 0x10
ja 0x40225a
mov esi, dword [ebp - 0x28]
mov eax, dword [ebp - 0x5c]
add dword [eax], esi
xor eax, eax
test esi, esi
jle 0x40227c
mov edi, dword [ebp - 0x48]
lea ecx, [ebp + eax - 0x24]
add edi, ecx
mov bl, byte [edi + edx]
xor bl, byte [ecx]
inc eax
mov byte [ebp + eax - 0x15], bl
cmp eax, esi
jl 0x402265
mov eax, dword [ebp - 0x44]
mov ecx, dword [ebp - 0x14]
mov edi, dword [ebp - 0x2c]
sub dword [ebp - 0x28], 0x10
mov dword [eax], ecx
mov ecx, dword [ebp - 0x10]
mov dword [eax + 4], ecx
mov ecx, dword [ebp - 0xc]
mov dword [eax + 8], ecx
mov ecx, dword [ebp - 8]
mov dword [eax + 0xc], ecx
add eax, 0x10
add edx, 0x10
mov dword [ebp - 0x44], eax
mov dword [ebp - 0x34], edx
cmp edi, dword [ebp - 0x30]
jl 0x4021b0
mov esi, dword [ebp - 0x58]
mov ebx, dword [ebp - 0x4c]
push esi
call fcn.00482624
mov edx, dword [ebp - 0x38]
push edx
call fcn.00482624
mov eax, dword [ebp - 0x3c]
push eax
call fcn.00482624
push ebx
call fcn.00482624
mov ecx, dword [ebp - 4]
add esp, 0x10
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00482279
mov esp, ebp
pop ebp
ret 0x14