Function at 0x438380
Capabilities:
Connect socket
Get local ipv4 addresses
Get socket information
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
mov esi, edx
push ebx
sub esp, 0x1dc
mov dword [ebp - 0x1bc], eax
mov eax, dword [eax]
mov dword [ebp - 0x1c0], eax
mov eax, dword [edx + 0xc]
mov dword [esp + 8], eax
mov eax, dword [edx + 8]
mov dword [esp + 4], eax
mov eax, dword [edx + 4]
mov dword [esp], eax
call sub.WSOCK32.DLL_socket
mov dword [ebp - 0x1c4], eax
sub esp, 0xc
mov eax, 0xffffffff
cmp dword [ebp - 0x1c4], 0xffffffff
je 0x43845d
mov edx, dword [ebp + 0xc]
mov eax, pe_nt_image_headers32
mov byte [edx], 0
mov dword [esp + 8], eax
lea eax, [ebp - 0x98]
mov dword [esp + 4], eax
mov dword [esp], esi
call fcn.00428390
lea edx, [ebp - 0x98]
mov eax, str.__Trying__s...
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x1c0]
mov dword [esp], eax
call fcn.0042bba0
mov edx, dword [ebp - 0x1c0]
cmp byte [edx + 0x1ae], 0
jne 0x4385b0
mov edx, dword [ebp - 0x1bc]
mov edi, dword [edx]
mov eax, dword [edi + 0x74]
test eax, eax
je 0x438510
mov dword [esp], eax
call sub.msvcrt.dll_strlen
cmp eax, 0xfe
jbe 0x438465
mov edx, dword [ebp - 0x1c4]
mov dword [esp], edx
call sub.WSOCK32.DLL_closesocket
sub esp, 4
mov eax, 0xffffffff
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
movzx eax, byte [0x50ad00]
xor ecx, ecx
mov edx, 0xff
mov dword [ebp - 0x1b0], ecx
xor ebx, ebx
mov byte [ebp - 0x198], al
lea eax, [ebp - 0x197]
mov dword [esp + 8], edx
mov dword [esp + 4], ebx
mov dword [esp], eax
call sub.msvcrt.dll_memset
mov eax, dword [edi + 0x74]
mov dword [esp], eax
call sub.WS2_32.DLL_inet_addr
sub esp, 4
inc eax
je 0x43875b
xor eax, eax
lea ebx, [ebp - 0x1b0]
mov dword [esp + 0xc], ebx
mov dword [esp + 8], eax
mov eax, dword [edi + 0x74]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x1bc]
mov dword [esp], eax
call fcn.00428570
dec eax
je 0x4387f7
mov eax, dword [ebp - 0x1b0]
test eax, eax
jne 0x43872f
cmp byte [ebp - 0x198], 0
jne 0x438620
mov eax, dword [edi + 0x74]
mov dword [esp + 8], eax
mov eax, str.Couldnt_bind_to__s
mov dword [esp + 4], eax
mov dword [esp], edi
call fcn.0042b7c0
jmp 0x438447
mov edx, 1
mov dword [esp + 4], edx
mov eax, dword [ebp - 0x1c4]
mov dword [esp], eax
call fcn.00438200
mov eax, dword [esi + 0x10]
mov dword [esp + 8], eax
mov eax, dword [esi + 0x14]
mov dword [esp + 4], eax
mov edx, dword [ebp - 0x1c4]
mov dword [esp], edx
call sub.WSOCK32.DLL_connect
sub esp, 0xc
cmp eax, 0xffffffff
mov ebx, eax
je 0x4387c3
cmp ebx, 1
je 0x4386e0
mov eax, dword [ebp - 0x1c4]
lea edx, [ebp - 0x1b8]
call fcn.00438280
test ebx, ebx
sete dl
test al, al
setne al
movzx eax, al
test edx, eax
je 0x43885c
mov eax, dword [ebp + 0xc]
mov byte [eax], 1
mov eax, str.connected_n
mov dword [esp + 4], eax
mov edx, dword [ebp - 0x1c0]
mov dword [esp], edx
call fcn.0042bba0
mov eax, dword [ebp - 0x1c4]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [ebp - 0x1bc]
mov ebx, dword [eax]
movzx eax, byte [ebx + 0x1ae]
mov dword [ebp - 0x1ac], eax
mov eax, 4
mov dword [esp + 0x10], eax
lea eax, [ebp - 0x1ac]
mov dword [esp + 0xc], eax
mov eax, 1
mov dword [esp + 8], eax
mov eax, 6
mov dword [esp + 4], eax
mov edx, dword [ebp - 0x1c4]
mov dword [esp], edx
call sub.WS2_32.DLL_setsockopt
sub esp, 0x14
test eax, eax
js 0x4386fe
mov dword [esp], ebx
mov edi, str.TCP_NODELAY_set_n
mov dword [esp + 4], edi
call fcn.0042bba0
jmp 0x438425
mov dword [esp], edi
mov eax, str.We_bind_local_end_to__s_n
lea ebx, [ebp - 0x198]
mov dword [esp + 8], ebx
mov dword [esp + 4], eax
call fcn.0042bba0
mov dword [esp], ebx
call sub.WS2_32.DLL_inet_addr
sub esp, 4
inc eax
je 0x438749
mov eax, dword [ebp - 0x1b0]
test eax, eax
je 0x438749
mov ebx, dword [eax]
mov dword [esp + 4], eax
mov dword [esp], edi
call fcn.004287c0
mov eax, dword [ebx + 0x10]
mov dword [esp + 8], eax
mov eax, dword [ebx + 0x14]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x1c4]
mov dword [esp], eax
call sub.WSOCK32.DLL_bind
sub esp, 0xc
test eax, eax
js 0x4388ac
mov eax, 0x10
mov dword [ebp - 0x1b4], eax
lea eax, [ebp - 0x1b4]
mov dword [esp + 8], eax
lea eax, [ebp - 0x1a8]
mov dword [esp + 4], eax
mov edx, dword [ebp - 0x1c4]
mov dword [esp], edx
call sub.WS2_32.DLL_getsockname
sub esp, 0xc
test eax, eax
jns 0x438510
mov dword [esp], edi
mov esi, str.getsockname___failed
mov dword [esp + 4], esi
call fcn.0042b7c0
jmp 0x438447
mov edx, dword [ebp - 0x1c0]
mov eax, dword [ebp - 0x1c4]
cmp dword [edx + 0x2c8], 2
jne 0x43855a
jmp 0x43845d
call fcn.004381f0
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x1bc]
mov dword [esp], eax
call fcn.0043f130
mov dword [esp + 8], eax
mov eax, str.Could_not_set_TCP_NODELAY:__s_n
mov dword [esp + 4], eax
mov dword [esp], ebx
call fcn.0042bba0
jmp 0x438425
mov eax, dword [edi + 0x74]
mov dword [esp + 4], eax
lea eax, [ebp - 0x198]
mov dword [esp], eax
call sub.msvcrt.dll_strcpy
jmp 0x4384e6
mov dword [esp + 8], ebx
mov ecx, str.couldt_find_my_own_IP_address___s_
mov dword [esp + 4], ecx
jmp 0x438503
mov ecx, 0x100
lea eax, [ebp - 0x198]
mov dword [esp + 8], ecx
mov dword [esp + 4], eax
mov eax, dword [edi + 0x74]
mov dword [esp], eax
call fcn.0043f6b0
test eax, eax
je 0x4384ac
xor edx, edx
lea ebx, [ebp - 0x1b0]
mov dword [esp + 8], edx
lea edx, [ebp - 0x198]
mov dword [esp + 0xc], ebx
mov dword [esp + 4], edx
mov eax, dword [ebp - 0x1bc]
mov dword [esp], eax
call fcn.00428570
dec eax
je 0x4388f4
mov eax, dword [ebp - 0x1b0]
test eax, eax
jne 0x4384e6
jmp 0x4384ac
call fcn.004381f0
mov dword [ebp - 0x1b8], eax
cmp eax, 0xb
mov edx, eax
je 0x4387e2
jl 0x43880e
lea eax, [eax - 0x2733]
cmp eax, 1
ja 0x43880e
mov edx, dword [ebp + 8]
mov eax, dword [ebp - 0x1c4]
call fcn.00438230
mov ebx, eax
jmp 0x438551
mov dword [esp + 4], ebx
mov edx, dword [ebp - 0x1bc]
mov dword [esp], edx
call fcn.00438f60
jmp 0x4384d8
mov dword [esp + 4], edx
mov eax, dword [ebp - 0x1bc]
mov dword [esp], eax
call fcn.0043f130
mov dword [esp + 0xc], eax
lea edx, [ebp - 0x98]
mov eax, str.Failed_to_connect_to__s:__s
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x1c0]
mov dword [esp], eax
call fcn.0042b7c0
mov eax, dword [ebp - 0x1b8]
mov edx, dword [ebp - 0x1c0]
mov dword [edx + 0x8308], eax
jmp 0x43855a
dec ebx
je 0x4388db
mov eax, dword [ebp - 0x1b8]
mov edx, dword [ebp - 0x1c0]
mov dword [edx + 0x8308], eax
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x1bc]
mov dword [esp], eax
call fcn.0043f130
mov dword [esp + 8], eax
mov eax, 0x50aec0
mov dword [esp + 4], eax
mov edx, dword [ebp - 0x1c0]
mov dword [esp], edx
call fcn.0042bba0
mov eax, dword [ebp - 0x1c4]
mov dword [esp], eax
jmp 0x438450
call fcn.004381f0
mov dword [edi + 0x8308], eax
mov ebx, str.bind_failure:__s
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x1bc]
mov dword [esp], eax
call fcn.0043f130
mov dword [esp + 8], eax
mov dword [esp + 4], ebx
jmp 0x438503
mov eax, str.Timeout_n
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x1c0]
mov dword [esp], eax
call fcn.0042bba0
jmp 0x43889e
mov dword [esp + 4], ebx
mov edx, dword [ebp - 0x1bc]
mov dword [esp], edx
call fcn.00438f60
jmp 0x4387b0