Function at 0x5a22e0
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x641b1d
mov eax, dword fs:[0]
push eax
sub esp, 0x28
push ebx
push esi
push edi
mov eax, dword [0x6a6040]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
call fcn.00409430
mov eax, dword [esi + 4]
lea ecx, [ebp - 0x10]
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x34], ecx
mov dword [ebp - 0x30], eax
mov dword [ebp - 4], 0
mov eax, dword [esi + 0x18]
test al, 1
je 0x5a233d
mov esi, 2
jmp 0x5a24f0
xor ebx, ebx
test al, 2
jne 0x5a2385
mov ebx, dword [ebp + 8]
lea ecx, [ebx + 4]
call fcn.005acb50
mov ecx, ebx
mov edi, eax
call fcn.005acb50
xor eax, edi
xor edx, edx
div dword [esi + 0x10]
mov eax, dword [esi + 0x14]
mov edi, dword [eax + edx*4]
lea ebx, [eax + edx*4]
test edi, edi
je 0x5a2385
nop dword [eax + eax]
push dword [ebp + 8]
lea ecx, [edi + 4]
call fcn.00595bd0
test al, al
jne 0x5a23ac
mov edi, dword [edi]
test edi, edi
jne 0x5a2370
mov edx, dword [esi + 0xc]
mov eax, dword [esi + 8]
cmp edx, eax
jb 0x5a24ae
mov edi, 2
lea ecx, [eax + eax]
cmp eax, edi
cmovb ecx, edi
cmp ecx, edx
jae 0x5a23b6
lea esi, [edi + 1]
jmp 0x5a24f0
mov esi, 1
jmp 0x5a24f0
push dword [esi + 0x18]
mov eax, dword [esi]
push esi
push ecx
mov ecx, esi
call dword [eax + 8]
mov ebx, eax
mov dword [ebp - 0x24], ebx
test ebx, ebx
je 0x5a24c6
mov cl, byte [ebx + 0x18]
not cl
test cl, 1
je 0x5a24c6
cmp dword [esi + 0x14], 0
je 0x5a247c
xor edi, edi
mov dword [ebp - 0x18], edi
cmp dword [esi + 0x10], edi
jbe 0x5a247c
xor ecx, ecx
xor edx, edx
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 0x20], edx
nop
mov eax, dword [esi + 0x14]
mov ecx, dword [ecx + eax]
mov dword [ebp - 0x14], ecx
test ecx, ecx
je 0x5a245a
nop dword [eax]
mov eax, dword [ecx]
lea ebx, [ecx + 4]
dec dword [esi + 0xc]
lea ecx, [ebx + 4]
mov dword [ebp - 0x28], eax
call fcn.005acb50
mov ecx, ebx
mov edi, eax
call fcn.005acb50
mov ebx, dword [ebp - 0x24]
xor eax, edi
xor edx, edx
div dword [ebx + 0x10]
mov eax, dword [ebx + 0x14]
lea ecx, [eax + edx*4]
mov edx, dword [ebp - 0x14]
mov eax, dword [ecx]
mov dword [edx], eax
mov eax, dword [ebp - 0x28]
mov dword [ecx], edx
mov ecx, eax
inc dword [ebx + 0xc]
mov dword [ebp - 0x14], eax
test eax, eax
jne 0x5a2410
mov edx, dword [ebp - 0x20]
mov edi, dword [ebp - 0x18]
mov eax, dword [esi + 0x14]
inc edi
mov ecx, dword [ebp - 0x1c]
add ecx, 4
mov dword [ebp - 0x18], edi
mov dword [ebp - 0x1c], ecx
mov dword [edx + eax], 0
add edx, 4
mov dword [ebp - 0x20], edx
cmp edi, dword [esi + 0x10]
jb 0x5a2400
mov eax, dword [esi]
mov ecx, esi
push ebx
call dword [eax + 4]
mov eax, dword [ebx]
mov ecx, ebx
push 1
call dword [eax + 0xc]
mov ebx, dword [ebp + 8]
lea ecx, [ebx + 4]
call fcn.005acb50
mov ecx, ebx
mov edi, eax
call fcn.005acb50
xor eax, edi
xor edx, edx
div dword [esi + 0x10]
mov eax, dword [esi + 0x14]
lea ebx, [eax + edx*4]
push ecx
lea ecx, [esi + 4]
push ecx
mov ecx, dword [ecx]
call fcn.005a2ea0
mov dword [ebp - 0x10], eax
test eax, eax
jne 0x5a24ca
lea esi, [eax + 2]
jmp 0x5a24f0
mov esi, edi
jmp 0x5a24f0
push dword [ebp + 0xc]
mov ecx, dword [ebp - 0x10]
push dword [ebp + 8]
call fcn.005a2ff0
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebx]
mov dword [eax], ecx
mov eax, dword [ebp - 0x10]
mov dword [ebx], eax
inc dword [esi + 0xc]
xor esi, esi
mov dword [ebp - 0x10], 0
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x5a2505
push ecx
lea ecx, [ebp - 0x30]
push ecx
mov ecx, dword [ebp - 0x2c]
push eax
call fcn.005a2d90
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc