Function at 0x416670
Capabilities:
Encode data using xor
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x8000c
call fcn.0045ed00
mov eax, dword [0x476018]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov ebx, ecx
push 0x505d9c
mov dword [ebp - 0x80008], ebx
mov esi, edx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
test ebx, ebx
js 0x416787
xor eax, eax
cmp ebx, 0x1388
setl al
test eax, eax
je 0x416787
imul ebx, ebx, 0x6c
add ebx, 0x47ac80
mov eax, dword [ebx + 4]
test eax, eax
js 0x416787
xor ecx, ecx
cmp eax, 0x1388
setl cl
mov eax, ecx
test eax, eax
je 0x416787
cmp dword [ebx + 8], 0
je 0x416787
cmp dword [ebx + 0x1c], 0xffffffff
je 0x416787
push edi
lea edx, [ebp - 0x80004]
push esi
push edx
call sub.MSVCR100.dll_memcpy
add esp, 0xc
xor eax, eax
cmp byte [ebp - 0x80004], 0xc1
jne 0x41673a
mov cl, byte [ebp - 0x80002]
lea esi, [edi - 3]
test esi, esi
jle 0x416768
mov edi, edi
mov dl, byte [ebp + eax - 0x80001]
xor dl, 0xa0
sub dl, cl
mov byte [ebp + eax - 0x80001], dl
inc eax
cmp eax, esi
jl 0x416720
jmp 0x416768
mov cl, byte [ebp - 0x80001]
lea esi, [edi - 4]
test esi, esi
jle 0x416768
jmp 0x416750
mov dl, byte [ebp + eax - 0x80000]
xor dl, 0xa0
sub dl, cl
mov byte [ebp + eax - 0x80000], dl
inc eax
cmp eax, esi
jl 0x416750
cmp edi, 0x80000
jle 0x4167a4
mov eax, dword [ebp - 0x80008]
push edi
push eax
push str._SocketManager__Max_msg_size__Type:_1__Index:__d__Size:__d_
push 1
call fcn.00417090
add esp, 0x10
push 0x505d9c
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop esi
xor al, al
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004183ef
mov esp, ebp
pop ebp
ret
mov esi, dword [ebx + 0x24]
mov eax, dword [esi + 0x20]
test eax, eax
jle 0x41683e
mov eax, dword [esi + 0x180028]
lea ecx, [eax + edi]
cmp ecx, 0x100000
jle 0x416803
mov esi, dword [ebp - 0x80008]
push ecx
push esi
push str._SocketManager__Max_msg_size__Type:_2__Index:__d__Size:__d_
push 1
call fcn.00417090
add esp, 0x10
mov eax, esi
mov ecx, 0x505d20
call fcn.004168d0
push 0x505d9c
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop esi
xor al, al
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004183ef
mov esp, ebp
pop ebp
ret
push edi
lea ecx, [ebp - 0x80004]
push ecx
lea edx, [eax + esi + 0x80028]
push edx
call sub.MSVCR100.dll_memcpy
add esp, 0xc
add dword [esi + 0x180028], edi
push 0x505d9c
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [ebp - 4]
pop esi
xor ecx, ebp
mov al, 1
pop ebx
call fcn.004183ef
mov esp, ebp
pop ebp
ret
push edi
lea ecx, [ebp - 0x80004]
push ecx
lea edx, [eax + esi + 0x24]
push edx
call sub.MSVCR100.dll_memcpy
add dword [esi + 0x20], edi
mov ecx, dword [esi + 0x20]
add esp, 0xc
lea eax, [esi + 0x24]
mov dword [esi + 0x18], eax
lea eax, [esi + 0x14]
mov dword [eax], ecx
xor ecx, ecx
push ecx
push esi
push ecx
mov dword [esi + 0x80024], ecx
mov dword [esi + 0x1c], 1
mov edx, dword [ebx + 0x1c]
mov dword [ebp - 0x8000c], ecx
lea ecx, [ebp - 0x8000c]
push ecx
push 1
push eax
push edx
call dword [sym.imp.WS2_32.dll_WSASend]
cmp eax, 0xffffffff
jne 0x416821
mov esi, dword [sym.imp.WS2_32.dll_WSAGetLastError]
call esi
cmp eax, 0x3e5
je 0x416821
call esi
push eax
push str._SocketManager__WSASend___failed_with_error:__d
push 1
call fcn.00417090
mov eax, dword [ebp - 0x80008]
add esp, 0xc
jmp 0x4167dc