Function at 0x404860
Capabilities:
Connect socket
Create raw socket
Receive data
Receive data on socket
Send data
Send data on socket
Set socket configuration

Disassembly:
mov eax, 0x2cac
call fcn.00406900
mov edx, dword [esp + 0x2cb8]
push ebx
push ebp
push esi
push edi
mov edi, edx
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea ebx, [esp + 0x4bc]
mov eax, ecx
mov esi, edi
mov edi, ebx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov edi, ecx
mov ecx, dword [esp + 0x2cc0]
push ecx
call dword [sym.imp.WS2_32.dll_inet_addr]
xor edx, edx
mov esi, eax
mov eax, dword [esp + 0x2cc4]
mov dword [esp + 0x18], edx
mov dword [esp + 0x1c], edx
push eax
mov dword [esp + 0x24], edx
mov word [esp + 0x1c], 2
mov dword [esp + 0x28], edx
call dword [sym.imp.WS2_32.dll_htons]
xor ebp, ebp
mov word [esp + 0x1a], ax
push ebp
push 1
push 2
mov dword [esp + 0x28], esi
call dword [sym.imp.WS2_32.dll_socket]
mov esi, eax
cmp esi, 0xffffffff
jne 0x40490d
pop edi
pop esi
pop ebp
mov eax, 0x80040209
pop ebx
add esp, 0x2cac
ret
lea ecx, [esp + 0x18]
push 0x10
push ecx
push esi
call dword [sym.imp.WS2_32.dll_connect]
lea edx, [esp + 0x28]
mov dword [esp + 0x28], 1
push edx
push 0x8004667e
push esi
call dword [sym.imp.WS2_32.dll_ioctlsocket]
push ebp
lea eax, [esp + 0x4c0]
push edi
push eax
push esi
call dword [sym.imp.WS2_32.dll_send]
lea edi, [esp + 0x4bc]
call dword [sym.imp.WS2_32.dll_WSACreateEvent]
push 1
push eax
push esi
mov dword [esp + 0x1c], eax
call dword [sym.imp.WS2_32.dll_WSAEventSelect]
mov ebx, dword [sym.imp.WS2_32.dll_recv]
mov dword [esp + 0x14], ebp
push 0
push 0x1f4
lea ecx, [esp + 0x18]
push 0
push ecx
push 1
call dword [sym.imp.WS2_32.dll_WSAWaitForMultipleEvents]
cmp eax, 0x102
je 0x4049e6
test eax, eax
jne 0x4049d8
mov eax, dword [esp + 0x10]
lea edx, [esp + 0x2c]
push edx
push eax
push esi
call dword [sym.imp.WS2_32.dll_WSAEnumNetworkEvents]
test byte [esp + 0x2c], 1
je 0x4049d8
mov eax, dword [esp + 0x30]
test eax, eax
jne 0x4049d8
mov ecx, 0x2800
push 0
sub ecx, ebp
push ecx
push edi
push esi
call ebx
test eax, eax
je 0x4049e6
jle 0x4049c3
add edi, eax
add ebp, eax
lea edx, [esp + 0x4bc]
push ebp
push edx
call fcn.00404770
add esp, 8
test al, al
jne 0x4049e6
mov eax, dword [esp + 0x14]
inc eax
cmp eax, 5
mov dword [esp + 0x14], eax
jl 0x40496a
mov eax, dword [esp + 0x10]
push 0
push eax
push esi
call dword [sym.imp.WS2_32.dll_WSAEventSelect]
mov ecx, dword [esp + 0x10]
push ecx
call dword [sym.imp.WS2_32.dll_WSACloseEvent]
mov edi, dword [sym.imp.WS2_32.dll_closesocket]
push esi
call edi
test ebp, ebp
jg 0x404a1c
pop edi
pop esi
pop ebp
mov eax, 0x80040203
pop ebx
add esp, 0x2cac
ret
push esi
call edi
cmp ebp, 0xffffffff
jne 0x404a34
pop edi
pop esi
pop ebp
mov eax, 0x80040203
pop ebx
add esp, 0x2cac
ret
mov ebx, dword [esp + 0x2ccc]
mov ecx, ebp
mov edx, ecx
lea esi, [esp + 0x4bc]
mov edi, ebx
lea eax, [esp + 0xbc]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
push eax
and ecx, 3
push ebx
rep movsb byte es:[edi], byte [esi]
mov byte [ebx + ebp], 0
call fcn.004042a0
add esp, 8
test al, al
jne 0x404abc
lea ecx, [esp + 0x58]
or esi, 0xffffffff
push ecx
push str.errorCode
push ebx
call fcn.00404630
lea edi, [esp + 0x64]
or ecx, 0xffffffff
xor eax, eax
add esp, 0xc
repne scasb al, byte es:[edi]
not ecx
dec ecx
je 0x404aa3
lea edx, [esp + 0x58]
push edx
call dword [sym.imp.MSVCRT.dll_atoi]
add esp, 4
mov esi, eax
push esi
call fcn.00404760
add esp, 4
mov eax, 0x80040211
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2cac
ret
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x2cac
ret