Function at 0x40d1e0
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create raw socket
Create tcp socket
Create udp socket
Resolve dns
Set socket configuration
Start tcp server

Disassembly:
push ebp
mov ebp, esp
push ebx
push ecx
push esi
push edi
sub esp, 0x1c
mov esi, eax
mov dword [ebp - 0x14], edx
call fcn.0040d470
mov ebx, 0x10
lea eax, [ebp - 0x2c]
xor edx, edx
call fcn.0042c750
test esi, esi
je 0x40d291
push esi
call dword [sym.imp.WS2_32.DLL_gethostbyname]
test eax, eax
jne 0x40d21f
lea esp, [ebp - 0x10]
pop edi
pop esi
pop ecx
pop ebx
pop ebp
ret
lea edi, [ebp - 0x28]
mov ecx, dword [eax + 8]
mov esi, dword [eax + 0xc]
sar ecx, 0x10
mov esi, dword [esi]
push edi
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov cl, al
and cl, 3
rep movsb byte es:[edi], byte [esi]
pop edi
xor eax, eax
mov ax, word [ebp - 0x14]
push eax
mov word [ebp - 0x2c], 2
call dword [sym.imp.WS2_32.DLL_htons]
push 0
push 1
push 2
mov word [ebp - 0x2a], ax
call dword [sym.imp.WS2_32.DLL_socket]
mov dword [0x4593ac], eax
test eax, eax
jge 0x40d274
xor eax, eax
lea esp, [ebp - 0x10]
pop edi
pop esi
pop ecx
pop ebx
pop ebp
ret
push 0x10
lea ecx, [ebp - 0x2c]
push ecx
push eax
call dword [sym.imp.WS2_32.DLL_connect]
test eax, eax
jge 0x40d2d2
mov eax, dword [0x4593ac]
push eax
call dword [sym.imp.WS2_32.DLL_closesocket]
push 0
call dword [sym.imp.WS2_32.DLL_htonl]
mov dword [ebp - 0x28], eax
xor eax, eax
mov ax, word [ebp - 0x14]
push eax
mov word [ebp - 0x2c], 2
call dword [sym.imp.WS2_32.DLL_htons]
push 0
push 1
push 2
mov word [ebp - 0x2a], ax
call dword [sym.imp.WS2_32.DLL_socket]
mov esi, eax
mov ebx, eax
test eax, eax
jge 0x40d335
xor eax, eax
lea esp, [ebp - 0x10]
pop edi
pop esi
pop ecx
pop ebx
pop ebp
ret
cmp dword [0x4593b0], 0
sete al
and eax, 0xff
mov dword [ebp - 0x18], eax
lea eax, [ebp - 0x18]
push eax
push 0x8004667e
mov esi, dword [0x4593ac]
push esi
call dword [sym.imp.WS2_32.DLL_ioctlsocket]
test eax, eax
jl 0x40d314
xor edi, edi
mov eax, 1
mov dword [0x4593a8], edi
lea esp, [ebp - 0x10]
pop edi
pop esi
pop ecx
pop ebx
pop ebp
ret
mov eax, dword [0x4593ac]
push eax
call dword [sym.imp.WS2_32.DLL_closesocket]
mov dword [0x4593ac], 0xffffffff
xor eax, eax
lea esp, [ebp - 0x10]
pop edi
pop esi
pop ecx
pop ebx
pop ebp
ret
push 0x10
lea eax, [ebp - 0x2c]
push eax
push esi
call dword [sym.imp.WS2_32.DLL_bind]
test eax, eax
jl 0x40d3ee
lea eax, [ebp - 0x18]
push eax
push 0x8004667e
push esi
mov dword [ebp - 0x18], 1
call dword [sym.imp.WS2_32.DLL_ioctlsocket]
test eax, eax
jl 0x40d3ee
push 1
push esi
call dword [sym.imp.WS2_32.DLL_listen]
test eax, eax
jl 0x40d3ee
mov dword [ebp - 0x1c], 0x10
call fcn.00409bf0
xor esi, esi
mov eax, esi
call fcn.00408600
lea eax, [ebp - 0x1c]
push eax
lea eax, [ebp - 0x2c]
push eax
push ebx
call dword [sym.imp.WS2_32.DLL_accept]
mov dword [0x4593ac], eax
call dword [sym.imp.WS2_32.DLL_WSAGetLastError]
test eax, eax
je 0x40d3ba
call dword [sym.imp.WS2_32.DLL_WSAGetLastError]
cmp eax, 0x2733
jne 0x40d3d3
cmp esi, dword [0x4593ac]
jle 0x40d3d3
cmp esi, dword [0x454844]
je 0x40d3d3
call fcn.00409bf0
test eax, eax
je 0x40d388
push ebx
call dword [sym.imp.WS2_32.DLL_closesocket]
cmp dword [0x4593ac], 0
jge 0x40d400
xor eax, eax
lea esp, [ebp - 0x10]
pop edi
pop esi
pop ecx
pop ebx
pop ebp
ret
push esi
call dword [sym.imp.WS2_32.DLL_closesocket]
xor eax, eax
lea esp, [ebp - 0x10]
pop edi
pop esi
pop ecx
pop ebx
pop ebp
ret
cmp dword [0x4593b0], 0
sete al
and eax, 0xff
mov dword [ebp - 0x18], eax
lea eax, [ebp - 0x18]
push eax
push 0x8004667e
mov ecx, dword [0x4593ac]
push ecx
call dword [sym.imp.WS2_32.DLL_ioctlsocket]
test eax, eax
jl 0x40d444
mov dword [0x4593a8], 1
mov eax, 2
lea esp, [ebp - 0x10]
pop edi
pop esi
pop ecx
pop ebx
pop ebp
ret
mov esi, dword [0x4593ac]
push esi
call dword [sym.imp.WS2_32.DLL_closesocket]
mov dword [0x4593ac], 0xffffffff
xor eax, eax
lea esp, [ebp - 0x10]
pop edi
pop esi
pop ecx
pop ebx
pop ebp
ret