Function at 0x580570
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x30
mov ebp, edx
mov ebx, ecx
lea eax, [edx + 0xd38]
lea ecx, [edx + 0xa4]
push 0x22d8
push dword [edx + 0x8e0]
push eax
push ecx
push dword [edx + 0x814]
push dword [edx + 0x810]
push ebx
call fcn.00551d20
add esp, 0x1c
cmp eax, 0xffffff88
ja 0x580c1a
mov ecx, dword [ebx + 4]
mov edi, dword [ebx + 8]
mov esi, dword [ebx + 0xc]
sub esi, edi
mov eax, dword [ebx + 0x18]
mov dword [esp + 0x10], eax
mov eax, dword [ebx + 0x10]
mov dword [esp + 0x14], eax
mov eax, dword [ebx + 0x14]
mov dword [esp + 0x28], eax
sub ecx, dword [ebx]
mov eax, ecx
sar eax, 3
mov dword [esp + 0x24], eax
xor edx, edx
cmp esi, 0x400
setae dl
mov dword [esp + 8], esi
cmp esi, 0x4000
sbb edx, 0xffffffff
mov eax, dword [ebp + 0x814]
mov dword [esp + 4], eax
mov ebx, dword [ebp + 0x8e0]
mov esi, ebp
mov ebp, dword [ebp + 0xd38]
lea eax, [ebp - 2]
cmp eax, 2
mov dword [esp], ebx
mov dword [esp + 0x2c], ecx
jb 0x580640
mov edi, esi
test ebp, ebp
mov esi, dword [esp + 4]
mov edx, dword [esp + 0x10]
je 0x580b63
cmp ebp, 1
jne 0x58065a
mov dword [esp + 8], 1
jmp 0x580b63
mov dword [esp + 0xc], esi
mov dword [esp + 0x1c], ebp
mov dword [esp + 0x20], edx
test bl, 3
je 0x580667
mov edi, dword [esp + 0xc]
jmp 0x580b5b
mov dword [esp + 8], 0
jmp 0x580b63
mov dword [esp + 0x18], 0xff
mov ebp, dword [esp + 8]
cmp ebp, 0x5db
ja 0x5807d5
push 0x400
push 0
push dword [esp + 8]
call sub.msvcrt.dll_memset
add esp, 0xc
test ebp, ebp
je 0x5807ee
lea eax, [edi + ebp]
mov edx, dword [esp]
movzx ecx, byte [edi]
add edi, 1
add dword [edx + ecx*4], 1
cmp edi, eax
jb 0x5806a0
mov ecx, 0x101
nop word cs:[eax + eax]
nop dword [eax]
cmp dword [edx + ecx*4 - 8], 0
lea ecx, [ecx - 1]
je 0x5806c0
lea eax, [ecx - 1]
mov dword [esp + 0x18], eax
xor edx, edx
mov esi, 0
mov eax, 0
cmp ecx, 8
jb 0x5808d6
mov esi, ecx
and esi, 0xfffffff8
lea eax, [esi - 8]
mov edi, eax
shr edi, 3
add edi, 1
mov ebp, edi
test eax, eax
je 0x5807f5
mov edi, ecx
and edi, 0xfffffff8
add edi, 0xfffffff8
shr edi, 3
add edi, 1
and edi, 0xfffffffe
pxor xmm0, xmm0
xor eax, eax
movdqa xmm2, xmmword [0x688830]
pxor xmm1, xmm1
mov ebx, dword [esp]
nop word cs:[eax + eax]
movdqu xmm4, xmmword [ebx + eax*4]
movdqu xmm5, xmmword [ebx + eax*4 + 0x10]
movdqa xmm6, xmm0
pxor xmm6, xmm2
movdqa xmm3, xmm4
pxor xmm3, xmm2
pcmpgtd xmm3, xmm6
pand xmm4, xmm3
pandn xmm3, xmm0
por xmm3, xmm4
movdqa xmm0, xmm1
pxor xmm0, xmm2
movdqa xmm4, xmm5
pxor xmm4, xmm2
pcmpgtd xmm4, xmm0
pand xmm5, xmm4
pandn xmm4, xmm1
por xmm4, xmm5
movdqu xmm1, xmmword [ebx + eax*4 + 0x20]
movdqu xmm5, xmmword [ebx + eax*4 + 0x30]
movdqa xmm6, xmm3
pxor xmm6, xmm2
movdqa xmm0, xmm1
pxor xmm0, xmm2
pcmpgtd xmm0, xmm6
pand xmm1, xmm0
pandn xmm0, xmm3
por xmm0, xmm1
movdqa xmm3, xmm4
pxor xmm3, xmm2
movdqa xmm1, xmm5
pxor xmm1, xmm2
pcmpgtd xmm1, xmm3
pand xmm5, xmm1
pandn xmm1, xmm4
por xmm1, xmm5
add eax, 0x10
add edi, 0xfffffffe
jne 0x580730
jmp 0x5807ff
lea edx, [esp + 0x18]
mov ecx, dword [esp]
push ecx
push 0
push ebp
push edi
call fcn.00562530
add esp, 0x10
jmp 0x5808ef
xor edi, edi
jmp 0x58090c
pxor xmm0, xmm0
xor eax, eax
pxor xmm1, xmm1
mov ebx, ebp
test bl, 1
je 0x580860
mov edi, dword [esp]
movdqu xmm5, xmmword [edi + eax*4]
movdqu xmm3, xmmword [edi + eax*4 + 0x10]
movdqa xmm2, xmmword [0x688830]
movdqa xmm6, xmm0
pxor xmm6, xmm2
movdqa xmm4, xmm5
pxor xmm4, xmm2
pcmpgtd xmm4, xmm6
pand xmm5, xmm4
pandn xmm4, xmm0
por xmm4, xmm5
movdqa xmm0, xmm1
pxor xmm0, xmm2
pxor xmm2, xmm3
pcmpgtd xmm2, xmm0
pand xmm3, xmm2
pandn xmm2, xmm1
por xmm2, xmm3
movdqa xmm0, xmm4
movdqa xmm1, xmm2
movdqa xmm2, xmmword [0x688830]
movdqa xmm4, xmm1
pxor xmm4, xmm2
movdqa xmm3, xmm0
pxor xmm3, xmm2
pcmpgtd xmm3, xmm4
pand xmm0, xmm3
pandn xmm3, xmm1
por xmm3, xmm0
pshufd xmm1, xmm3, 0xee
movdqa xmm0, xmm3
pxor xmm0, xmm2
movdqa xmm4, xmm1
pxor xmm4, xmm2
pcmpgtd xmm0, xmm4
pand xmm3, xmm0
pandn xmm0, xmm1
por xmm0, xmm3
pshufd xmm1, xmm0, 0x55
movdqa xmm3, xmm0
pxor xmm3, xmm2
pxor xmm2, xmm1
pcmpgtd xmm3, xmm2
pand xmm0, xmm3
pandn xmm3, xmm1
por xmm3, xmm0
movd eax, xmm3
cmp ecx, esi
je 0x5808ef
sub ecx, esi
mov edi, dword [esp]
lea edi, [edi + esi*4]
nop
mov ebp, dword [edi + edx*4]
cmp ebp, eax
cmova eax, ebp
add edx, 1
cmp ecx, edx
jne 0x5808e0
cmp eax, 0xffffff88
ja 0x580651
mov edi, dword [esp + 0x18]
test edi, edi
mov ebp, dword [esp + 8]
mov esi, dword [esp + 0xc]
js 0x580a4d
add edi, 1
xor ecx, ecx
mov edx, 0
cmp edi, 8
mov eax, dword [esp + 4]
mov ebx, dword [esp]
jb 0x580b10
mov ecx, edi
and ecx, 0xfffffff8
lea edx, [ecx - 8]
mov eax, edx
shr eax, 3
add eax, 1
test edx, edx
mov dword [esp + 8], edi
je 0x580a5c
mov esi, eax
mov edi, eax
and edi, 0xfffffffe
pxor xmm0, xmm0
xor edx, edx
movdqa xmm2, xmmword [0x688840]
pxor xmm1, xmm1
mov eax, dword [esp + 4]
mov ebx, dword [esp]
nop word cs:[eax + eax]
nop dword [eax]
movdqu xmm3, xmmword [eax + edx*4 + 4]
movdqu xmm4, xmmword [eax + edx*4 + 0x14]
pand xmm3, xmm2
pand xmm4, xmm2
movdqu xmm6, xmmword [ebx + edx*4]
movdqu xmm5, xmmword [ebx + edx*4 + 0x10]
pshufd xmm7, xmm3, 0xf5
pmuludq xmm3, xmm6
pshufd xmm3, xmm3, 0xe8
pshufd xmm6, xmm6, 0xf5
pmuludq xmm6, xmm7
pshufd xmm6, xmm6, 0xe8
punpckldq xmm3, xmm6
paddd xmm3, xmm0
pshufd xmm0, xmm4, 0xf5
pmuludq xmm4, xmm5
pshufd xmm4, xmm4, 0xe8
pshufd xmm5, xmm5, 0xf5
pmuludq xmm5, xmm0
pshufd xmm0, xmm5, 0xe8
punpckldq xmm4, xmm0
paddd xmm4, xmm1
movdqu xmm0, xmmword [eax + edx*4 + 0x24]
movdqu xmm1, xmmword [eax + edx*4 + 0x34]
pand xmm0, xmm2
pand xmm1, xmm2
movdqu xmm6, xmmword [ebx + edx*4 + 0x20]
movdqu xmm5, xmmword [ebx + edx*4 + 0x30]
pshufd xmm7, xmm0, 0xf5
pmuludq xmm0, xmm6
pshufd xmm0, xmm0, 0xe8
pshufd xmm6, xmm6, 0xf5
pmuludq xmm6, xmm7
pshufd xmm6, xmm6, 0xe8
punpckldq xmm0, xmm6
paddd xmm0, xmm3
pshufd xmm3, xmm1, 0xf5
pmuludq xmm1, xmm5
pshufd xmm1, xmm1, 0xe8
pshufd xmm5, xmm5, 0xf5
pmuludq xmm5, xmm3
pshufd xmm3, xmm5, 0xe8
punpckldq xmm1, xmm3
paddd xmm1, xmm4
add edx, 0x10
add edi, 0xfffffffe
jne 0x580970
jmp 0x580a68
xor edx, edx
mov ecx, dword [esp + 0x20]
mov eax, dword [esp + 0x1c]
jmp 0x580b35
mov esi, eax
pxor xmm0, xmm0
xor edx, edx
pxor xmm1, xmm1
mov eax, esi
test al, 1
je 0x580ae4
mov eax, dword [esp + 4]
movdqu xmm4, xmmword [eax + edx*4 + 4]
movdqu xmm2, xmmword [eax + edx*4 + 0x14]
movdqa xmm3, xmmword [0x688840]
pand xmm4, xmm3
pand xmm2, xmm3
mov eax, dword [esp]
movdqu xmm5, xmmword [eax + edx*4]
movdqu xmm3, xmmword [eax + edx*4 + 0x10]
pshufd xmm6, xmm4, 0xf5
pmuludq xmm4, xmm5
pshufd xmm4, xmm4, 0xe8
pshufd xmm5, xmm5, 0xf5
pmuludq xmm5, xmm6
pshufd xmm5, xmm5, 0xe8
punpckldq xmm4, xmm5
paddd xmm0, xmm4
pshufd xmm4, xmm2, 0xf5
pmuludq xmm2, xmm3
pshufd xmm2, xmm2, 0xe8
pshufd xmm3, xmm3, 0xf5
pmuludq xmm3, xmm4
pshufd xmm3, xmm3, 0xe8
punpckldq xmm2, xmm3
paddd xmm1, xmm2
paddd xmm0, xmm1
pshufd xmm1, xmm0, 0xee
paddd xmm1, xmm0
pshufd xmm0, xmm1, 0x55
paddd xmm0, xmm1
movd edx, xmm0
mov edi, dword [esp + 8]
cmp edi, ecx
mov eax, dword [esp + 4]
mov ebx, dword [esp]
je 0x580b26
nop dword [eax]
mov esi, edi
movzx edi, byte [eax + ecx*4 + 4]
imul edi, dword [ebx + ecx*4]
add edx, edi
mov edi, esi
add ecx, 1
cmp esi, ecx
jne 0x580b10
shr edx, 3
mov ecx, dword [esp + 0x20]
mov eax, dword [esp + 0x1c]
mov esi, dword [esp + 0xc]
add ecx, 3
cmp eax, 2
jne 0x580b47
mov edi, esi
add edx, dword [esi + 0xdbc]
jmp 0x580b49
mov edi, esi
lea eax, [edx + 6]
cmp ebp, 0x100
cmovb eax, edx
add ecx, eax
mov dword [esp + 8], ecx
mov esi, dword [esp + 4]
mov edx, dword [esp + 0x10]
mov ebp, edi
mov ecx, dword [edi + 0xdc4]
lea eax, [esi + 0x408]
mov edi, dword [esp]
push edi
push 5
push 0x689b0a
push 0
push eax
push 0x1f
mov ebx, dword [esp + 0x3c]
push ebx
call fcn.00580c30
add esp, 0x1c
mov dword [esp + 4], eax
mov ecx, dword [ebp + 0xdc0]
lea eax, [esi + 0xcb8]
mov edx, dword [esp + 0x14]
push edi
push 6
push 0x689ac2
push 0x6893bc
push eax
push 0x23
push ebx
call fcn.00580c30
add esp, 0x1c
mov dword [esp + 0x14], eax
mov ecx, dword [ebp + 0xdc8]
add esi, 0x70c
mov edx, dword [esp + 0x28]
push edi
push 6
push 0x689b44
push 0x6892f4
push esi
push 0x34
push ebx
call fcn.00580c30
add esp, 0x1c
mov ecx, dword [ebp + 0xe54]
xor edx, edx
mov esi, dword [esp + 0x2c]
cmp esi, 0x3f9
setae dl
cmp esi, 0x3f7f9
sbb edx, 0xffffffff
add edx, dword [esp + 8]
add edx, dword [esp + 4]
add edx, dword [esp + 0x14]
add edx, eax
lea eax, [ecx + edx]
add eax, 5
add esp, 0x30
pop esi
pop edi
pop ebx
pop ebp
ret