Function at 0x438ed0
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 0x438fad
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.00428ee0
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.0042c6f0
mov edx, dword [ebp - 0x1c0]
cmp byte [edx + 0x1ae], 0
jne 0x439100
mov edx, dword [ebp - 0x1bc]
mov edi, dword [edx]
mov eax, dword [edi + 0x74]
test eax, eax
je 0x439060
mov dword [esp], eax
call sub.msvcrt.dll_strlen
cmp eax, 0xfe
jbe 0x438fb5
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 [0x50be60]
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 0x4392ab
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.004290c0
dec eax
je 0x439347
mov eax, dword [ebp - 0x1b0]
test eax, eax
jne 0x43927f
cmp byte [ebp - 0x198], 0
jne 0x439170
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.0042c310
jmp 0x438f97
mov edx, 1
mov dword [esp + 4], edx
mov eax, dword [ebp - 0x1c4]
mov dword [esp], eax
call fcn.00438d50
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 0x439313
cmp ebx, 1
je 0x439230
mov eax, dword [ebp - 0x1c4]
lea edx, [ebp - 0x1b8]
call fcn.00438dd0
test ebx, ebx
sete dl
test al, al
setne al
movzx eax, al
test edx, eax
je 0x4393ac
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.0042c6f0
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 0x43924e
mov dword [esp], ebx
mov edi, str.TCP_NODELAY_set_n
mov dword [esp + 4], edi
call fcn.0042c6f0
jmp 0x438f75
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.0042c6f0
mov dword [esp], ebx
call sub.WS2_32.DLL_inet_addr
sub esp, 4
inc eax
je 0x439299
mov eax, dword [ebp - 0x1b0]
test eax, eax
je 0x439299
mov ebx, dword [eax]
mov dword [esp + 4], eax
mov dword [esp], edi
call fcn.00429310
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 0x4393fc
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 0x439060
mov dword [esp], edi
mov esi, str.getsockname___failed
mov dword [esp + 4], esi
call fcn.0042c310
jmp 0x438f97
mov edx, dword [ebp - 0x1c0]
mov eax, dword [ebp - 0x1c4]
cmp dword [edx + 0x2c8], 2
jne 0x4390aa
jmp 0x438fad
call fcn.00438d40
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x1bc]
mov dword [esp], eax
call fcn.0043fc80
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.0042c6f0
jmp 0x438f75
mov eax, dword [edi + 0x74]
mov dword [esp + 4], eax
lea eax, [ebp - 0x198]
mov dword [esp], eax
call sub.msvcrt.dll_strcpy
jmp 0x439036
mov dword [esp + 8], ebx
mov ecx, str.couldt_find_my_own_IP_address___s_
mov dword [esp + 4], ecx
jmp 0x439053
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.00440200
test eax, eax
je 0x438ffc
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.004290c0
dec eax
je 0x439444
mov eax, dword [ebp - 0x1b0]
test eax, eax
jne 0x439036
jmp 0x438ffc
call fcn.00438d40
mov dword [ebp - 0x1b8], eax
cmp eax, 0xb
mov edx, eax
je 0x439332
jl 0x43935e
lea eax, [eax - 0x2733]
cmp eax, 1
ja 0x43935e
mov edx, dword [ebp + 8]
mov eax, dword [ebp - 0x1c4]
call fcn.00438d80
mov ebx, eax
jmp 0x4390a1
mov dword [esp + 4], ebx
mov edx, dword [ebp - 0x1bc]
mov dword [esp], edx
call fcn.00439ab0
jmp 0x439028
mov dword [esp + 4], edx
mov eax, dword [ebp - 0x1bc]
mov dword [esp], eax
call fcn.0043fc80
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.0042c310
mov eax, dword [ebp - 0x1b8]
mov edx, dword [ebp - 0x1c0]
mov dword [edx + 0x8308], eax
jmp 0x4390aa
dec ebx
je 0x43942b
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.0043fc80
mov dword [esp + 8], eax
mov eax, 0x50c020
mov dword [esp + 4], eax
mov edx, dword [ebp - 0x1c0]
mov dword [esp], edx
call fcn.0042c6f0
mov eax, dword [ebp - 0x1c4]
mov dword [esp], eax
jmp 0x438fa0
call fcn.00438d40
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.0043fc80
mov dword [esp + 8], eax
mov dword [esp + 4], ebx
jmp 0x439053
mov eax, str.Timeout_n
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x1c0]
mov dword [esp], eax
call fcn.0042c6f0
jmp 0x4393ee
mov dword [esp + 4], ebx
mov edx, dword [ebp - 0x1bc]
mov dword [esp], edx
call fcn.00439ab0
jmp 0x439300