Function at 0x521d20
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.00521a60
mov ecx, dword [ebx + 0x8cdc]
cmp byte [ecx + 0x1a8], 0
je 0x521d9c
imul eax, dword [ebx + 0x8cf0], 0x8e00
mov ecx, dword [ecx + 0x184]
mov ecx, dword [eax + ecx + 0x8cec]
call fcn.0055b430
xor edx, edx
cmp dword [ebx + 0x8cd4], edx
jbe 0x521dd4
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 0x521db0
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 0x521e8a
movzx edx, byte [edx + eax]
mov ebp, 8
nop
mov ecx, dword [esi]
cmp ebp, ecx
jb 0x521e6a
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 0x521e56
call fcn.004136e5
mov edx, dword [esp + 0x14]
mov dword [esi], 8
mov byte [esi + 4], 0
test ebp, ebp
jne 0x521e20
jmp 0x521e73
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 0x521e15
mov ebp, dword [esp + 0x20]
movzx edx, byte [esp + 0x40]
and ebp, 7
jbe 0x521ee7
mov ecx, dword [esi]
cmp ebp, ecx
jb 0x521ede
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 0x521eca
call fcn.004136e5
mov edx, dword [esp + 0x40]
mov dword [esi], 8
mov byte [esi + 4], 0
test ebp, ebp
jne 0x521e94
jmp 0x521ee7
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 0x521f80
mov eax, dword [esi + 0x8cf0]
xor ebx, ebx
inc eax
cmp eax, dword [edi + 0x1a4]
cmovne ebx, eax
cmp dword [edi + 0x1bc], ebp
je 0x521f61
lea ecx, [edi + 0x148]
call fcn.0041371b
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.0055b3c0
pop edi
pop esi
mov eax, ebp
pop ebp
pop ebx
add esp, 0x2c
ret 4