Function at 0x4161d0
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Get socket status
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34c
mov eax, dword [0x4ff004]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
mov edi, dword [ebp + 0x14]
mov eax, ecx
push 6
push 1
push 2
mov ebx, edx
mov dword [ebp - 0x34c], eax
mov byte [ebp - 0x331], 1
mov dword [eax], 0xffffffff
call dword [sym.imp.WS2_32.dll_socket]
mov esi, eax
cmp esi, 0xffffffff
jne 0x416246
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test edi, edi
je 0x416557
push edi
push eax
mov edx, 0x1cd
mov ecx, str.ytcp
call fcn.00415bd0
add esp, 8
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004423fe
mov esp, ebp
pop ebp
ret
push dword [ebp + 8]
xorps xmm0, xmm0
mov eax, 2
movups xmmword [ebp - 0x14], xmm0
mov word [ebp - 0x14], ax
mov dword [ebp - 0x10], ebx
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x12], ax
lea eax, [ebp - 0x344]
push eax
push 0x8004667e
push esi
mov dword [ebp - 0x344], 1
call dword [sym.imp.WS2_32.dll_ioctlsocket]
push 0x10
lea eax, [ebp - 0x14]
push eax
push esi
call dword [sym.imp.WS2_32.dll_connect]
mov ecx, dword [ebp + 0xc]
xorps xmm0, xmm0
mov edx, dword [ebp + 0x10]
mov eax, ecx
or eax, edx
movlpd qword [ebp - 0x340], xmm0
je 0x4162d4
push 0
push 0x3e8
push edx
push ecx
call fcn.0045f970
mov ecx, dword [ebp + 0xc]
mov dword [ebp - 0x340], eax
imul eax, eax, 0x3e8
sub ecx, eax
imul eax, ecx, 0x3e8
mov dword [ebp - 0x33c], eax
jmp 0x4162de
mov dword [ebp - 0x340], 0x14
lea eax, [ebp - 0x340]
mov dword [ebp - 0x32c], esi
push eax
lea eax, [ebp - 0x120]
mov dword [ebp - 0x330], 1
push eax
lea eax, [ebp - 0x228]
mov dword [ebp - 0x224], esi
push eax
lea eax, [ebp - 0x330]
mov dword [ebp - 0x228], 1
push eax
lea eax, [esi + 1]
mov dword [ebp - 0x11c], esi
push eax
mov dword [ebp - 0x120], 1
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
jns 0x4163de
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov esi, eax
test edi, edi
je 0x416557
push esi
push 0x1fc
push str.ytcp
push str._s:_d:tcp__d_:
push 0x100
push edi
call fcn.0041c830
mov ecx, edi
add esp, 0x18
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x416376
push 0
sub ecx, edx
mov eax, 0x100
sub eax, ecx
push eax
lea eax, [edi + ecx]
push eax
push 0x400
push esi
push 0
push 0x1200
call dword [sym.imp.KERNEL32.dll_FormatMessageA]
mov ecx, edi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4163a5
sub ecx, edx
test ecx, ecx
jle 0x416557
dec ecx
mov edx, 1
add ecx, edi
sub edx, edi
mov al, byte [ecx]
cmp al, 0xa
je 0x4163ce
cmp al, 0xd
jne 0x416557
mov byte [ecx], 0
dec ecx
lea eax, [edx + ecx]
test eax, eax
jg 0x4163c0
jmp 0x416557
lea eax, [ebp - 0x120]
push eax
push esi
call dword [sym.imp.WS2_32.dll___WSAFDIsSet]
test eax, eax
jne 0x416516
lea eax, [ebp - 0x228]
push eax
push esi
call dword [sym.imp.WS2_32.dll___WSAFDIsSet]
test eax, eax
je 0x416516
push 1
lea eax, [ebp - 0x331]
push eax
push 1
push 6
push esi
call dword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
jns 0x416440
call fcn.0044c515
push dword [eax]
push str.SetSockOpt_TCP_NODELAY_failed__d_n
push 0x226
push str.ytcp
call fcn.00409950
add esp, 0x10
lea eax, [ebp - 0x348]
mov dword [ebp - 0x348], 4
push eax
lea eax, [ebp - 0x338]
push eax
push 0x1001
push 0xffff
push esi
call dword [sym.imp.WS2_32.dll_getsockopt]
test eax, eax
js 0x4164e4
cmp dword [ebp - 0x338], 0x40000
jge 0x4164fb
push 4
lea eax, [ebp - 0x338]
mov dword [ebp - 0x338], 0x40000
push eax
push 0x1001
push 0xffff
push esi
call dword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
jns 0x4164fb
call fcn.0044c515
push dword [eax]
push dword [ebp - 0x338]
push str.SetSockOpt_SO_SNDBUF__d_failed__d_n
push 0x249
push str.ytcp
call fcn.00409950
mov eax, dword [ebp - 0x34c]
add esp, 0x14
mov dword [eax], esi
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004423fe
mov esp, ebp
pop ebp
ret
push str.getsockopt:_unable_to_get_tcp_buffer_size_n
push 0x24d
push str.ytcp
call fcn.00409950
add esp, 0xc
mov eax, dword [ebp - 0x34c]
mov dword [eax], esi
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004423fe
mov esp, ebp
pop ebp
ret
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
test edi, edi
je 0x416557
mov eax, dword [ebp + 8]
movzx eax, ax
push eax
mov eax, ebx
shr eax, 0x18
push eax
mov eax, ebx
shr eax, 0x10
movzx eax, al
push eax
mov eax, ebx
shr eax, 8
movzx eax, al
push eax
movzx eax, bl
push eax
push str.Unable_to_connect_to__d._d._d._d:_d
push 0x100
push edi
call fcn.0041c830
add esp, 0x20
mov ecx, dword [ebp - 4]
mov eax, 0xfffffff8
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004423fe
mov esp, ebp
pop ebp
ret