Function at 0x585790
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x24
mov eax, dword [esp + 0x34]
mov ecx, 0x10
cdq
idiv ecx
push ebx
mov ebx, dword [esp + 0x30]
mov ecx, edx
mov dword [esp + 0x30], ecx
push edi
mov edi, eax
test ecx, ecx
je 0x5857bc
test edi, edi
jne 0x5857bb
pop edi
pop ebx
add esp, 0x24
ret
dec edi
mov edx, dword [esp + 0x30]
push ebp
mov ebp, dword [esp + 0x44]
push esi
lea eax, [edx + 8]
mov dword [esp + 0x10], eax
test edi, edi
je 0x58582a
mov esi, dword [esp + 0x40]
mov eax, dword [ebx]
xor eax, dword [ebp]
mov dword [esp + 0x24], eax
mov eax, dword [ebp + 4]
xor eax, dword [ebx + 4]
mov dword [esp + 0x28], eax
mov eax, dword [ebp + 8]
xor eax, dword [ebx + 8]
mov dword [esp + 0x2c], eax
mov eax, dword [ebp + 0xc]
xor eax, dword [ebx + 0xc]
mov dword [esp + 0x30], eax
lea eax, [esp + 0x24]
push esi
push eax
push dword [edx + 4]
lea eax, [edx + 8]
push eax
call fcn.005848d0
mov edx, dword [esp + 0x48]
mov ebp, esi
add esp, 0x10
add ebx, 0x10
add esi, 0x10
sub edi, 1
jne 0x5857d5
mov ecx, dword [esp + 0x3c]
mov dword [esp + 0x40], esi
test ecx, ecx
je 0x585971
mov ecx, dword [ebx]
mov eax, dword [ebp]
mov edx, dword [ebx + 4]
xor eax, ecx
mov esi, dword [ebx + 8]
mov edi, dword [ebx + 0xc]
mov dword [esp + 0x24], eax
mov eax, dword [ebp + 4]
xor eax, edx
mov dword [esp + 0x28], eax
mov eax, dword [ebp + 8]
xor eax, esi
mov dword [esp + 0x2c], eax
mov eax, dword [ebp + 0xc]
xor eax, edi
mov dword [esp + 0x30], eax
lea eax, [esp + 0x14]
push eax
lea eax, [esp + 0x28]
push eax
mov eax, dword [esp + 0x40]
push dword [eax + 4]
push dword [esp + 0x1c]
call fcn.005848d0
mov ebp, dword [esp + 0x4c]
add esp, 0x10
mov edi, dword [esp + 0x40]
xor edx, edx
test ebp, ebp
je 0x585939
cmp ebp, 0x10
jb 0x585919
lea esi, [edi + 0xf]
lea ecx, [edi + 0x10]
add esi, ebp
lea eax, [esp + ebp + 0x13]
cmp ecx, eax
ja 0x5858b1
lea eax, [esp + 0x14]
cmp esi, eax
jae 0x585919
lea edi, [ebp + 0xf]
add edi, ebx
lea eax, [ebx + 0x10]
cmp ecx, edi
mov edi, dword [esp + 0x40]
ja 0x5858c5
cmp esi, eax
jae 0x585919
lea esi, [esp + 0x14]
mov dword [esp + 0x40], esi
lea esi, [ebp + 0xf]
add esi, ebx
cmp dword [esp + 0x40], esi
ja 0x5858e0
lea esi, [esp + ebp + 0x13]
cmp esi, eax
jae 0x585919
mov eax, ebp
mov esi, ebp
and eax, 0xf
sub esi, eax
mov eax, ebx
sub eax, edi
nop dword [eax]
movups xmm1, xmmword [esp + edx + 0x14]
lea ecx, [ecx + 0x10]
movups xmm0, xmmword [eax + ecx - 0x10]
movups xmmword [ecx - 0x10], xmm1
pxor xmm0, xmm1
movups xmmword [esp + edx + 0x14], xmm0
add edx, 0x10
cmp edx, esi
jb 0x5858f0
mov dword [esp + 0x40], edx
cmp edx, ebp
jae 0x585939
lea esi, [edi + 0x10]
add esi, edx
sub ebx, edi
mov cl, byte [esp + edx + 0x14]
lea esi, [esi + 1]
mov al, byte [esi + ebx - 1]
xor al, cl
mov byte [esi - 1], cl
mov byte [esp + edx + 0x14], al
inc edx
cmp edx, ebp
jb 0x585920
lea eax, [esp + 0x14]
push eax
push eax
mov eax, dword [esp + 0x40]
push dword [eax + 4]
push dword [esp + 0x1c]
call fcn.005848d0
mov eax, dword [esp + 0x24]
lea ebp, [esp + 0x24]
mov dword [edi], eax
add esp, 0x10
mov eax, dword [esp + 0x18]
mov dword [edi + 4], eax
mov eax, dword [esp + 0x1c]
mov dword [edi + 8], eax
mov eax, dword [esp + 0x20]
mov dword [edi + 0xc], eax
mov eax, dword [esp + 0x48]
mov ecx, dword [ebp]
pop esi
mov dword [eax], ecx
mov ecx, dword [ebp + 4]
mov dword [eax + 4], ecx
mov ecx, dword [ebp + 8]
mov dword [eax + 8], ecx
mov ecx, dword [ebp + 0xc]
pop ebp
pop edi
mov dword [eax + 0xc], ecx
mov eax, dword [esp + 0x38]
pop ebx
add esp, 0x24
ret