Function at 0x586a64
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x1010
call fcn.0061a4d5
mov eax, dword [0x39985000]
or dword [ebp - 0x1008], 0xffffffff
push esi
xor esi, esi
test byte [ebp + 8], 8
mov dword [ebp - 4], eax
mov dword [ebp - 0x100c], esi
je 0x586ac3
xor ecx, ecx
cmp dword [ebp + 0x14], esi
mov dword [ebp - 0x1008], esi
jbe 0x586abc
mov eax, dword [ebp + 0x10]
movsx eax, byte [ecx + eax]
cdq
xor eax, edx
sub eax, edx
add dword [ebp - 0x1008], eax
inc ecx
cmp ecx, dword [ebp + 0x14]
jb 0x586a9c
cmp dword [ebp - 0x1008], esi
jne 0x586ac3
xor al, al
jmp 0x586e37
push ebx
mov ebx, dword [ebp + 0x18]
cmp dword [ebp + 0x14], ebx
push edi
jbe 0x586b53
test byte [ebp + 8], 0x10
jne 0x586ae2
test byte [ebp + 8], 0x80
je 0x586b53
cmp dword [ebp + 0xc], esi
jne 0x586b5c
xor edi, edi
xor ecx, ecx
cmp ebx, esi
jbe 0x586b02
cmp ecx, dword [ebp + 0x14]
jae 0x586b2f
mov eax, dword [ebp + 0x10]
movsx eax, byte [ecx + eax]
cdq
xor eax, edx
sub eax, edx
add edi, eax
inc ecx
cmp ecx, ebx
jb 0x586aea
cmp ecx, dword [ebp + 0x14]
jae 0x586b2f
mov esi, ecx
sub esi, ebx
add esi, dword [ebp + 0x10]
cmp edi, dword [ebp - 0x1008]
jae 0x586b51
mov eax, dword [ebp + 0x10]
mov al, byte [ecx + eax]
sub al, byte [esi]
movsx eax, al
cdq
xor eax, edx
sub eax, edx
add edi, eax
inc ecx
inc esi
cmp ecx, dword [ebp + 0x14]
jb 0x586b0e
cmp edi, dword [ebp - 0x1008]
jae 0x586b51
xor eax, eax
inc eax
xor esi, esi
cmp edi, esi
mov dword [ebp - 0x1008], edi
mov dword [ebp - 0x100c], eax
jne 0x586b53
jmp 0x586e35
xor esi, esi
cmp dword [ebp + 0xc], esi
je 0x586dc1
test byte [ebp + 8], 0x20
jne 0x586b6d
cmp dword [ebp + 0x14], ebx
ja 0x586bc1
test byte [ebp + 8], 0x80
je 0x586bc1
xor edi, edi
cmp dword [ebp + 0x14], esi
mov dword [ebp + 0x18], esi
jbe 0x586ba2
mov ecx, dword [ebp + 0x10]
mov esi, dword [ebp + 0xc]
sub esi, ecx
cmp edi, dword [ebp - 0x1008]
jae 0x586bc1
mov al, byte [ecx]
sub al, byte [esi + ecx]
movsx eax, al
cdq
xor eax, edx
sub eax, edx
add edi, eax
inc dword [ebp + 0x18]
mov eax, dword [ebp + 0x18]
inc ecx
cmp eax, dword [ebp + 0x14]
jb 0x586b7f
cmp edi, dword [ebp - 0x1008]
jae 0x586bc1
test edi, edi
push 2
pop eax
mov dword [ebp - 0x1008], edi
mov dword [ebp - 0x100c], eax
je 0x586e35
test byte [ebp + 8], 0x40
je 0x586c74
xor esi, esi
test ebx, ebx
mov dword [ebp + 0x18], esi
jbe 0x586bfe
mov ecx, dword [ebp + 0xc]
sub ecx, dword [ebp + 0x10]
cmp esi, dword [ebp + 0x14]
jae 0x586c4e
mov eax, dword [ebp + 0x10]
lea edi, [esi + eax]
mov al, byte [ecx + edi]
mov dl, byte [edi]
shr al, 1
sub dl, al
movsx eax, dl
cdq
xor eax, edx
sub eax, edx
add dword [ebp + 0x18], eax
inc esi
cmp esi, ebx
jb 0x586bda
cmp esi, dword [ebp + 0x14]
jae 0x586c4e
mov eax, dword [ebp + 0x10]
mov ecx, esi
sub ecx, ebx
lea edi, [esi + eax]
add ecx, eax
mov eax, dword [ebp + 0xc]
sub eax, dword [ebp + 0x10]
mov dword [ebp - 0x1010], eax
mov eax, dword [ebp - 0x1008]
cmp dword [ebp + 0x18], eax
jae 0x586c74
movzx edx, byte [ecx]
mov eax, dword [ebp - 0x1010]
movzx eax, byte [edi + eax]
add eax, edx
mov dl, byte [edi]
sar eax, 1
sub dl, al
movsx eax, dl
cdq
xor eax, edx
sub eax, edx
add dword [ebp + 0x18], eax
inc esi
inc ecx
inc edi
cmp esi, dword [ebp + 0x14]
jb 0x586c1b
mov eax, dword [ebp + 0x18]
cmp eax, dword [ebp - 0x1008]
jae 0x586c74
test eax, eax
mov dword [ebp - 0x1008], eax
mov dword [ebp - 0x100c], 3
jne 0x586c74
mov al, 3
jmp 0x586e35
cmp dword [ebp + 0x14], ebx
jbe 0x586e2f
test byte [ebp + 8], 0x80
je 0x586e2f
mov eax, dword [ebp + 0x14]
shl eax, 4
cmp dword [ebp - 0x1008], eax
jbe 0x586e2f
cmp ebx, 0x1000
jbe 0x586ca8
xor al, al
jmp 0x586e35
mov esi, dword [ebp + 0x10]
mov ecx, ebx
mov eax, ecx
shr ecx, 2
lea edi, [ebp - 0x1004]
rep movsd dword es:[edi], dword [esi]
push ebx
push dword [ebp + 0xc]
mov ecx, eax
lea eax, [ebp - 0x1004]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
call fcn.00586957
sub dword [ebp + 0x14], ebx
mov eax, dword [ebp + 0x14]
add dword [ebp + 0x10], ebx
add dword [ebp + 0xc], ebx
shl eax, 2
xor ecx, ecx
test ebx, ebx
mov dword [ebp + 8], eax
jbe 0x586cfe
movsx eax, byte [ebp + ecx - 0x1004]
cdq
xor eax, edx
sub eax, edx
add dword [ebp + 8], eax
inc ecx
cmp ecx, ebx
jb 0x586ce9
cmp dword [ebp + 0x14], 0
jbe 0x586daa
mov dword [ebp + 0x18], 0x1000
sub dword [ebp + 0x18], ebx
mov eax, dword [ebp + 0x14]
mov ecx, dword [ebp + 0x18]
cmp eax, ecx
mov dword [ebp - 0x1010], eax
jbe 0x586d28
mov dword [ebp - 0x1010], ecx
mov eax, dword [ebp - 0x1010]
mov esi, dword [ebp + 0x10]
lea ecx, [eax + ebx]
mov edx, ecx
shr ecx, 2
sub esi, ebx
lea edi, [ebp - 0x1004]
rep movsd dword es:[edi], dword [esi]
push ebx
push eax
push dword [ebp + 0xc]
mov ecx, edx
lea eax, [ebp + ebx - 0x1004]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
call fcn.005869d2
mov esi, dword [ebp - 0x1010]
xor ecx, ecx
test esi, esi
jbe 0x586d8b
mov eax, dword [ebp + 8]
cmp eax, dword [ebp - 0x1008]
jae 0x586d8b
lea eax, [ebp + ebx - 0x1004]
movsx eax, byte [eax + ecx]
cdq
xor eax, edx
sub eax, edx
add dword [ebp + 8], eax
inc ecx
cmp ecx, esi
jb 0x586d68
sub dword [ebp + 0x14], esi
je 0x586daa
mov eax, dword [ebp - 0x1008]
cmp dword [ebp + 8], eax
jae 0x586e2f
add dword [ebp + 0x10], esi
add dword [ebp + 0xc], esi
jmp 0x586d12
mov eax, dword [ebp - 0x1008]
cmp dword [ebp + 8], eax
jae 0x586e2f
mov dword [ebp - 0x100c], 4
jmp 0x586e2f
cmp dword [ebp + 0x14], ebx
jbe 0x586e2f
test byte [ebp + 8], 0x40
je 0x586e2f
xor edi, edi
xor ecx, ecx
cmp ebx, esi
jbe 0x586dec
cmp ecx, dword [ebp + 0x14]
jae 0x586e1d
mov eax, dword [ebp + 0x10]
movsx eax, byte [ecx + eax]
cdq
xor eax, edx
sub eax, edx
add edi, eax
inc ecx
cmp ecx, ebx
jb 0x586dd4
cmp ecx, dword [ebp + 0x14]
jae 0x586e1d
mov esi, ecx
sub esi, ebx
add esi, dword [ebp + 0x10]
cmp edi, dword [ebp - 0x1008]
jae 0x586e2f
mov al, byte [esi]
mov edx, dword [ebp + 0x10]
mov dl, byte [ecx + edx]
shr al, 1
sub dl, al
movsx eax, dl
cdq
xor eax, edx
sub eax, edx
add edi, eax
inc ecx
inc esi
cmp ecx, dword [ebp + 0x14]
jb 0x586df8
cmp edi, dword [ebp - 0x1008]
jae 0x586e2f
mov dword [ebp - 0x100c], 3
mov al, byte [ebp - 0x100c]
pop edi
pop ebx
mov ecx, dword [ebp - 4]
pop esi
call fcn.0061a438
leave
ret 0x14