Function at 0x100504a0
Capabilities:
Encode data using xor

Disassembly:
mov eax, 8
call fcn.10033890
mov ecx, dword [esp + 0x18]
push esi
mov esi, dword [esp + 0x10]
mov eax, dword [esi + 0x174]
mov dword [esp + 0x10], eax
xor eax, eax
add ecx, dword [esi + 0x38]
adc eax, dword [esi + 0x3c]
cmp eax, 0xf
ja 0x100506d4
jb 0x100504d9
cmp ecx, 0xffffffe0
ja 0x100506d4
cmp dword [esi + 0x16c], 0
mov dword [esi + 0x38], ecx
mov dword [esi + 0x3c], eax
je 0x10050502
lea ecx, [esi + 0x60]
push ecx
lea edx, [esi + 0x40]
push edx
call fcn.1004f820
add esp, 8
mov dword [esi + 0x16c], 0
movzx eax, byte [esi + 0xe]
movzx ecx, byte [esi + 0xf]
push ebx
xor ebx, ebx
mov bh, byte [esi + 0xc]
push ebp
mov ebp, dword [esi + 0x168]
push edi
mov edi, dword [esp + 0x24]
mov bl, byte [esi + 0xd]
shl ebx, 8
or ebx, eax
shl ebx, 8
or ebx, ecx
test ebp, ebp
je 0x10050578
lea ecx, [ecx]
cmp dword [esp + 0x28], 0
je 0x10050560
mov al, byte [esi + ebp + 0x10]
mov ecx, dword [esp + 0x20]
xor al, byte [ecx]
sub dword [esp + 0x28], 1
mov byte [edi], al
xor byte [esi + ebp + 0x40], al
add ecx, 1
add ebp, 1
add edi, 1
and ebp, 0xf
mov dword [esp + 0x20], ecx
jne 0x10050530
jmp 0x10050568
test ebp, ebp
jne 0x100506c4
lea edx, [esi + 0x60]
push edx
lea eax, [esi + 0x40]
push eax
call fcn.1004f820
add esp, 8
mov ecx, dword [esp + 0x28]
cmp ecx, 0xc00
jb 0x100505f9
mov eax, 0xaaaaaaab
mul ecx
shr edx, 0xb
mov dword [esp + 0x10], edx
mov ecx, dword [esp + 0x1c]
mov edx, dword [esp + 0x20]
push esi
push ecx
push 0xc0
push edi
push edx
call dword [esp + 0x40]
add ebx, 0xc0
mov eax, ebx
shr eax, 0x18
mov byte [esi + 0xc], al
push 0xc00
lea eax, [esi + 0x60]
mov ecx, ebx
shr ecx, 0x10
push eax
mov edx, ebx
lea eax, [esi + 0x40]
mov byte [esi + 0xd], cl
shr edx, 8
push eax
mov ecx, edi
mov byte [esi + 0xe], dl
mov byte [esi + 0xf], bl
call fcn.1004f9a0
mov eax, 0xc00
add dword [esp + 0x40], eax
sub dword [esp + 0x48], eax
add esp, 0x20
add edi, eax
sub dword [esp + 0x10], 1
jne 0x10050592
mov ecx, dword [esp + 0x28]
mov eax, ecx
and eax, 0xfffffff0
mov dword [esp + 0x10], eax
je 0x10050662
mov ecx, dword [esp + 0x1c]
mov edx, dword [esp + 0x20]
push esi
push ecx
shr eax, 4
push eax
push edi
push edx
mov dword [esp + 0x28], eax
call dword [esp + 0x40]
add ebx, dword [esp + 0x28]
mov eax, ebx
shr eax, 0x18
mov byte [esi + 0xc], al
mov eax, dword [esp + 0x24]
add dword [esp + 0x34], eax
sub dword [esp + 0x3c], eax
push eax
mov ecx, ebx
shr ecx, 0x10
mov byte [esi + 0xd], cl
lea eax, [esi + 0x60]
push eax
lea ecx, [esi + 0x40]
mov edx, ebx
shr edx, 8
push ecx
mov ecx, edi
mov byte [esi + 0xe], dl
mov byte [esi + 0xf], bl
call fcn.1004f9a0
mov ecx, dword [esp + 0x48]
add esp, 0x20
add edi, dword [esp + 0x10]
test ecx, ecx
je 0x100506c4
mov edx, dword [esp + 0x1c]
mov ecx, dword [esi + 0x170]
push edx
lea eax, [esi + 0x10]
push eax
push esi
call ecx
add ebx, 1
mov edx, ebx
shr edx, 0x18
mov ecx, ebx
shr ecx, 8
mov byte [esi + 0xc], dl
mov edx, dword [esp + 0x2c]
mov eax, ebx
shr eax, 0x10
add esp, 0xc
mov byte [esi + 0xe], cl
mov byte [esi + 0xd], al
mov byte [esi + 0xf], bl
lea ecx, [edi + ebp]
sub edx, edi
mov al, byte [esi + ebp + 0x10]
xor al, byte [edx + ecx]
mov edi, dword [esp + 0x28]
mov byte [ecx], al
xor byte [esi + ebp + 0x40], al
sub edi, 1
add ebp, 1
add ecx, 1
test edi, edi
mov dword [esp + 0x28], edi
jne 0x100506a2
pop edi
mov dword [esi + 0x168], ebp
pop ebp
pop ebx
xor eax, eax
pop esi
add esp, 8
ret
or eax, 0xffffffff
pop esi
add esp, 8
ret