Function at 0x416400
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
cmp dword [edi + 0x80000], 4
jge 0x416417
mov al, 1
mov esp, ebp
pop ebp
ret 8
push ebx
xor ebx, ebx
mov dword [ebp - 0xc], ebx
push esi
mov edi, edi
mov al, byte [ebx + edi]
cmp al, 0xc1
jne 0x416432
movzx esi, byte [ebx + edi + 1]
mov cl, byte [ebx + edi + 3]
jmp 0x416451
cmp al, 0xc2
jne 0x416661
movzx ecx, byte [ebx + edi + 1]
movzx edx, byte [ebx + edi + 2]
shl cx, 8
movzx esi, cx
mov cl, byte [ebx + edi + 4]
or esi, edx
cmp esi, 4
jl 0x416645
cmp esi, 0x80000
jg 0x416645
cmp esi, dword [edi + 0x80000]
jg 0x416614
cmp al, 0xc1
jne 0x4164aa
mov al, byte [ebx + edi + 2]
mov byte [ebp - 4], al
lea edx, [esi - 3]
xor eax, eax
lea ecx, [ebx + edi + 3]
test edx, edx
jle 0x4164d8
lea ebx, [ebx]
mov dl, byte [eax + ecx]
add dl, byte [ebp - 4]
lea ecx, [ebx + edi + 3]
xor dl, 0xa0
mov byte [eax + ecx], dl
inc eax
lea edx, [esi - 3]
cmp eax, edx
jl 0x416490
jmp 0x4164d8
mov al, byte [ebx + edi + 3]
mov byte [ebp - 4], al
lea edx, [esi - 4]
xor eax, eax
lea ecx, [ebx + edi + 4]
test edx, edx
jle 0x4164d8
mov edi, edi
mov dl, byte [eax + ecx]
add dl, byte [ebp - 4]
lea ecx, [ebx + edi + 4]
xor dl, 0xa0
mov byte [eax + ecx], dl
inc eax
lea edx, [esi - 4]
cmp eax, edx
jl 0x4164c0
mov cl, byte [ecx]
mov ax, word [ebp + 0xc]
mov word [0x505ec8], ax
push esi
lea eax, [ebx + edi]
push eax
push 0x505ecb
mov byte [0x505eca], cl
call sub.MSVCR100.dll_memcpy
mov eax, dword [ebp + 8]
add esp, 0xc
add eax, 0x40
push eax
mov dword [0x585ecc], esi
mov byte [ebp - 4], 0
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [ebp + 8]
cmp dword [eax + 0x68], 0x800
jae 0x4165a8
mov ecx, dword [eax + 0x68]
add eax, 0x58
inc ecx
mov dword [ebp - 8], eax
cmp dword [eax + 8], ecx
ja 0x41653f
mov ebx, eax
call fcn.004105f0
mov ebx, dword [ebp - 0xc]
mov eax, dword [ebp - 8]
mov ecx, dword [eax + 0xc]
add ecx, dword [eax + 0x10]
mov edx, dword [eax + 8]
mov dword [ebp - 0xc], ecx
cmp edx, ecx
ja 0x416554
sub ecx, edx
mov dword [ebp - 0xc], ecx
mov edx, dword [eax + 4]
cmp dword [edx + ecx*4], 0
jne 0x41657e
push 0x80008
call dword [sym.imp.MSVCR100.dll_void____cdecl_operator_new_unsigned_int_]
add esp, 4
test eax, eax
je 0x4165eb
mov ecx, dword [ebp - 8]
mov edx, dword [ecx + 4]
mov ecx, dword [ebp - 0xc]
mov dword [edx + ecx*4], eax
mov eax, dword [ebp - 8]
mov edx, dword [eax + 4]
mov ecx, dword [edx + ecx*4]
test ecx, ecx
je 0x41659e
push 0x80008
push 0x505ec8
push ecx
call sub.MSVCR100.dll_memcpy
mov eax, dword [ebp - 8]
add esp, 0xc
inc dword [eax + 0x10]
mov eax, dword [ebp + 8]
mov byte [ebp - 4], 1
add eax, 0x40
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp byte [ebp - 4], 0
je 0x4165c9
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x70]
push 0
push 1
push ecx
call dword [sym.imp.KERNEL32.dll_ReleaseSemaphore]
sub dword [edi + 0x80000], esi
add ebx, esi
cmp dword [edi + 0x80000], 0
mov dword [ebp - 0xc], ebx
jg 0x416420
pop esi
mov al, 1
pop ebx
mov esp, ebp
pop ebp
ret 8
lea edx, [ebp - 0x10]
push edx
lea ecx, [ebp - 0x1c]
mov dword [ebp - 0x10], 0
call dword [sym.imp.MSVCR100.dll_public:_void___thiscall_std::exception::constructor_char_const__const_const__]
push 0x4712b8
lea eax, [ebp - 0x1c]
push eax
mov dword [ebp - 0x1c], vtable.std::bad_alloc.0
call sub.MSVCR100.dll__CxxThrowException
test ebx, ebx
jle 0x41663b
mov eax, dword [edi + 0x80000]
test eax, eax
jle 0x41663b
mov ecx, 0x80000
sub ecx, ebx
cmp eax, ecx
jg 0x41663b
push eax
add ebx, edi
push ebx
push edi
call dword [sym.imp.MSVCR100.dll_memmove]
add esp, 0xc
pop esi
mov al, 1
pop ebx
mov esp, ebp
pop ebp
ret 8
movzx edx, cl
mov ecx, dword [ebp + 0xc]
push edx
push esi
movzx eax, al
push eax
push ecx
push str._SocketManager__Protocol_size_error__Index:__d__Header:__x__Size:__d__Head:__x_
push 1
call fcn.00417090
add esp, 0x18
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 8