Function at 0x580d3b
Capabilities:
Encode data using xor

Disassembly:
mov ecx, dword [esp + 8]
push edi
mov edi, dword [esp + 0x14]
cmp ecx, 0x10
je 0x580d5b
cmp ecx, 0x18
je 0x580d5b
cmp ecx, 0x20
je 0x580d5b
push 3
pop eax
jmp 0x58120d
cmp dword [esp + 0x10], 0
je 0x580d7e
mov eax, ecx
cdq
and edx, 7
add eax, edx
sar eax, 3
lea eax, [eax*2 + 6]
cmp dword [esp + 0x10], eax
je 0x580d7e
push 4
jmp 0x580d55
mov eax, ecx
cdq
and edx, 7
add eax, edx
mov edx, dword [esp + 8]
sar eax, 3
push ebx
push ebp
push esi
lea eax, [eax*2 + 6]
mov dword [edi + 0x1e0], eax
movzx ebx, byte [edx]
movzx eax, byte [edx + 1]
shl ebx, 8
or ebx, eax
movzx eax, byte [edx + 2]
shl ebx, 8
or ebx, eax
movzx eax, byte [edx + 3]
shl ebx, 8
or ebx, eax
mov dword [edi], ebx
movzx ebp, byte [edx + 4]
movzx eax, byte [edx + 5]
shl ebp, 8
or ebp, eax
mov dword [esp + 0x1c], ebx
movzx eax, byte [edx + 6]
lea ebx, [edi + 4]
shl ebp, 8
or ebp, eax
movzx eax, byte [edx + 7]
shl ebp, 8
or ebp, eax
mov dword [ebx], ebp
movzx esi, byte [edx + 8]
movzx eax, byte [edx + 9]
shl esi, 8
or esi, eax
mov dword [esp + 0x18], ebp
movzx eax, byte [edx + 0xa]
shl esi, 8
or esi, eax
movzx eax, byte [edx + 0xb]
shl esi, 8
or esi, eax
mov dword [edi + 8], esi
movzx ebp, byte [edx + 0xc]
movzx eax, byte [edx + 0xd]
shl ebp, 8
or ebp, eax
movzx eax, byte [edx + 0xe]
shl ebp, 8
or ebp, eax
movzx eax, byte [edx + 0xf]
shl ebp, 8
or ebp, eax
mov dword [edi + 0xc], ebp
cmp ecx, 0x10
jne 0x580e9d
push ebp
call fcn.00581de7
xor eax, dword [esp + 0x1c]
xor eax, 0x1000000
mov dword [edi + 0x10], eax
xor eax, dword [esp + 0x18]
xor esi, eax
mov dword [edi + 0x14], eax
mov dword [edi + 0x18], esi
xor esi, ebp
push 4
mov dword [edi + 0x1c], esi
mov edi, 0x71a31c
pop ebp
lea ebx, [ebx + 0x10]
mov esi, dword [ebx + 8]
push esi
call fcn.00581de7
xor eax, dword [ebx - 4]
xor eax, dword [edi]
add edi, ebp
mov dword [ebx + 0xc], eax
mov ecx, dword [ebx]
xor ecx, eax
mov dword [ebx + 0x10], ecx
mov eax, dword [ebx + 4]
xor eax, ecx
xor esi, eax
mov dword [ebx + 0x14], eax
mov dword [ebx + 0x18], esi
cmp edi, 0x71a340
jne 0x580e5d
mov edi, dword [esp + 0x20]
mov eax, 0xa0
jmp 0x5810b0
cmp ecx, 0x18
jne 0x580f7b
movzx ecx, byte [edx + 0x10]
movzx eax, byte [edx + 0x11]
shl ecx, 8
or ecx, eax
movzx eax, byte [edx + 0x12]
shl ecx, 8
or ecx, eax
movzx eax, byte [edx + 0x13]
shl ecx, 8
or ecx, eax
mov dword [edi + 0x10], ecx
movzx ecx, byte [edx + 0x14]
movzx eax, byte [edx + 0x15]
shl ecx, 8
or ecx, eax
movzx eax, byte [edx + 0x16]
shl ecx, 8
or ecx, eax
movzx eax, byte [edx + 0x17]
shl ecx, 8
or ecx, eax
push ecx
mov dword [edi + 0x14], ecx
call fcn.00581de7
xor eax, dword [esp + 0x1c]
mov ebx, 0x71a31c
xor eax, 0x1000000
mov dword [edi + 0x18], eax
xor eax, dword [esp + 0x18]
push 0xffffffffffffffd8
mov dword [edi + 0x1c], eax
xor eax, esi
pop edx
xor ebp, eax
mov dword [edi + 0x20], eax
sub edx, edi
mov dword [edi + 0x24], ebp
push 4
lea esi, [edi + 0x28]
mov dword [esp + 0x20], edx
pop ebp
mov ecx, dword [esi - 0x18]
xor ecx, dword [esi - 4]
mov eax, dword [esi - 0x14]
xor eax, ecx
mov dword [esi], ecx
mov dword [esi + 4], eax
lea esi, [esi + 0x18]
lea eax, [esi + edx]
sar eax, 2
push dword [edi + eax*4 + 0x14]
call fcn.00581de7
xor eax, dword [esi - 0x28]
xor eax, dword [ebx]
add ebx, ebp
mov dword [esi - 0x10], eax
mov ecx, dword [esi - 0x24]
xor ecx, eax
mov dword [esi - 0xc], ecx
mov edx, dword [esi - 0x20]
xor edx, ecx
mov dword [esi - 8], edx
mov eax, dword [esi - 0x1c]
xor eax, edx
mov edx, dword [esp + 0x1c]
mov dword [esi - 4], eax
cmp ebx, 0x71a338
jne 0x580f21
mov eax, 0xc0
jmp 0x5810b0
cmp ecx, 0x20
jne 0x581207
movzx ecx, byte [edx + 0x10]
movzx eax, byte [edx + 0x11]
shl ecx, 8
or ecx, eax
movzx eax, byte [edx + 0x12]
shl ecx, 8
or ecx, eax
movzx eax, byte [edx + 0x13]
shl ecx, 8
or ecx, eax
mov dword [edi + 0x10], ecx
movzx ecx, byte [edx + 0x14]
movzx eax, byte [edx + 0x15]
shl ecx, 8
or ecx, eax
movzx eax, byte [edx + 0x16]
shl ecx, 8
or ecx, eax
movzx eax, byte [edx + 0x17]
shl ecx, 8
or ecx, eax
mov dword [edi + 0x14], ecx
movzx ecx, byte [edx + 0x18]
movzx eax, byte [edx + 0x19]
shl ecx, 8
or ecx, eax
movzx eax, byte [edx + 0x1a]
shl ecx, 8
or ecx, eax
movzx eax, byte [edx + 0x1b]
shl ecx, 8
or ecx, eax
mov dword [edi + 0x18], ecx
movzx ecx, byte [edx + 0x1c]
movzx eax, byte [edx + 0x1d]
shl ecx, 8
or ecx, eax
movzx eax, byte [edx + 0x1e]
shl ecx, 8
or ecx, eax
movzx eax, byte [edx + 0x1f]
shl ecx, 8
or ecx, eax
push ecx
mov dword [edi + 0x1c], ecx
call fcn.00581de7
xor eax, dword [esp + 0x1c]
mov ebx, 0x71a31c
xor eax, 0x1000000
mov dword [edi + 0x20], eax
xor eax, dword [esp + 0x18]
mov dword [edi + 0x24], eax
xor eax, esi
xor ebp, eax
mov dword [edi + 0x28], eax
push 0xffffffffffffffd0
pop eax
sub eax, edi
mov dword [edi + 0x2c], ebp
push 4
lea esi, [edi + 0x30]
mov dword [esp + 0x20], eax
pop ebp
mov eax, dword [esi - 4]
ror eax, 8
push eax
call fcn.00581de7
xor eax, dword [esi - 0x20]
mov ecx, dword [esi - 0x1c]
mov edx, dword [esi - 0x18]
xor ecx, eax
mov dword [esi], eax
xor edx, ecx
mov eax, dword [esi - 0x14]
xor eax, edx
mov dword [esi + 4], ecx
mov dword [esi + 0xc], eax
mov eax, dword [esp + 0x1c]
mov dword [esi + 8], edx
add esi, 0x20
add eax, esi
sar eax, 2
push dword [edi + eax*4 + 0x1c]
call fcn.00581de7
xor eax, dword [esi - 0x30]
xor eax, dword [ebx]
add ebx, ebp
mov dword [esi - 0x10], eax
mov ecx, dword [esi - 0x2c]
xor ecx, eax
mov dword [esi - 0xc], ecx
mov edx, dword [esi - 0x28]
xor edx, ecx
mov dword [esi - 8], edx
mov eax, dword [esi - 0x24]
xor eax, edx
mov dword [esi - 4], eax
cmp ebx, 0x71a334
jne 0x581043
mov eax, 0xe0
lea ebx, [edi + eax]
lea esi, [edi + 0xf0]
mov ecx, ebx
mov edx, esi
mov eax, dword [ecx]
add ecx, ebp
mov dword [edx], eax
add edx, ebp
mov eax, dword [ecx]
mov dword [edx], eax
mov eax, dword [ecx + ebp]
mov dword [edx + ebp], eax
mov eax, dword [ecx + ebp + 4]
mov dword [edx + ebp + 4], eax
cmp dword [edi + 0x1e0], 1
jle 0x5811e3
xor ebp, ebp
inc ebp
sub ebx, 0x10
add esi, 0x10
mov edx, dword [ebx]
mov eax, edx
shr eax, 0x10
movzx ecx, al
mov eax, edx
shr eax, 8
movzx eax, al
mov ecx, dword [ecx*4 + 0x719718]
xor ecx, dword [eax*4 + 0x719b18]
mov eax, edx
shr eax, 0x18
xor ecx, dword [eax*4 + 0x719318]
movzx eax, dl
xor ecx, dword [eax*4 + 0x719f18]
mov dword [esi], ecx
mov edx, dword [ebx + 4]
mov eax, edx
shr eax, 0x10
movzx ecx, al
mov eax, edx
shr eax, 8
movzx eax, al
mov ecx, dword [ecx*4 + 0x719718]
xor ecx, dword [eax*4 + 0x719b18]
mov eax, edx
shr eax, 0x18
xor ecx, dword [eax*4 + 0x719318]
movzx eax, dl
xor ecx, dword [eax*4 + 0x719f18]
mov dword [esi + 4], ecx
mov edx, dword [ebx + 8]
mov eax, edx
shr eax, 0x10
movzx ecx, al
mov eax, edx
shr eax, 8
movzx eax, al
mov ecx, dword [ecx*4 + 0x719718]
xor ecx, dword [eax*4 + 0x719b18]
mov eax, edx
shr eax, 0x18
xor ecx, dword [eax*4 + 0x719318]
movzx eax, dl
xor ecx, dword [eax*4 + 0x719f18]
mov dword [esi + 8], ecx
mov edx, dword [ebx + 0xc]
mov eax, edx
shr eax, 0x10
movzx ecx, al
mov eax, edx
shr eax, 8
movzx eax, al
mov ecx, dword [ecx*4 + 0x719718]
xor ecx, dword [eax*4 + 0x719b18]
mov eax, edx
shr eax, 0x18
xor ecx, dword [eax*4 + 0x719318]
movzx eax, dl
xor ecx, dword [eax*4 + 0x719f18]
inc ebp
mov dword [esi + 0xc], ecx
cmp ebp, dword [edi + 0x1e0]
jl 0x5810e7
push 4
pop ebp
sub ebx, 0x10
add esi, 0x10
mov eax, dword [ebx]
add ebx, ebp
mov dword [esi], eax
add esi, ebp
mov eax, dword [ebx]
mov dword [esi], eax
mov eax, dword [ebx + ebp]
mov dword [esi + ebp], eax
mov eax, dword [ebx + ebp + 4]
mov dword [esi + ebp + 4], eax
xor eax, eax
jmp 0x58120a
xor eax, eax
inc eax
pop esi
pop ebp
pop ebx
pop edi
ret 0x10