Function at 0x59b870
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
mov ecx, dword [ebp + 0x24]
sub esp, 0x24
test ecx, ecx
je 0x59bbb5
mov edx, dword [ebp + 0x20]
add edx, 0xfffffffc
push esi
mov esi, dword [ebp + 0x10]
mov dword [ebp - 0x18], edx
mov edx, 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 0x59b9ac
lea eax, [edi - 0x20]
mov dword [ebp - 0x14], eax
test eax, eax
js 0x59b945
mov ecx, dword [ebp - 0x14]
lea eax, [edx + 0x10]
sub esi, edx
add ecx, 0x20
mov dword [ebp - 8], esi
mov esi, dword [ebp + 0x18]
sub esi, edx
shr ecx, 5
mov edx, dword [ebp + 0x10]
sub edx, dword [ebp + 0x18]
mov dword [ebp - 0x14], ecx
shl ecx, 5
mov dword [ebp - 0x1c], esi
mov esi, dword [ebp - 8]
mov edi, dword [ebp - 0x1c]
mov dword [ebp - 0x20], edx
mov edx, dword [ebp + 0x18]
mov dword [ebp - 0x24], ecx
mov ecx, dword [ebp - 0x20]
nop
dec dword [ebp - 0x14]
lea eax, [eax + 0x20]
movdqu xmm2, xmmword [eax - 0x30]
lea edx, [edx + 0x20]
movdqu xmm1, xmmword [ecx + edx - 0x20]
movdqu xmm4, xmmword [eax - 0x20]
movdqu xmm3, xmmword [esi + eax - 0x20]
movdqa xmm0, xmm2
psubusb xmm0, xmm1
psubusb xmm1, xmm2
paddb xmm0, xmm1
movdqu xmmword [edx - 0x20], xmm0
movdqa xmm0, xmm4
psubusb xmm0, xmm3
psubusb xmm3, xmm4
paddb xmm0, xmm3
movdqu xmmword [edi + eax - 0x20], xmm0
jne 0x59b8f0
mov ecx, dword [ebp - 0x24]
mov edi, dword [ebp - 0xc]
mov esi, dword [ebp + 0x10]
lea edx, [edi - 8]
cmp ecx, edx
jg 0x59b9ac
lea eax, [ecx + esi]
sub edx, ecx
mov dword [ebp - 0x24], eax
mov eax, dword [ebp + 8]
sub eax, esi
shr edx, 3
mov dword [ebp - 0x20], eax
mov eax, dword [ebp + 0x18]
sub eax, esi
mov esi, dword [ebp - 0x20]
inc edx
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x24]
mov edi, dword [ebp - 0x1c]
lea ecx, [ecx + edx*8]
jmp 0x59b980
movq xmm2, qword [esi + eax]
lea eax, [eax + 8]
movq xmm1, qword [eax - 8]
movdqa xmm0, xmm2
psubusb xmm0, xmm1
psubusb xmm1, xmm2
paddb xmm0, xmm1
movq qword [edi + eax - 8], xmm0
dec edx
jne 0x59b980
mov edi, dword [ebp - 0xc]
mov esi, dword [ebp + 0x10]
cmp ecx, dword [ebp - 0x18]
jg 0x59ba6d
mov edx, dword [ebp + 0x18]
mov dword [ebp - 0x14], edx
mov dword [ebp - 0x10], esi
lea eax, [ecx + edx]
mov dword [ebp - 8], eax
mov eax, dword [ebp + 8]
sub dword [ebp - 0x10], eax
sub dword [ebp - 0x14], eax
lea edi, [eax + 1]
mov eax, esi
add edi, ecx
sub eax, edx
mov edx, dword [ebp - 8]
mov dword [ebp - 0x24], eax
lea esp, [esp]
mov eax, dword [ebp - 0x10]
lea edi, [edi + 4]
mov al, byte [edi + eax - 4]
mov byte [ebp - 2], al
mov al, byte [edi - 4]
mov byte [ebp - 1], al
mov eax, dword [ebp - 0x24]
movzx edx, byte [edx + eax]
movzx eax, byte [edi - 5]
sub eax, edx
cdq
xor eax, edx
sub eax, edx
mov edx, dword [ebp - 8]
mov byte [edx], al
movzx edx, byte [ebp - 2]
movzx eax, byte [ebp - 1]
sub eax, edx
cdq
xor eax, edx
sub eax, edx
mov edx, dword [ebp - 0x14]
mov byte [edi + edx - 4], al
mov al, byte [esi + ecx + 3]
movzx edx, byte [esi + ecx + 2]
add ecx, 4
mov byte [ebp - 1], al
mov al, byte [edi - 2]
mov byte [ebp - 2], al
movzx eax, byte [edi - 3]
sub eax, edx
cdq
xor eax, edx
sub eax, edx
mov edx, dword [ebp - 8]
mov byte [edx + 2], al
movzx edx, byte [ebp - 1]
movzx eax, byte [ebp - 2]
sub eax, edx
cdq
xor eax, edx
sub eax, edx
mov edx, dword [ebp - 8]
mov byte [edx + 3], al
add edx, 4
mov dword [ebp - 8], edx
cmp ecx, dword [ebp - 0x18]
jle 0x59b9e0
mov edi, dword [ebp - 0xc]
mov eax, edi
sub eax, ecx
mov dword [ebp - 0x1c], eax
cmp ecx, edi
jge 0x59bb93
mov edx, dword [ebp + 0x18]
cmp eax, 4
jb 0x59bb52
cmp dword [0x708db0], 2
jl 0x59bb52
lea eax, [ecx + edx]
mov dword [ebp - 0x14], eax
lea eax, [edx - 1]
add eax, edi
mov dword [ebp - 0x20], eax
lea eax, [ecx + esi]
mov dword [ebp - 0x24], eax
lea eax, [esi - 1]
add eax, edi
cmp dword [ebp - 0x14], eax
ja 0x59bac1
lea eax, [edx - 1]
add eax, edi
cmp eax, dword [ebp - 0x24]
jae 0x59bb52
mov eax, dword [ebp + 8]
lea edx, [ecx + eax]
dec eax
add eax, edi
cmp dword [ebp - 0x14], eax
ja 0x59bad4
cmp dword [ebp - 0x20], edx
jae 0x59bb4f
mov eax, dword [ebp - 0x1c]
and eax, reloc.WS2_32.dll_closesocket
jns 0x59bae3
dec eax
or eax, 0xfffffffc
inc eax
mov esi, dword [ebp + 0x18]
sub esi, dword [ebp + 8]
mov dword [ebp - 0x14], edi
sub dword [ebp - 0x14], eax
mov eax, esi
mov edi, dword [ebp + 0x10]
sub edi, dword [ebp + 8]
mov dword [ebp - 0x20], edi
mov edi, dword [ebp - 0xc]
mov dword [ebp - 0x24], esi
mov esi, dword [ebp - 0x20]
movd xmm0, dword [edx]
lea edx, [edx + 4]
pmovzxbd xmm1, xmm0
movd xmm0, dword [esi + edx - 4]
add ecx, 4
pmovzxbd xmm0, xmm0
psubd xmm1, xmm0
pabsd xmm0, xmm1
pshuflw xmm0, xmm0, 0xd8
pshufhw xmm0, xmm0, 0xd8
pshufd xmm0, xmm0, 0xd8
pand xmm0, xmmword [0x66b1c0]
packuswb xmm0, xmm0
movd dword [eax + edx - 4], xmm0
cmp ecx, dword [ebp - 0x14]
jl 0x59bb03
mov esi, dword [ebp + 0x10]
mov edx, dword [ebp + 0x18]
mov eax, dword [ebp + 8]
cmp ecx, edi
jge 0x59bb93
mov dword [ebp - 0x14], eax
add esi, ecx
mov eax, dword [ebp + 0x10]
sub edx, eax
sub dword [ebp - 0x14], eax
sub edi, ecx
mov dword [ebp - 0x24], edx
jmp 0x59bb70
mov eax, dword [ebp - 0x14]
lea esi, [esi + 1]
movzx ecx, byte [esi - 1]
movzx eax, byte [eax + esi - 1]
sub eax, ecx
mov ecx, dword [ebp - 0x24]
cdq
xor eax, edx
sub eax, edx
mov byte [ecx + esi - 1], al
dec edi
jne 0x59bb70
mov esi, dword [ebp + 0x10]
mov edx, dword [ebp + 8]
add edx, dword [ebp + 0xc]
add esi, dword [ebp + 0x14]
mov eax, dword [ebp + 0x1c]
add dword [ebp + 0x18], eax
mov ecx, dword [ebp + 0x24]
mov dword [ebp + 8], edx
mov dword [ebp + 0x10], esi
test ecx, ecx
jne 0x59b892
pop edi
pop esi
mov esp, ebp
pop ebp
ret