Function at 0x5a1630
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
push ebx
push esi
push edi
mov esi, ecx
xor ebx, ebx
lea ebx, [ebx]
mov eax, dword [esi + 0x6c]
cmp eax, 0x106
jae 0x5a166e
mov ecx, esi
call fcn.0059f4c0
mov eax, dword [esi + 0x6c]
mov edi, dword [ebp + 8]
cmp eax, 0x106
jae 0x5a1666
test edi, edi
je 0x5a17dc
test eax, eax
je 0x5a17e5
cmp eax, 3
jb 0x5a16af
mov eax, dword [esi + 0x40]
mov ecx, dword [esi + 0x50]
mov edx, dword [esi + 0x64]
shl eax, cl
mov ecx, dword [esi + 0x28]
movzx ecx, byte [ecx + edx + 2]
xor eax, ecx
and eax, dword [esi + 0x4c]
mov ecx, dword [esi + 0x38]
mov dword [esi + 0x40], eax
movzx ebx, word [ecx + eax*2]
mov eax, dword [esi + 0x24]
mov ecx, dword [esi + 0x30]
and eax, edx
mov word [ecx + eax*2], bx
mov edx, dword [esi + 0x40]
mov eax, dword [esi + 0x38]
mov cx, word [esi + 0x64]
mov word [eax + edx*2], cx
test ebx, ebx
je 0x5a16d8
mov edx, dword [esi + 0x64]
mov eax, dword [esi + 0x1c]
sub edx, ebx
sub eax, 0x106
cmp edx, eax
ja 0x5a16d8
cmp dword [esi + 0x80], 2
je 0x5a16d8
push ebx
mov ecx, esi
call fcn.005a0330
mov dword [esi + 0x58], eax
mov eax, dword [esi + 0x58]
cmp eax, 3
jb 0x5a177f
mov ecx, dword [esi + 0x64]
sub ecx, dword [esi + 0x68]
add eax, 0xfffffffd
push eax
push ecx
mov ecx, esi
call fcn.005a06a0
mov ecx, dword [esi + 0x58]
sub dword [esi + 0x6c], ecx
mov edx, dword [esi + 0x6c]
cmp ecx, dword [esi + 0x78]
ja 0x5a1756
cmp edx, 3
jb 0x5a1756
dec ecx
mov dword [esi + 0x58], ecx
lea ecx, [ecx]
inc dword [esi + 0x64]
mov edi, dword [esi + 0x64]
mov ebx, dword [esi + 0x40]
mov ecx, dword [esi + 0x50]
mov edx, dword [esi + 0x28]
movzx edx, byte [edi + edx + 2]
shl ebx, cl
mov ecx, dword [esi + 0x38]
xor edx, ebx
and edx, dword [esi + 0x4c]
mov dword [esi + 0x40], edx
movzx ebx, word [ecx + edx*2]
mov edx, dword [esi + 0x24]
mov ecx, dword [esi + 0x30]
and edx, edi
mov word [ecx + edx*2], bx
mov edx, dword [esi + 0x40]
mov ecx, dword [esi + 0x38]
mov di, word [esi + 0x64]
mov word [ecx + edx*2], di
dec dword [esi + 0x58]
jne 0x5a1710
jmp 0x5a1796
add dword [esi + 0x64], ecx
mov edi, dword [esi + 0x64]
add edi, dword [esi + 0x28]
mov ecx, dword [esi + 0x50]
mov dword [esi + 0x58], 0
movzx edx, byte [edi]
mov dword [esi + 0x40], edx
shl edx, cl
movzx ecx, byte [edi + 1]
xor edx, ecx
and edx, dword [esi + 0x4c]
mov dword [esi + 0x40], edx
jmp 0x5a1799
mov edx, dword [esi + 0x64]
mov eax, dword [esi + 0x28]
movzx ecx, byte [edx + eax]
push ecx
push 0
mov ecx, esi
call fcn.005a06a0
dec dword [esi + 0x6c]
inc dword [esi + 0x64]
test eax, eax
je 0x5a1640
mov ecx, dword [esi + 0x54]
test ecx, ecx
js 0x5a17af
mov eax, dword [esi + 0x28]
add eax, ecx
jmp 0x5a17b1
xor eax, eax
mov edx, dword [esi + 0x64]
push 0
sub edx, ecx
push edx
push eax
mov ecx, esi
call fcn.005a1430
mov eax, dword [esi + 0x64]
mov ecx, dword [esi + 4]
mov dword [esi + 0x54], eax
call fcn.0056aab0
mov ecx, dword [esi + 4]
cmp dword [ecx + 0x24], 0
jne 0x5a1640
pop edi
pop esi
xor eax, eax
pop ebx
pop ebp
ret 4
mov ecx, dword [esi + 0x54]
test ecx, ecx
js 0x5a17f3
mov eax, dword [esi + 0x28]
add eax, ecx
jmp 0x5a17f5
xor eax, eax
xor edx, edx
cmp edi, 4
sete dl
push edx
mov edx, dword [esi + 0x64]
sub edx, ecx
push edx
push eax
mov ecx, esi
call fcn.005a1430
mov eax, dword [esi + 0x64]
mov ecx, dword [esi + 4]
mov dword [esi + 0x54], eax
call fcn.0056aab0
mov ecx, dword [esi + 4]
xor eax, eax
cmp dword [ecx + 0x24], eax
jne 0x5a1835
cmp edi, 4
setne al
pop edi
pop esi
pop ebx
dec eax
and eax, 2
pop ebp
ret 4
cmp edi, 4
sete al
pop edi
pop esi
pop ebx
lea eax, [eax + eax + 1]
pop ebp
ret 4