Function at 0x1000c568
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
mov edx, dword [ebp + 0xc]
push ebx
push esi
mov ebx, ecx
xor esi, esi
mov dword [ebp - 8], ebx
push edi
test edx, edx
jle 0x1000c7bc
push 2
pop edi
mov dword [ebp - 0xc], edi
cmp dword [ebx + 0x18], 0
mov eax, edx
je 0x1000c6fc
cmp dword [ebx + 0x20], edx
cmovl eax, dword [ebx + 0x20]
push eax
push dword [ebp + 8]
mov dword [ebp - 4], eax
mov eax, dword [ebx + 0x1c]
sub eax, dword [ebx + 0x20]
add eax, 4
add eax, ebx
push eax
call fcn.10021ce0
mov ecx, dword [ebp - 4]
add esp, 0xc
sub dword [ebx + 0x20], ecx
jne 0x1000c79a
mov edi, dword [ebx + 4]
mov eax, edi
shr eax, 8
and eax, 0x7f
cmp eax, 0x7e
mov dword [ebp - 0x14], eax
push 8
pop edx
cmove edx, dword [ebp - 0xc]
and dword [ebp - 0x10], 0
cmp eax, 0x7e
cmovl edx, dword [ebp - 0x10]
shr edi, 0xf
and edi, 1
mov dword [ebp - 0x1c], edx
shl edi, 2
lea eax, [edx + 2]
add eax, edi
mov dword [ebp - 0x10], eax
cmp dword [ebx + 0x1c], eax
jge 0x1000c610
sub eax, dword [ebx + 0x1c]
mov dword [ebx + 0x20], eax
mov eax, dword [ebp - 0x10]
mov dword [ebx + 0x1c], eax
jmp 0x1000c79a
mov eax, dword [ebx]
mov eax, dword [eax + 4]
test eax, eax
je 0x1000c625
test edi, edi
je 0x1000c7af
test eax, eax
jne 0x1000c62d
test edi, edi
jg 0x1000c7af
test edx, edx
jne 0x1000c636
mov eax, dword [ebp - 0x14]
jmp 0x1000c64d
push 2
pop eax
cmp edx, eax
jne 0x1000c650
mov eax, dword [ebx + 4]
shr eax, 0x10
push eax
call dword [sym.imp.WS2_32.dll_ntohs]
movzx eax, ax
cdq
jmp 0x1000c65d
push dword [ebx + 0xa]
push dword [ebx + 6]
call fcn.10011b9b
pop ecx
pop ecx
mov dword [ebx + 0x28], eax
mov ecx, eax
mov eax, edx
mov dword [ebx + 0x30], ecx
mov dword [ebx + 0x34], eax
xor ecx, ecx
mov eax, dword [ebp - 0x1c]
add eax, 6
mov dword [ebx + 0x2c], edx
add eax, ebx
test edi, edi
cmovg ecx, eax
mov dword [ebx + 0x14], ecx
mov al, byte [ebx + 4]
mov edx, dword [ebx + 4]
and al, 0xf
mov byte [ebp - 0x20], al
mov eax, edx
shr eax, 4
and al, 7
mov dword [ebp - 0x1c], ecx
mov byte [ebp - 0x24], al
mov eax, dword [ebx]
shr edx, 7
and edx, 1
mov ebx, dword [eax + 0xc]
mov edi, dword [eax + 0x10]
mov eax, dword [ebx + 0x198]
lea ecx, [edi + 4]
mov esi, dword [eax]
mov eax, dword [ebp - 8]
push dword [eax + 0x2c]
push dword [eax + 0x28]
mov eax, dword [ecx]
push dword [ebp - 0x1c]
push dword [ebp - 0x20]
push dword [ebp - 0x24]
push edx
call dword [eax + 0x34]
mov ecx, dword [ebx + 0x198]
push eax
push edi
call dword [esi + 0x2c]
push 2
mov esi, eax
pop edi
cmp esi, edi
je 0x1000c7bc
mov ebx, dword [ebp - 8]
cmp dword [ebx + 0x2c], 0
ja 0x1000c6f3
cmp dword [ebx + 0x28], 0
jbe 0x1000c78a
and dword [ebx + 0x18], 0
jmp 0x1000c797
cdq
cmp dword [ebx + 0x34], edx
ja 0x1000c70e
jb 0x1000c709
cmp dword [ebx + 0x30], eax
jae 0x1000c70e
mov edx, dword [ebx + 0x30]
jmp 0x1000c711
mov edx, dword [ebp + 0xc]
cmp dword [ebx + 0x14], 0
mov dword [ebp - 4], edx
je 0x1000c744
mov esi, dword [ebx + 0x28]
sub esi, dword [ebx + 0x30]
and esi, 3
test edx, edx
jle 0x1000c744
mov edi, dword [ebp + 8]
sub esi, edi
mov dword [ebp - 0x1c], edx
mov eax, dword [ebx + 0x14]
lea ecx, [esi + edi]
and ecx, 3
mov al, byte [ecx + eax]
xor byte [edi], al
inc edi
dec edx
jne 0x1000c72f
mov edx, dword [ebp - 4]
push dword [ebp - 4]
mov eax, edx
push dword [ebp + 8]
cdq
sub dword [ebx + 0x30], eax
mov eax, dword [ebx]
sbb dword [ebx + 0x34], edx
mov ebx, dword [eax + 0xc]
mov edi, dword [eax + 0x10]
mov eax, dword [ebx + 0x198]
lea ecx, [edi + 4]
mov esi, dword [eax]
mov eax, dword [ecx]
call dword [eax + 0x34]
mov ecx, dword [ebx + 0x198]
push eax
push edi
call dword [esi + 0x30]
push 2
mov esi, eax
pop edi
cmp esi, edi
je 0x1000c7bc
mov ebx, dword [ebp - 8]
mov eax, dword [ebx + 0x30]
or eax, dword [ebx + 0x34]
jne 0x1000c797
mov ecx, ebx
call fcn.1000c9c8
mov esi, eax
cmp esi, edi
je 0x1000c7bc
mov ecx, dword [ebp - 4]
mov edx, dword [ebp + 0xc]
add dword [ebp + 8], ecx
sub edx, ecx
mov dword [ebp + 0xc], edx
test edx, edx
jg 0x1000c589
jmp 0x1000c7bc
push 0xd
call dword [sym.imp.KERNEL32.DLL_SetLastError]
push 2
pop eax
mov esi, eax
pop edi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8