Function at 0x595910
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 0x59594e
mov ecx, esi
call fcn.005937a0
mov eax, dword [esi + 0x6c]
mov edi, dword [ebp + 8]
cmp eax, 0x106
jae 0x595946
test edi, edi
je 0x595abc
test eax, eax
je 0x595ac5
cmp eax, 3
jb 0x59598f
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 0x5959b8
mov edx, dword [esi + 0x64]
mov eax, dword [esi + 0x1c]
sub edx, ebx
sub eax, 0x106
cmp edx, eax
ja 0x5959b8
cmp dword [esi + 0x80], 2
je 0x5959b8
push ebx
mov ecx, esi
call fcn.00594610
mov dword [esi + 0x58], eax
mov eax, dword [esi + 0x58]
cmp eax, 3
jb 0x595a5f
mov ecx, dword [esi + 0x64]
sub ecx, dword [esi + 0x68]
add eax, 0xfffffffd
push eax
push ecx
mov ecx, esi
call fcn.00594980
mov ecx, dword [esi + 0x58]
sub dword [esi + 0x6c], ecx
mov edx, dword [esi + 0x6c]
cmp ecx, dword [esi + 0x78]
ja 0x595a36
cmp edx, 3
jb 0x595a36
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 0x5959f0
jmp 0x595a76
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 0x595a79
mov edx, dword [esi + 0x64]
mov eax, dword [esi + 0x28]
movzx ecx, byte [edx + eax]
push ecx
push 0
mov ecx, esi
call fcn.00594980
dec dword [esi + 0x6c]
inc dword [esi + 0x64]
test eax, eax
je 0x595920
mov ecx, dword [esi + 0x54]
test ecx, ecx
js 0x595a8f
mov eax, dword [esi + 0x28]
add eax, ecx
jmp 0x595a91
xor eax, eax
mov edx, dword [esi + 0x64]
push 0
sub edx, ecx
push edx
push eax
mov ecx, esi
call fcn.00595710
mov eax, dword [esi + 0x64]
mov ecx, dword [esi + 4]
mov dword [esi + 0x54], eax
call fcn.0055ed70
mov ecx, dword [esi + 4]
cmp dword [ecx + 0x24], 0
jne 0x595920
pop edi
pop esi
xor eax, eax
pop ebx
pop ebp
ret 4
mov ecx, dword [esi + 0x54]
test ecx, ecx
js 0x595ad3
mov eax, dword [esi + 0x28]
add eax, ecx
jmp 0x595ad5
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.00595710
mov eax, dword [esi + 0x64]
mov ecx, dword [esi + 4]
mov dword [esi + 0x54], eax
call fcn.0055ed70
mov ecx, dword [esi + 4]
xor eax, eax
cmp dword [ecx + 0x24], eax
jne 0x595b15
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