Function at 0x598f20
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
mov ecx, dword [ebp + 0x24]
sub esp, 0x24
test ecx, ecx
je 0x599290
mov eax, dword [ebp + 0x20]
and dword [ebp + 0xc], 0xfffffffc
add eax, 0xfffffffc
and dword [ebp + 0x14], 0xfffffffc
and dword [ebp + 0x1c], 0xfffffffc
mov edx, dword [ebp + 0x10]
push esi
mov esi, dword [ebp + 0x18]
mov dword [ebp - 0x18], eax
mov eax, dword [ebp + 8]
push edi
dec ecx
mov dword [ebp + 0x24], ecx
xor ecx, ecx
cmp byte [0x708fa1], cl
mov edi, dword [ebp + 0x20]
mov dword [ebp - 0xc], edi
je 0x5990c0
or eax, edx
or eax, esi
test al, 0xf
lea eax, [edi - 8]
jne 0x599015
mov dword [ebp - 0x14], eax
test eax, eax
js 0x5990c0
mov ecx, dword [ebp + 0x18]
lea eax, [edx + 0x10]
sub ecx, edx
mov dword [ebp - 0x10], esi
mov esi, dword [ebp + 8]
mov dword [ebp - 0x1c], ecx
sub esi, edx
mov ecx, dword [ebp + 8]
sub ecx, dword [ebp + 0x18]
mov edx, dword [ebp - 0x10]
mov edi, dword [ebp - 0x1c]
mov dword [ebp - 0x20], ecx
mov ecx, dword [ebp - 0x14]
add ecx, 8
mov dword [ebp - 4], esi
shr ecx, 3
mov dword [ebp - 0x14], ecx
shl ecx, 3
mov dword [ebp - 8], ecx
mov ecx, dword [ebp - 0x20]
lea ecx, [ecx]
dec dword [ebp - 0x14]
lea edx, [edx + 0x20]
movdqa xmm2, xmmword [eax]
lea eax, [eax + 0x20]
movdqa xmm4, xmmword [ecx + edx - 0x20]
movdqa xmm3, xmm2
movdqa xmm5, xmmword [esi + eax - 0x20]
movdqa xmm1, xmmword [eax - 0x30]
pcmpgtd xmm3, xmm5
pcmpgtd xmm1, xmm4
psubd xmm5, xmm2
psubd xmm4, xmmword [eax - 0x30]
pxor xmm5, xmm3
pxor xmm4, xmm1
psubd xmm5, xmm3
psubd xmm4, xmm1
movdqa xmmword [edx - 0x20], xmm4
movdqa xmmword [edi + eax - 0x20], xmm5
jne 0x598fc0
jmp 0x5990b4
mov dword [ebp - 0x20], eax
test eax, eax
js 0x5990c0
mov ecx, dword [ebp + 0x18]
lea eax, [edx + 0x10]
sub ecx, edx
mov dword [ebp - 0x1c], esi
mov esi, dword [ebp + 8]
mov dword [ebp - 4], ecx
sub esi, edx
mov ecx, dword [ebp + 8]
sub ecx, dword [ebp + 0x18]
mov edi, dword [ebp - 4]
mov dword [ebp - 0x24], ecx
mov ecx, dword [ebp - 0x20]
add ecx, 8
mov dword [ebp - 0x10], esi
mov esi, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x10]
shr ecx, 3
mov dword [ebp - 0x14], ecx
shl ecx, 3
mov dword [ebp - 8], ecx
mov ecx, dword [ebp - 0x24]
lea ecx, [ecx]
dec dword [ebp - 0x14]
lea esi, [esi + 0x20]
movdqu xmm2, xmmword [eax - 0x10]
lea eax, [eax + 0x20]
movdqu xmm0, xmmword [eax - 0x20]
movdqu xmm4, xmmword [esi + ecx - 0x20]
movdqu xmm5, xmmword [eax + edx - 0x20]
movdqa xmm3, xmm2
movdqa xmm1, xmm0
pcmpgtd xmm3, xmm4
pcmpgtd xmm1, xmm5
psubd xmm4, xmm2
psubd xmm5, xmm0
pxor xmm4, xmm3
pxor xmm5, xmm1
psubd xmm4, xmm3
psubd xmm5, xmm1
movdqu xmmword [esi - 0x20], xmm4
movdqu xmmword [eax + edi - 0x20], xmm5
jne 0x599060
mov esi, dword [ebp + 0x18]
mov edx, dword [ebp + 0x10]
mov edi, dword [ebp - 0xc]
mov ecx, dword [ebp - 8]
cmp ecx, dword [ebp - 0x18]
jg 0x59916d
lea eax, [ecx + 2]
mov dword [ebp - 0x10], edx
lea eax, [edx + eax*4]
mov dword [ebp - 0x14], esi
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
sub dword [ebp - 0x10], eax
sub dword [ebp - 0x14], eax
lea edi, [eax + 4]
mov eax, esi
lea edi, [edi + ecx*4]
sub eax, edx
mov dword [ebp - 8], edi
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x10]
mov edx, dword [ebp - 4]
mov esi, dword [eax + edi]
mov eax, dword [ebp - 8]
mov edi, dword [edi]
sub edi, esi
mov esi, dword [ebp - 0x14]
mov eax, dword [eax - 4]
sub eax, dword [edx - 8]
cdq
xor eax, edx
sub eax, edx
mov edx, dword [ebp + 0x18]
mov dword [edx + ecx*4], eax
mov eax, edi
cdq
xor eax, edx
sub eax, edx
mov edx, dword [ebp - 8]
mov dword [esi + edx], eax
mov eax, dword [ebp - 4]
mov edi, dword [edx + 8]
mov esi, dword [eax + 4]
mov eax, dword [edx + 4]
mov edx, dword [ebp - 4]
mov dword [ebp - 0x20], esi
mov esi, dword [ebp - 0x24]
sub edi, dword [ebp - 0x20]
sub eax, dword [edx]
cdq
xor eax, edx
sub eax, edx
mov edx, dword [ebp - 4]
add dword [ebp - 4], 0x10
mov dword [esi + edx], eax
mov eax, edi
mov esi, dword [ebp + 0x18]
mov edi, dword [ebp - 8]
cdq
add edi, 0x10
xor eax, edx
mov dword [ebp - 8], edi
sub eax, edx
mov dword [esi + ecx*4 + 0xc], eax
add ecx, 4
cmp ecx, dword [ebp - 0x18]
jle 0x5990f1
mov edi, dword [ebp - 0xc]
mov eax, edi
sub eax, ecx
mov dword [ebp - 0x20], eax
cmp ecx, edi
jge 0x59926b
mov edx, dword [ebp + 0x10]
cmp eax, 4
jb 0x59922b
cmp dword [0x708db0], 2
jl 0x59922b
lea eax, [esi + ecx*4]
mov dword [ebp - 0x14], eax
lea eax, [edx + ecx*4]
mov dword [ebp - 0x24], eax
lea eax, [edx - 4]
lea eax, [eax + edi*4]
cmp dword [ebp - 0x14], eax
ja 0x5991b7
lea eax, [edi - 1]
lea eax, [esi + eax*4]
cmp eax, dword [ebp - 0x24]
jae 0x59922b
mov eax, dword [ebp + 8]
lea edx, [eax + ecx*4]
lea eax, [eax + edi*4]
add eax, 0xfffffffc
cmp dword [ebp - 0x14], eax
ja 0x5991d2
lea eax, [edi - 1]
lea eax, [esi + eax*4]
cmp eax, edx
jae 0x599228
mov eax, dword [ebp - 0x20]
and eax, reloc.WS2_32.dll_closesocket
jns 0x5991e1
dec eax
or eax, 0xfffffffc
inc eax
mov dword [ebp - 0x10], edi
sub dword [ebp - 0x10], eax
mov eax, dword [ebp + 8]
mov dword [ebp - 0x14], esi
sub dword [ebp - 0x14], eax
mov esi, dword [ebp + 0x10]
sub esi, eax
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x24], esi
mov esi, dword [ebp + 0x18]
mov edi, dword [ebp - 0x24]
movdqu xmm0, xmmword [edx + edi]
add ecx, 4
lea edx, [edx + 0x10]
movdqu xmm1, xmmword [edx - 0x10]
psubd xmm1, xmm0
pabsd xmm0, xmm1
movdqu xmmword [edx + eax - 0x10], xmm0
cmp ecx, dword [ebp - 0x10]
jl 0x599201
mov edi, dword [ebp - 0xc]
mov edx, dword [ebp + 0x10]
mov eax, dword [ebp + 8]
cmp ecx, edi
jge 0x59926b
sub eax, edx
lea esi, [edx + ecx*4]
mov dword [ebp - 0x14], eax
mov eax, dword [ebp + 0x18]
sub eax, edx
sub edi, ecx
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x24]
lea ebx, [ebx]
mov eax, dword [esi + eax]
lea esi, [esi + 4]
sub eax, dword [esi - 4]
cdq
xor eax, edx
sub eax, edx
mov dword [esi + ecx - 4], eax
mov eax, dword [ebp - 0x14]
dec edi
jne 0x599250
mov esi, dword [ebp + 0x18]
mov eax, dword [ebp + 8]
mov edx, dword [ebp + 0x10]
add eax, dword [ebp + 0xc]
add edx, dword [ebp + 0x14]
add esi, dword [ebp + 0x1c]
mov ecx, dword [ebp + 0x24]
mov dword [ebp + 8], eax
mov dword [ebp + 0x10], edx
mov dword [ebp + 0x18], esi
test ecx, ecx
jne 0x598f51
pop edi
pop esi
mov esp, ebp
pop ebp
ret