Function at 0x40bbf0
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
push esi
mov esi, dword [ebp + 0xc]
mov dword [ebp - 8], ecx
cmp dword [esi + 0x182b8], 4
jge 0x40bc0f
mov al, 1
pop esi
mov esp, ebp
pop ebp
ret 8
push ebx
xor ebx, ebx
push edi
lea eax, [ebx + esi]
mov al, byte [eax]
cmp al, 0xc1
jne 0x40bc29
movzx edi, byte [ebx + esi + 1]
mov cl, al
mov al, byte [ebx + esi + 3]
jmp 0x40bc4a
cmp al, 0xc2
jne 0x40be40
mov cl, al
movzx eax, byte [ebx + esi + 1]
shl ax, 8
movzx edi, ax
movzx eax, byte [ebx + esi + 2]
or edi, eax
mov al, byte [ebx + esi + 4]
cmp edi, 4
jl 0x40be1a
cmp edi, 0x182b8
jg 0x40be1a
cmp edi, dword [esi + 0x182b8]
jg 0x40bde8
lea edx, [ebx + esi]
cmp cl, 0xc1
jne 0x40bcaa
mov al, byte [ebx + esi + 2]
mov byte [ebp - 1], al
lea ecx, [edi - 3]
xor eax, eax
test ecx, ecx
jle 0x40bca5
mov ch, byte [ebp - 1]
lea esi, [edi - 3]
lea esp, [esp]
mov cl, byte [edx + eax + 3]
add cl, ch
xor cl, 0xa0
mov byte [edx + eax + 3], cl
inc eax
cmp eax, esi
jl 0x40bc90
mov esi, dword [ebp + 0xc]
mov al, byte [edx + 3]
jmp 0x40bcd7
mov al, byte [ebx + esi + 3]
mov byte [ebp - 1], al
lea eax, [edi - 4]
xor ecx, ecx
test eax, eax
jle 0x40bcd4
mov ah, byte [ebp - 1]
lea esi, [edi - 4]
mov al, byte [edx + ecx + 4]
add al, ah
xor al, 0xa0
mov byte [edx + ecx + 4], al
inc ecx
cmp ecx, esi
jl 0x40bcc0
mov esi, dword [ebp + 0xc]
mov al, byte [edx + 4]
mov ecx, dword [ebp + 8]
mov byte [0x49b502], al
push edi
lea eax, [ebx + esi]
push eax
push 0x49b503
mov word [0x49b500], cx
call fcn.0040ff30
mov eax, dword [ebp - 8]
add esp, 0xc
add eax, 0x40
push eax
mov dword [0x51b504], edi
mov byte [ebp - 1], 0
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [ebp - 8]
cmp dword [eax + 0x68], 0x800
jae 0x40bda5
lea edx, [eax + 0x58]
mov dword [ebp - 0xc], edx
mov eax, dword [edx + 0x10]
inc eax
cmp dword [edx + 8], eax
ja 0x40bd39
push ecx
mov ecx, edx
call fcn.00407dd0
mov edx, dword [ebp - 0xc]
mov ecx, dword [edx + 8]
mov eax, dword [edx + 0x10]
dec ecx
and dword [edx + 0xc], ecx
add eax, dword [edx + 0xc]
and ecx, eax
mov eax, dword [edx + 4]
shl ecx, 2
mov dword [ebp - 0x10], ecx
cmp dword [ecx + eax], 0
jne 0x40bd7e
push 0x80008
call fcn.0040e2f4
add esp, 4
test eax, eax
je 0x40be62
mov edx, dword [ebp - 0xc]
mov esi, dword [ebp - 0x10]
mov ecx, dword [edx + 4]
mov dword [esi + ecx], eax
mov esi, dword [ebp + 0xc]
mov ecx, dword [ebp - 0x10]
mov eax, dword [edx + 4]
mov eax, dword [ecx + eax]
test eax, eax
je 0x40bd9e
push 0x80008
push 0x49b500
push eax
call fcn.0040ff30
mov edx, dword [ebp - 0xc]
add esp, 0xc
inc dword [edx + 0x10]
mov byte [ebp - 1], 1
mov ecx, dword [ebp - 8]
lea eax, [ecx + 0x40]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp byte [ebp - 1], 0
je 0x40bdc8
mov eax, dword [ebp - 8]
push 0
push 1
push dword [eax + 0x6c]
call dword [sym.imp.KERNEL32.dll_ReleaseSemaphore]
sub dword [esi + 0x182b8], edi
add ebx, edi
cmp dword [esi + 0x182b8], 0
jg 0x40bc13
pop edi
pop ebx
mov al, 1
pop esi
mov esp, ebp
pop ebp
ret 8
test ebx, ebx
jle 0x40be0f
mov ecx, dword [esi + 0x182b8]
test ecx, ecx
jle 0x40be0f
mov eax, 0x182b8
sub eax, ebx
cmp ecx, eax
jg 0x40be0f
push ecx
lea eax, [ebx + esi]
push eax
push esi
call fcn.0040d170
add esp, 0xc
pop edi
pop ebx
mov al, 1
pop esi
mov esp, ebp
pop ebp
ret 8
movzx eax, al
push eax
push edi
movzx eax, cl
push eax
push dword [ebp + 8]
push str._SocketManager__Protocol_size_error__Index:__d__Header:__x__Size:__d__Head:__x_
push 1
call fcn.0040c860
add esp, 0x18
xor al, al
pop edi
pop ebx
pop esi
mov esp, ebp
pop ebp
ret 8
movzx eax, byte [ebx + esi]
push eax
push dword [ebp + 8]
push str._SocketManager__Protocol_header_error__Index:__d__Header:__x_
push 1
call fcn.0040c860
add esp, 0x10
xor al, al
pop edi
pop ebx
pop esi
mov esp, ebp
pop ebp
ret 8
call fcn.0040cde6
int3