Function at 0x5219a0
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x2c
push ebx
mov ebx, ecx
mov dword [esp + 0x20], 0
push ebp
push esi
push edi
mov eax, dword [ebx + 8]
mov dword [esp + 0x38], eax
lea eax, [esp + 0x2c]
mov dword [ebx + 0x10], eax
mov eax, dword [ebx + 0x8cdc]
mov dword [esp + 0x30], 8
mov byte [esp + 0x34], 0
mov dword [ebx + 0x8cd4], 0
push dword [eax + 0x174]
mov dword [esp + 0x28], ebx
push dword [esp + 0x44]
push dword [ebx]
call fcn.005216e0
mov ecx, dword [ebx + 0x8cdc]
cmp byte [ecx + 0x1a8], 0
je 0x521a1c
imul eax, dword [ebx + 0x8cf0], 0x8e00
mov ecx, dword [ecx + 0x184]
mov ecx, dword [eax + ecx + 0x8cec]
call fcn.0055ab40
xor edx, edx
cmp dword [ebx + 0x8cd4], edx
jbe 0x521a54
lea esi, [ebx + 0x7cd4]
nop dword [eax]
mov ecx, dword [ebx + 0x8cdc]
lea esi, [esi + 4]
inc edx
mov eax, dword [ecx + 0x180]
ror eax, 0x1f
xor eax, dword [esi - 4]
mov dword [ecx + 0x180], eax
cmp edx, dword [ebx + 0x8cd4]
jb 0x521a30
mov al, byte [esp + 0x34]
mov esi, dword [ebx + 0x8cdc]
mov edx, dword [ebx + 8]
add esi, 0x140
mov byte [esp + 0x40], al
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x1c], edx
lea ebp, [eax*8 + 8]
xor eax, eax
sub ebp, dword [esp + 0x30]
mov ecx, ebp
mov dword [esp + 0x20], ebp
shr ecx, 3
mov dword [esp + 0x18], ecx
mov dword [esp + 0x10], eax
test ecx, ecx
je 0x521b0a
movzx edx, byte [edx + eax]
mov ebp, 8
nop
mov ecx, dword [esi]
cmp ebp, ecx
jb 0x521aea
mov edi, dword [esi + 0xc]
sub ebp, ecx
mov ebx, edx
mov ecx, ebp
shr ebx, cl
mov eax, ebx
shl eax, cl
lea ecx, [esi + 8]
sub edx, eax
mov eax, dword [ecx]
mov dword [esp + 0x14], edx
mov dl, byte [esi + 4]
or dl, bl
mov byte [edi + eax], dl
inc edi
mov dword [ecx + 4], edi
cmp edi, dword [ecx + 8]
jne 0x521ad6
call fcn.00413756
mov edx, dword [esp + 0x14]
mov dword [esi], 8
mov byte [esi + 4], 0
test ebp, ebp
jne 0x521aa0
jmp 0x521af3
sub ecx, ebp
shl dl, cl
or byte [esi + 4], dl
mov dword [esi], ecx
mov eax, dword [esp + 0x10]
mov edx, dword [esp + 0x1c]
inc eax
mov dword [esp + 0x10], eax
cmp eax, dword [esp + 0x18]
jb 0x521a95
mov ebp, dword [esp + 0x20]
movzx edx, byte [esp + 0x40]
and ebp, 7
jbe 0x521b67
mov ecx, dword [esi]
cmp ebp, ecx
jb 0x521b5e
mov edi, dword [esi + 0xc]
sub ebp, ecx
mov ebx, edx
mov ecx, ebp
shr ebx, cl
mov eax, ebx
shl eax, cl
lea ecx, [esi + 8]
sub edx, eax
mov eax, dword [ecx]
mov dword [esp + 0x40], edx
mov dl, byte [esi + 4]
or dl, bl
mov byte [edi + eax], dl
inc edi
mov dword [ecx + 4], edi
cmp edi, dword [ecx + 8]
jne 0x521b4a
call fcn.00413756
mov edx, dword [esp + 0x40]
mov dword [esi], 8
mov byte [esi + 4], 0
test ebp, ebp
jne 0x521b14
jmp 0x521b67
sub ecx, ebp
shl dl, cl
or byte [esi + 4], dl
mov dword [esi], ecx
mov esi, dword [esp + 0x24]
xor ebp, ebp
mov edi, dword [esi + 0x8cdc]
cmp byte [edi + 0x1a8], 0
je 0x521c00
mov eax, dword [esi + 0x8cf0]
xor ebx, ebx
inc eax
cmp eax, dword [edi + 0x1a4]
cmovne ebx, eax
cmp dword [edi + 0x1bc], ebp
je 0x521be1
lea ecx, [edi + 0x148]
call fcn.0041378c
mov ecx, eax
mov eax, 0xf
sub eax, dword [edi + 0x140]
shr eax, 3
add ecx, eax
mov eax, dword [esi + 0x8cdc]
mov dword [esp + 0x24], ecx
adc edx, ebp
mov dword [esp + 0x28], edx
mov ecx, dword [eax + 0x1bc]
lea eax, [esp + 0x24]
push eax
lea eax, [esi + 0x8cf8]
push eax
mov edx, dword [ecx]
push ecx
call dword [edx + 0xc]
mov ebp, eax
mov ecx, dword [esi + 0x8cdc]
imul edx, ebx, 0x8e00
mov ecx, dword [ecx + 0x184]
add ecx, 0x8cec
add ecx, edx
call fcn.0055aad0
pop edi
pop esi
mov eax, ebp
pop ebp
pop ebx
add esp, 0x2c
ret 4