Function at 0x4038cf
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
push esi
push ebx
sub esp, 0x40
mov edx, dword [ebp + 0xc]
mov eax, dword [ebp + 0x14]
mov word [ebp - 0x1c], dx
mov word [ebp - 0x20], ax
mov eax, dword [sym.imp.msvcrt.dll__errno]
call eax
mov dword [eax], 0
mov dword [esp], 0
mov eax, dword [sym.imp.WSOCK32.DLL_WSASetLastError]
call eax
sub esp, 4
movzx eax, word [0x412120]
test ax, ax
je 0x403937
mov dword [esp + 8], 0x11
mov dword [esp + 4], 2
mov dword [esp], 2
mov eax, dword [sym.imp.WSOCK32.DLL_socket]
call eax
sub esp, 0xc
mov dword [0x41210c], eax
jmp 0x40395d
mov dword [esp + 8], 6
mov dword [esp + 4], 1
mov dword [esp], 2
mov eax, dword [sym.imp.WSOCK32.DLL_socket]
call eax
sub esp, 0xc
mov dword [0x41210c], eax
mov eax, dword [0x41210c]
test eax, eax
jns 0x403972
mov dword [esp], str.Cant_get_socket
call fcn.0040309e
mov eax, dword [0x41210c]
test eax, eax
jne 0x40398d
mov eax, dword [0x41210c]
mov dword [esp], eax
call sub.msvcrt.dll__dup
mov dword [0x41210c], eax
mov eax, dword [0x412108]
mov edx, dword [0x41210c]
mov dword [esp + 0x10], 4
mov dword [esp + 0xc], eax
mov dword [esp + 8], 4
mov dword [esp + 4], 0xffff
mov dword [esp], edx
mov eax, dword [sym.imp.WSOCK32.DLL_setsockopt]
call eax
sub esp, 0x14
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x4039d4
mov dword [esp], str.nnetfd_reuseaddr_failed
call fcn.00402fc6
mov eax, dword [0x4120e0]
mov word [eax], 2
mov eax, dword [0x4120e4]
mov word [eax], 2
cmp dword [ebp + 0x10], 0
je 0x4039fd
mov eax, dword [0x4120e0]
lea edx, [eax + 4]
mov eax, dword [ebp + 0x10]
mov eax, dword [eax]
mov dword [edx], eax
cmp word [ebp - 0x20], 0
je 0x403a1f
movzx eax, word [ebp - 0x20]
mov ebx, dword [0x4120e0]
mov dword [esp], eax
mov eax, dword [sym.imp.WSOCK32.DLL_htons]
call eax
sub esp, 4
mov word [ebx + 2], ax
mov ebx, 0
cmp dword [ebp + 0x10], 0
jne 0x403a35
cmp word [ebp - 0x20], 0
je 0x403ade
movzx eax, word [ebp - 0x20]
mov dword [ebp - 0x10], eax
mov dword [ebp - 0xc], 4
jmp 0x403ace
mov eax, dword [0x4120e0]
mov edx, dword [0x41210c]
mov dword [esp + 8], 0x10
mov dword [esp + 4], eax
mov dword [esp], edx
mov eax, dword [sym.imp.WSOCK32.DLL_bind]
call eax
sub esp, 0xc
mov ebx, eax
test ebx, ebx
je 0x403ada
mov eax, dword [sym.imp.msvcrt.dll__errno]
call eax
mov eax, dword [eax]
cmp eax, 0x2740
jne 0x403add
movzx esi, word [ebp - 0x20]
mov eax, dword [0x4120e0]
mov eax, dword [eax + 4]
mov dword [esp], eax
mov eax, dword [sym.imp.WSOCK32.DLL_inet_ntoa]
call eax
sub esp, 4
mov dword [esp + 8], esi
mov dword [esp + 4], eax
mov dword [esp], str.retrying_local__s:_d
call fcn.00402fc6
mov dword [esp], 1
mov eax, dword [sym.imp.msvcrt.dll__sleep]
call eax
mov eax, dword [sym.imp.msvcrt.dll__errno]
call eax
mov dword [eax], 0
sub dword [ebp - 0xc], 1
cmp dword [ebp - 0xc], 0
jg 0x403a48
jmp 0x403ade
nop
jmp 0x403ade
nop
test ebx, ebx
je 0x403b0f
movzx ebx, word [ebp - 0x20]
mov eax, dword [0x4120e0]
mov eax, dword [eax + 4]
mov dword [esp], eax
mov eax, dword [sym.imp.WSOCK32.DLL_inet_ntoa]
call eax
sub esp, 4
mov dword [esp + 8], ebx
mov dword [esp + 4], eax
mov dword [esp], str.Cant_grab__s:_d_with_bind
call fcn.0040309e
movzx eax, word [0x412118]
test ax, ax
je 0x403b25
mov eax, dword [0x41210c]
jmp 0x403c47
mov eax, dword [0x4120e4]
lea edx, [eax + 4]
mov eax, dword [ebp + 8]
mov eax, dword [eax]
mov dword [edx], eax
movzx eax, word [ebp - 0x1c]
mov ebx, dword [0x4120e4]
mov dword [esp], eax
mov eax, dword [sym.imp.WSOCK32.DLL_htons]
call eax
sub esp, 4
mov word [ebx + 2], ax
mov eax, dword [0x4120c8]
test eax, eax
je 0x403b64
mov dword [esp], str.Warning:_source_routing_unavailable_on_this_machine__ignoring
call fcn.00402fc6
mov eax, dword [0x412124]
mov dword [esp + 4], eax
mov dword [esp], 1
call fcn.004031a8
mov dword [esp + 4], 0
mov dword [esp], 0x412080
call sub.msvcrt.dll__setjmp3
test eax, eax
jne 0x403bb9
mov eax, dword [0x4120e4]
mov edx, dword [0x41210c]
mov dword [esp + 8], 0x10
mov dword [esp + 4], eax
mov dword [esp], edx
mov eax, dword [sym.imp.WSOCK32.DLL_connect]
call eax
sub esp, 0xc
mov ebx, eax
jmp 0x403bcf
mov ebx, 0xffffffff
mov dword [esp], 0x274c
mov eax, dword [sym.imp.WSOCK32.DLL_WSASetLastError]
call eax
sub esp, 4
mov dword [esp + 4], 0
mov dword [esp], 0
call fcn.004031a8
test ebx, ebx
jne 0x403bee
mov eax, dword [0x41210c]
jmp 0x403c47
mov eax, dword [sym.imp.msvcrt.dll__errno]
call eax
mov ebx, eax
mov eax, dword [sym.imp.WSOCK32.DLL_WSAGetLastError]
call eax
mov dword [ebx], eax
mov eax, dword [0x41210c]
mov dword [esp + 4], 2
mov dword [esp], eax
mov eax, dword [sym.imp.WSOCK32.DLL_shutdown]
call eax
sub esp, 8
mov eax, dword [0x41210c]
mov dword [esp], eax
mov eax, dword [sym.imp.WSOCK32.DLL_closesocket]
call eax
sub esp, 4
mov eax, dword [sym.imp.msvcrt.dll__errno]
call eax
mov eax, dword [eax]
mov dword [esp], eax
mov eax, dword [sym.imp.WSOCK32.DLL_WSASetLastError]
call eax
sub esp, 4
mov eax, 0xffffffff
lea esp, [ebp - 8]
pop ebx
pop esi
pop ebp
ret