Function at 0x513ee0
Capabilities:
Encode data using xor

Disassembly:
mov eax, 0x10
call fcn.005c5c30
push esi
mov esi, dword [esp + 0x18]
mov eax, dword [esi + 0x174]
mov dword [esp + 8], eax
mov eax, dword [esp + 0x24]
xor ecx, ecx
mov edx, eax
add edx, dword [esi + 0x38]
adc ecx, dword [esi + 0x3c]
cmp ecx, 0xf
ja 0x5141db
jb 0x513f1b
cmp edx, 0xffffffe0
ja 0x5141db
mov dword [esi + 0x38], edx
mov dword [esi + 0x3c], ecx
mov ecx, dword [esi + 0x168]
xor edx, edx
mov dword [esp + 0x18], ecx
cmp dword [esi + 0x16c], edx
je 0x513f9c
cmp eax, edx
jne 0x513f5a
lea ecx, [esi + 0x60]
push ecx
lea edx, [esi + 0x40]
push edx
call fcn.00512e10
add esp, 8
mov dword [esi + 0x16c], 0
xor eax, eax
pop esi
add esp, 0x10
ret
mov ecx, dword [esi + 0x40]
mov dword [esi + 0x178], ecx
mov ecx, dword [esi + 0x44]
mov dword [esi + 0x17c], ecx
mov ecx, dword [esi + 0x48]
mov dword [esi + 0x180], ecx
mov ecx, dword [esi + 0x4c]
mov dword [esp + 0x18], 0x10
mov dword [esi + 0x184], ecx
mov ecx, dword [esp + 0x18]
mov dword [esi + 0x40], edx
mov dword [esi + 0x44], edx
mov dword [esi + 0x48], edx
mov dword [esi + 0x4c], edx
mov dword [esi + 0x16c], edx
movzx edx, byte [esi + 0xd]
push ebx
movzx ebx, byte [esi + 0xc]
shl ebx, 8
or ebx, edx
movzx edx, byte [esi + 0xe]
shl ebx, 8
or ebx, edx
movzx edx, byte [esi + 0xf]
shl ebx, 8
or ebx, edx
push ebp
mov ebp, dword [esp + 0x28]
mov edx, ecx
and edx, 0xf
push edi
mov edi, dword [esp + 0x28]
mov dword [esp + 0x10], edx
je 0x514037
jmp 0x513fdb
mov edx, dword [esp + 0x10]
mov eax, dword [esp + 0x30]
test eax, eax
je 0x514008
mov al, byte [edi]
dec dword [esp + 0x30]
mov byte [ecx + esi + 0x178], al
mov dl, byte [edx + esi + 0x10]
xor dl, al
mov eax, dword [esp + 0x10]
mov byte [ebp], dl
inc eax
inc ebp
inc ecx
inc edi
and eax, 0xf
mov dword [esp + 0x10], eax
jne 0x513fd3
jmp 0x514010
test edx, edx
jne 0x5141cb
push ecx
lea edx, [esi + 0x60]
push edx
lea eax, [esi + 0x40]
lea ecx, [esi + 0x178]
push eax
call fcn.00512f90
mov eax, dword [esp + 0x3c]
mov dword [esp + 0x30], 0
mov ecx, dword [esp + 0x30]
add esp, 0xc
cmp eax, 0x10
jb 0x514067
test ecx, ecx
je 0x514067
push ecx
lea edx, [esi + 0x60]
push edx
lea eax, [esi + 0x40]
lea ecx, [esi + 0x178]
push eax
call fcn.00512f90
mov eax, dword [esp + 0x3c]
mov dword [esp + 0x30], 0
mov ecx, dword [esp + 0x30]
add esp, 0xc
cmp eax, 0xc00
jb 0x5140ed
mov eax, 0xaaaaaaab
mul dword [esp + 0x30]
shr edx, 0xb
mov dword [esp + 0x18], edx
push 0xc00
lea eax, [esi + 0x60]
push eax
lea eax, [esi + 0x40]
push eax
mov ecx, edi
call fcn.00512f90
mov ecx, dword [esp + 0x20]
push esi
push ecx
push 0xc0
push ebp
push edi
call dword [esp + 0x54]
sub dword [esp + 0x50], 0xc00
add ebx, 0xc0
mov edx, ebx
mov eax, ebx
mov ecx, ebx
shr edx, 0x18
shr eax, 0x10
shr ecx, 8
add esp, 0x20
add ebp, 0xc00
add edi, 0xc00
dec dword [esp + 0x18]
mov byte [esi + 0xc], dl
mov byte [esi + 0xd], al
mov byte [esi + 0xe], cl
mov byte [esi + 0xf], bl
jne 0x514082
mov ecx, dword [esp + 0x24]
mov eax, dword [esp + 0x30]
mov edx, eax
and edx, 0xfffffff0
mov dword [esp + 0x1c], edx
je 0x514154
mov eax, edx
push edx
shr eax, 4
lea edx, [esi + 0x60]
mov dword [esp + 0x1c], eax
push edx
lea eax, [esi + 0x40]
push eax
mov ecx, edi
call fcn.00512f90
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + 0x24]
push esi
push ecx
push edx
push ebp
push edi
call dword [esp + 0x54]
add ebx, dword [esp + 0x38]
add esp, 0x20
mov eax, ebx
shr eax, 0x18
mov ecx, ebx
shr ecx, 0x10
mov byte [esi + 0xc], al
mov eax, dword [esp + 0x1c]
mov edx, ebx
shr edx, 8
mov byte [esi + 0xd], cl
mov ecx, dword [esp + 0x24]
add ebp, eax
add edi, eax
sub dword [esp + 0x30], eax
mov byte [esi + 0xe], dl
mov byte [esi + 0xf], bl
cmp dword [esp + 0x30], 0
je 0x5141cb
mov eax, dword [esp + 0x14]
mov edx, dword [esi + 0x170]
push eax
lea ecx, [esi + 0x10]
push ecx
push esi
call edx
inc ebx
mov edx, ebx
shr edx, 8
mov eax, ebx
shr eax, 0x18
mov byte [esi + 0xe], dl
mov edx, dword [esp + 0x1c]
mov ecx, ebx
shr ecx, 0x10
mov byte [esi + 0xc], al
add esp, 0xc
lea eax, [edx + ebp]
mov byte [esi + 0xd], cl
mov byte [esi + 0xf], bl
lea edx, [edx + esi + 0x10]
sub edi, ebp
lea esp, [esp]
mov cl, byte [edi + eax]
mov ebx, dword [esp + 0x24]
mov ebp, dword [esp + 0x30]
inc dword [esp + 0x24]
mov byte [esi + ebx + 0x178], cl
mov bl, byte [edx]
xor bl, cl
dec ebp
mov byte [eax], bl
inc edx
inc eax
mov dword [esp + 0x30], ebp
test ebp, ebp
jne 0x5141a0
mov ecx, dword [esp + 0x24]
pop edi
pop ebp
pop ebx
mov dword [esi + 0x168], ecx
xor eax, eax
pop esi
add esp, 0x10
ret
or eax, 0xffffffff
pop esi
add esp, 0x10
ret