Function at 0x417e90
Capabilities:
Check for time delay via queryperformancecounter
Connect socket
Get socket status
Receive data
Receive data on socket
Resolve dns
Set socket configuration

Disassembly:
sub esp, 0x1a4
mov eax, dword [0x5e4a44]
xor eax, esp
mov dword [esp + 0x19c], eax
push ebx
push ebp
push esi
push edi
xor ebp, ebp
push ebp
push 1
mov ebx, ecx
push 2
mov dword [esp + 0x48], ebx
call dword [sym.imp.WS2_32.dll_socket]
mov dword [ebx + 0x4ecc], eax
cmp eax, 0xffffffff
jne 0x417ef6
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, dword [ebx + 0xc]
mov dword [ecx], eax
mov edx, dword [ebx + 0xc]
mov eax, dword [edx]
mov ecx, dword [ebx + 0x10]
push eax
push 0x5afb0c
push ecx
call fcn.00403110
add esp, 0xc
mov dword [ebx + 0x4ecc], ebp
lea eax, [ebp - 2]
jmp 0x41862e
xor eax, eax
mov dword [esp + 0x164], eax
mov dword [esp + 0x168], eax
mov dword [esp + 0x16c], eax
mov dword [esp + 0x170], eax
mov eax, dword [ebx + 4]
mov edx, 2
push eax
mov word [esp + 0x168], dx
call dword [sym.imp.WS2_32.dll_inet_addr]
mov dword [esp + 0x168], eax
cmp eax, 0xffffffff
jne 0x417f57
mov eax, dword [ebx + 4]
push eax
call dword [sym.imp.WS2_32.dll_gethostbyname]
cmp eax, ebp
je 0x417fdf
mov eax, dword [eax + 0xc]
mov ecx, dword [eax]
mov edx, dword [ecx]
mov dword [esp + 0x168], edx
movzx ecx, word [ebx + 8]
push ecx
call dword [sym.imp.WS2_32.dll_htons]
mov esi, dword [sym.imp.WS2_32.dll_setsockopt]
push 4
lea edx, [esp + 0x20]
push edx
push 0x1002
mov word [esp + 0x172], ax
mov eax, dword [ebx + 0x4ecc]
push 0xffff
push eax
mov dword [esp + 0x30], 0x10000
call esi
cmp eax, 0xffffffff
jne 0x418022
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, dword [ebx + 0xc]
mov dword [ecx], eax
mov edx, dword [esp + 0x1c]
mov eax, dword [ebx + 0xc]
mov ecx, dword [eax]
push edx
mov edx, dword [ebx + 0x10]
push ecx
push 0x5afb34
push edx
call fcn.00403110
mov eax, dword [ebx + 0x4ecc]
add esp, 0x10
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [ebx + 0x4ecc], ebp
mov eax, 0xfffffffc
jmp 0x41862e
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, dword [ebx + 0xc]
mov dword [ecx], eax
mov edx, dword [ebx + 4]
mov eax, dword [ebx + 0xc]
mov ecx, dword [eax]
push edx
mov edx, dword [ebx + 0x10]
push ecx
push 0x5afb20
push edx
call fcn.00403110
mov eax, dword [ebx + 0x4ecc]
add esp, 0x10
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [ebx + 0x4ecc], ebp
mov eax, 0xfffffffd
jmp 0x41862e
mov edx, dword [ebx + 0x4ecc]
push 4
lea ecx, [esp + 0x20]
push ecx
push 0x1001
push 0xffff
push edx
call esi
cmp eax, 0xffffffff
jne 0x418085
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, dword [ebx + 0xc]
mov dword [ecx], eax
mov edx, dword [esp + 0x1c]
mov eax, dword [ebx + 0xc]
mov ecx, dword [eax]
push edx
mov edx, dword [ebx + 0x10]
push ecx
push 0x5afb4c
push edx
call fcn.00403110
mov eax, dword [ebx + 0x4ecc]
add esp, 0x10
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [ebx + 0x4ecc], ebp
mov eax, 0xfffffffb
jmp 0x41862e
mov edx, dword [ebx + 0x4ecc]
push 0x10
lea ecx, [esp + 0x168]
push ecx
push edx
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x4180fa
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, dword [ebx + 0xc]
mov dword [ecx], eax
movzx edx, word [esp + 0x166]
mov eax, dword [esp + 0x168]
movzx ecx, word [ebx + 8]
push edx
mov edx, dword [ebx + 4]
push eax
mov eax, dword [ebx + 0xc]
push ecx
mov ecx, dword [eax]
push edx
mov edx, dword [ebx + 0x10]
push ecx
push 0x5afb64
push edx
call fcn.00403110
mov eax, dword [ebx + 0x4ecc]
add esp, 0x1c
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [ebx + 0x4ecc], ebp
mov eax, 0xfffffffa
jmp 0x41862e
mov ecx, dword [esp + 0x1c]
push ecx
call fcn.00450d15
add esp, 4
mov dword [esp + 0x28], eax
cmp eax, ebp
jne 0x418147
mov edx, dword [ebx + 0xc]
mov dword [edx], ebp
mov eax, dword [ebx + 0x4ecc]
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
mov ecx, dword [esp + 0x1c]
mov edx, dword [ebx + 0x10]
push ecx
push 0x5afb98
push edx
mov dword [ebx + 0x4ecc], ebp
call fcn.00403110
add esp, 0xc
mov eax, 0xfffffff9
jmp 0x41862e
lea eax, [esp + 0x174]
mov byte [esp + 0x17], 1
mov dword [esp + 0x24], 0xfffffff8
mov byte [esp + 0x15], 1
mov byte [esp + 0x16], 1
call fcn.00419860
lea eax, [esp + 0x30]
push eax
mov dword [esp + 0x1c], ebp
call dword [sym.imp.KERNEL32.dll_QueryPerformanceFrequency]
mov ecx, dword [esp + 0x30]
mov eax, dword [esp + 0x34]
mov edi, ecx
mov dword [esp + 0x40], edi
mov dword [esp + 0x44], eax
test eax, eax
jg 0x4181a5
jl 0x418195
test ecx, ecx
ja 0x4181a5
mov dword [esp + 0x40], 0x2dc6c0
mov edi, dword [esp + 0x40]
mov dword [esp + 0x44], ebp
lea ecx, [esp + 0x48]
push ecx
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
lea edx, [esp + 0x30]
push edx
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov eax, dword [esp + 0x30]
sub eax, dword [esp + 0x48]
mov ecx, dword [esp + 0x34]
sbb ecx, dword [esp + 0x4c]
push 0
push 0x3e8
push ecx
push eax
call fcn.00559830
mov ecx, dword [esp + 0x44]
push ecx
push edi
push edx
push eax
call fcn.00559870
test edx, edx
jg 0x41859c
jl 0x4181fb
cmp eax, 0x4e20
ja 0x41859c
mov edx, dword [ebx + 0x4ecc]
lea eax, [esp + 0x50]
push eax
push 0
push 0
lea ecx, [esp + 0x64]
push ecx
push 0
mov dword [esp + 0x6c], 1
mov dword [esp + 0x70], edx
mov dword [esp + 0x64], 2
mov dword [esp + 0x68], 0
call dword [sym.imp.WS2_32.dll_select]
mov esi, eax
cmp esi, 0xffffffff
je 0x4185b4
test esi, esi
je 0x4185da
jge 0x418280
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edx, dword [ebx + 0xc]
mov dword [edx], eax
mov eax, dword [ebx + 0xc]
mov ecx, dword [eax]
mov edx, dword [ebx + 0x10]
push esi
push ecx
push str.select
push edx
call fcn.00403110
add esp, 0x10
cmp byte [esp + 0x15], 0
jne 0x4181b0
jmp 0x418606
lea eax, [esp + 0x30]
push eax
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov ecx, dword [esp + 0x30]
sub ecx, dword [esp + 0x48]
mov edx, dword [esp + 0x34]
sbb edx, dword [esp + 0x4c]
push 0
push 0x3e8
push edx
push ecx
call fcn.00559830
mov ecx, dword [esp + 0x44]
push ecx
push edi
push edx
push eax
call fcn.00559870
test edx, edx
jg 0x418537
jl 0x4182cb
cmp eax, 0x4e20
ja 0x418537
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x28]
push 0
sub edx, ebp
push edx
mov edx, dword [ebx + 0x4ecc]
lea ecx, [eax + ebp]
push ecx
push edx
call dword [sym.imp.WS2_32.dll_recv]
mov esi, eax
cmp esi, 0xffffffff
je 0x418552
test esi, esi
jl 0x41857b
je 0x41826b
mov edi, dword [esp + 0x28]
add ebp, esi
mov bl, 1
mov esi, ebp
mov dword [esp + 0x20], ebp
mov dword [esp + 0x178], edi
mov byte [esp + 0x174], bl
mov byte [esp + 0x175], bl
mov dword [esp + 0x17c], ebp
mov dword [esp + 0x180], ebp
mov dword [esp + 0x184], esi
mov byte [esp + 0x1aa], bl
cmp byte [esp + 0x16], 0
je 0x4183b9
cmp esi, 2
jl 0x4184f0
test bl, bl
je 0x418363
cmp ebp, 2
jae 0x418391
xor bl, bl
mov byte [esp + 0x174], bl
mov byte [esp + 0x2c], 0
mov ecx, dword [esp + 0x2c]
push ecx
call dword [sym.imp.WS2_32.dll_ntohs]
movzx edx, ax
mov eax, 0x55aa
sub esi, 2
mov dword [esp + 0x2c], edx
cmp ax, dx
je 0x4183af
cmp esi, 2
jge 0x418351
jmp 0x4184f0
mov ax, word [edi]
sub ebp, 2
add edi, 2
mov word [esp + 0x2c], ax
mov dword [esp + 0x180], ebp
mov dword [esp + 0x178], edi
jmp 0x418368
mov byte [esp + 0x16], 0
jmp 0x4184cd
cmp byte [esp + 0x17], 0
je 0x418458
cmp esi, 4
jb 0x4184f0
cmp byte [esp + 0x1a9], 0
je 0x418409
lea edi, [esp + 0x18]
lea eax, [esp + 0x174]
call fcn.00419c70
mov ebp, dword [esp + 0x180]
mov edi, dword [esp + 0x178]
mov bl, byte [esp + 0x174]
sub esi, 4
mov byte [esp + 0x17], 0
jmp 0x4184cd
test bl, bl
je 0x41841b
cmp ebp, 4
jae 0x41843c
xor bl, bl
mov byte [esp + 0x174], bl
mov byte [esp + 0x18], 0
mov edx, dword [esp + 0x18]
push edx
call dword [sym.imp.WS2_32.dll_ntohl]
mov dword [esp + 0x18], eax
sub esi, 4
mov byte [esp + 0x17], 0
jmp 0x4184cd
mov ecx, dword [edi]
sub ebp, 4
add edi, 4
mov dword [esp + 0x18], ecx
mov dword [esp + 0x180], ebp
mov dword [esp + 0x178], edi
jmp 0x418420
cmp esi, dword [esp + 0x18]
jl 0x4184f0
mov edx, dword [esp + 0x20]
mov ebp, dword [esp + 0x28]
mov ebx, dword [esp + 0x3c]
mov edi, dword [esp + 0x18]
sub edx, esi
add edx, ebp
push ebx
mov ecx, edi
call fcn.00417930
test al, al
jne 0x4184da
sub esi, edi
mov edi, dword [esp + 0x20]
sub edi, esi
mov bl, 1
add edi, ebp
mov ebp, esi
mov dword [esp + 0x178], edi
mov byte [esp + 0x174], bl
mov byte [esp + 0x175], bl
mov dword [esp + 0x17c], esi
mov dword [esp + 0x180], ebp
mov dword [esp + 0x184], esi
mov byte [esp + 0x1aa], bl
mov byte [esp + 0x16], bl
mov byte [esp + 0x17], bl
test esi, esi
je 0x4184f0
cmp byte [esp + 0x15], 0
jne 0x418341
jmp 0x4184f0
mov eax, dword [ebx + 0xc]
mov eax, dword [eax]
dec eax
neg eax
sbb eax, eax
and eax, 0xfffffff1
mov dword [esp + 0x24], eax
mov byte [esp + 0x15], 0
mov eax, dword [esp + 0x20]
cmp esi, eax
jge 0x41851b
test esi, esi
jle 0x418513
mov ecx, eax
mov eax, dword [esp + 0x28]
sub ecx, esi
push esi
add ecx, eax
push ecx
push eax
call fcn.00551c40
add esp, 0xc
jmp 0x41851b
mov dword [esp + 0x20], 0
cmp byte [esp + 0x15], 0
mov ebx, dword [esp + 0x3c]
je 0x418606
mov ebp, dword [esp + 0x20]
mov edi, dword [esp + 0x40]
jmp 0x418280
mov edx, dword [ebx + 0xc]
mov dword [edx], 0xffffffff
mov ecx, dword [ebx + 0x10]
push 0x5afde0
call fcn.00402eb0
jmp 0x418606
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, dword [ebx + 0xc]
mov dword [ecx], eax
mov edx, dword [ebx + 0xc]
mov eax, dword [edx]
mov ecx, dword [ebx + 0x10]
push 0xffffffffffffffff
push eax
push 0x5afbd4
mov dword [esp + 0x30], 0xfffffff5
push ecx
jmp 0x4185fe
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edx, dword [ebx + 0xc]
mov dword [edx], eax
mov eax, dword [ebx + 0xc]
mov ecx, dword [eax]
push esi
push ecx
mov dword [esp + 0x2c], 0xfffffff4
push 0x5afbd4
jmp 0x4185fa
mov eax, dword [ebx + 0xc]
mov dword [eax], 0xffffffff
mov ecx, dword [ebx + 0x10]
push 0x5afde0
call fcn.00402eb0
jmp 0x418606
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, dword [ebx + 0xc]
mov dword [ecx], eax
mov edx, dword [ebx + 0xc]
mov eax, dword [edx]
mov ecx, dword [ebx + 0x10]
push 0xffffffffffffffff
push eax
push str.select
mov dword [esp + 0x30], 0xfffffff7
push ecx
jmp 0x4185fe
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edx, dword [ebx + 0xc]
mov dword [edx], eax
mov eax, dword [ebx + 0xc]
mov ecx, dword [eax]
push 0
push ecx
mov dword [esp + 0x2c], 0xfffffff6
push str.select
mov edx, dword [ebx + 0x10]
push edx
call fcn.00403110
add esp, 0x10
mov eax, dword [esp + 0x28]
push eax
call fcn.00450d0a
mov ecx, dword [ebx + 0x4ecc]
add esp, 4
push ecx
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, dword [esp + 0x24]
mov dword [ebx + 0x4ecc], 0
mov ecx, dword [esp + 0x1ac]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.005509f8
add esp, 0x1a4
ret