Function at 0x505920
Capabilities:
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
sub esp, 0x440
mov eax, dword [0x6687b8]
xor eax, esp
mov dword [esp + 0x43c], eax
push ebx
push ebp
mov ebp, dword [esp + 0x44c]
push esi
mov ebx, ecx
push edi
mov dword [esp + 0x18], ebx
call dword [0x668114]
movzx edi, word [ebp + 0x382]
lea eax, [esp + 0x1c]
lea ecx, [ebp + 0x282]
push eax
mov dword [esp + 0x18], 0xffffff9e
call fcn.00470800
mov eax, dword [eax]
push edi
mov esi, eax
lea edi, [esp + 0x30]
call fcn.00506690
mov esi, eax
mov eax, dword [esp + 0x20]
add eax, 0xfffffff0
add esp, 4
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x50599d
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
test esi, esi
jne 0x5059ed
mov ecx, dword [esp + 0x30]
mov dx, word [esp + 0x2e]
xor eax, eax
mov dword [esp + 0x20], eax
push eax
mov dword [esp + 0x28], eax
mov word [esp + 0x2c], ax
mov byte [esp + 0x26], al
push 0xa
lea eax, [esp + 0x28]
mov dword [esp + 0x2c], ecx
mov ecx, dword [ebx]
push eax
push ecx
mov byte [esp + 0x30], 5
mov byte [esp + 0x31], 1
mov byte [esp + 0x33], 1
mov word [esp + 0x38], dx
call dword [sym.imp.WS2_32.dll_send]
mov edi, eax
jmp 0x505aad
push 0x1f4
call fcn.005d1ef5
mov esi, eax
mov byte [esi], 5
mov byte [esi + 1], 1
lea eax, [ebp + 0x282]
mov byte [esi + 2], 0
add esp, 4
mov byte [esi + 3], 3
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x505a14
sub eax, edx
sar eax, 1
mov ebx, eax
cmp ebx, 0x100
jle 0x505a60
push esi
call fcn.005d28c2
mov edi, dword [esp + 0x1c]
mov esi, dword [edi]
add esp, 4
test esi, esi
je 0x505a50
push 1
push esi
call dword [sym.imp.WS2_32.dll_shutdown]
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [edi], 0xffffffff
mov eax, 0xffffffa4
jmp 0x505b50
push ebx
lea eax, [ebp + 0x282]
push eax
lea edx, [esi + 5]
push edx
mov byte [esi + 4], bl
call fcn.005d8ed0
movzx eax, word [ebp + 0x382]
add esp, 0xc
push eax
call dword [sym.imp.WS2_32.dll_htons]
mov ecx, dword [esp + 0x18]
mov word [ebx + esi + 5], ax
mov edx, dword [ecx]
push 0
add ebx, 7
push ebx
push esi
push edx
call dword [sym.imp.WS2_32.dll_send]
push esi
mov edi, eax
call fcn.005d28c2
mov ebx, dword [esp + 0x1c]
add esp, 4
test edi, edi
jle 0x505b28
mov ecx, dword [ebx]
push 0
push 0x400
lea eax, [esp + 0x50]
push eax
push ecx
call dword [sym.imp.WS2_32.dll_recv]
cmp eax, 9
jge 0x505aeb
mov esi, dword [ebx]
test esi, esi
mov dword [esp + 0x14], 0xffffffa2
je 0x505b46
push 1
push esi
call dword [sym.imp.WS2_32.dll_shutdown]
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
jmp 0x505b46
xor edx, edx
mov dword [esp + 0x2c], edx
mov dword [esp + 0x30], edx
mov dword [esp + 0x34], edx
mov dword [esp + 0x38], edx
mov dword [esp + 0x3c], edx
mov dword [esp + 0x40], edx
mov word [esp + 0x44], dx
lea edx, [esp + 0x2c]
push edx
mov ecx, eax
lea edx, [esp + 0x4c]
call fcn.00505720
test eax, eax
je 0x505b4c
mov dword [esp + 0x14], 0
jmp 0x505b4c
mov esi, dword [ebx]
test esi, esi
je 0x505b3e
push 1
push esi
call dword [sym.imp.WS2_32.dll_shutdown]
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [esp + 0x14], 0xffffffa1
mov dword [ebx], 0xffffffff
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x44c]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.005d28b3
add esp, 0x440
ret 4