Function at 0x584e70
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x30
mov eax, dword [0x6ba00c]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x10]
push ebx
push esi
mov esi, dword [ebp + 8]
mov dword [ebp - 0x1c], eax
push edi
mov dword [ebp - 0x2c], esi
mov bl, byte [esi]
mov ecx, dword [esi + 0x28]
mov eax, dword [esi + 0x2c]
mov byte [ebp - 0x15], bl
mov dword [ebp - 0x20], ecx
mov dword [ebp - 0x24], eax
test bl, 0x40
jne 0x584eb0
push eax
lea eax, [esi + 0x10]
push eax
push esi
call ecx
add esp, 0xc
movzx eax, bl
mov edx, 0xf
and eax, 7
xor ecx, ecx
sub edx, eax
mov byte [esi], al
mov dword [ebp - 0x30], edx
cmp edx, 0xf
jae 0x584ee3
nop dword [eax]
movzx eax, byte [esi + edx]
or ecx, eax
mov byte [esi + edx], 0
inc edx
shl ecx, 8
cmp edx, 0xf
jb 0x584ed0
movzx eax, byte [esi + 0xf]
mov edi, dword [ebp + 0x14]
or ecx, eax
mov byte [esi + 0xf], 1
cmp ecx, edi
je 0x584f08
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0049ae07
mov esp, ebp
pop ebp
ret
mov ebx, dword [ebp + 0xc]
cmp edi, 0x10
jb 0x584f7b
mov eax, edi
shr eax, 4
mov dword [ebp - 0x28], eax
push dword [ebp - 0x24]
lea eax, [ebp - 0x14]
push eax
push esi
call dword [ebp - 0x20]
push esi
call fcn.00585890
mov ecx, dword [ebx]
mov eax, dword [ebx + 4]
mov edx, dword [ebp - 0x1c]
xor eax, dword [ebp - 0x10]
xor ecx, dword [ebp - 0x14]
push dword [ebp - 0x24]
mov dword [edx + 4], eax
mov dword [edx], ecx
xor dword [esi + 0x14], eax
xor dword [esi + 0x10], ecx
mov ecx, dword [ebx + 8]
mov eax, dword [ebx + 0xc]
xor eax, dword [ebp - 8]
xor ecx, dword [ebp - 0xc]
mov dword [edx + 0xc], eax
mov dword [edx + 8], ecx
xor dword [esi + 0x1c], eax
lea eax, [esi + 0x10]
xor dword [esi + 0x18], ecx
push eax
push eax
call dword [ebp - 0x20]
add dword [ebp - 0x1c], 0x10
add esp, 0x1c
add ebx, 0x10
sub edi, 0x10
sub dword [ebp - 0x28], 1
jne 0x584f18
mov dword [ebp + 0x14], edi
test edi, edi
je 0x584fd9
push dword [ebp - 0x24]
lea eax, [ebp - 0x14]
push eax
push esi
call dword [ebp - 0x20]
xor edi, edi
add esp, 0xc
cmp dword [ebp + 0x14], edi
jbe 0x584fc7
lea eax, [ebp - 0x14]
sub ebx, eax
sub dword [ebp - 0x1c], eax
lea eax, [esi + 0x10]
mov esi, dword [ebp + 0x14]
mov dword [ebp - 0x28], eax
lea ecx, [ebp - 0x14]
add ecx, edi
movzx edx, byte [ebx + ecx]
movzx eax, byte [ecx]
xor edx, eax
mov eax, dword [ebp - 0x1c]
mov byte [eax + ecx], dl
mov eax, dword [ebp - 0x28]
xor byte [eax + edi], dl
inc edi
cmp edi, esi
jb 0x584fa5
mov esi, dword [ebp - 0x2c]
push dword [ebp - 0x24]
mov ebx, dword [ebp - 0x20]
lea eax, [esi + 0x10]
push eax
push eax
call ebx
add esp, 0xc
jmp 0x584fdc
mov ebx, dword [ebp - 0x20]
mov edx, dword [ebp - 0x30]
cmp edx, 0x10
jae 0x584ffe
mov ecx, 0x10
lea edi, [edx + esi]
sub ecx, edx
xor eax, eax
mov edx, ecx
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
push dword [ebp - 0x24]
lea eax, [ebp - 0x14]
push eax
push esi
call ebx
mov eax, dword [ebp - 0x14]
add esp, 0xc
xor dword [esi + 0x10], eax
mov eax, dword [ebp - 0x10]
xor dword [esi + 0x14], eax
mov eax, dword [ebp - 0xc]
xor dword [esi + 0x18], eax
mov eax, dword [ebp - 8]
xor dword [esi + 0x1c], eax
mov al, byte [ebp - 0x15]
mov ecx, dword [ebp - 4]
pop edi
mov byte [esi], al
xor ecx, ebp
pop esi
xor eax, eax
pop ebx
call fcn.0049ae07
mov esp, ebp
pop ebp
ret