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

Disassembly:
push ebp
mov ebp, esp
push edi
mov edi, eax
push esi
push ebx
sub esp, 0x2fc
mov dword [ebp - 0x2bc], eax
mov eax, dword [eax]
mov dword [ecx], 0xffffffff
mov dword [ebp - 0x2c4], ecx
mov dword [ebp - 0x2c0], eax
mov eax, dword [ebp + 8]
mov dword [eax], 0
lea eax, [ebp - 0x2b4]
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x1a8]
mov dword [esp + 8], eax
mov dword [esp + 4], edx
mov dword [esp], edi
call fcn.00414f20
test eax, eax
je 0x415081
xor ebx, ebx
lea esp, [ebp - 0xc]
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [ebp - 0x2bc]
lea ebx, [eax + 0x9e]
lea ecx, [eax + 0xcc]
mov edx, ebx
lea eax, [ebp - 0x198]
call fcn.00414890
test eax, eax
je 0x415420
mov edi, dword [ebp - 0x2bc]
mov eax, edi
add eax, 0x40
mov esi, eax
mov dword [ebp - 0x2dc], eax
mov eax, dword [edi + 0x9e]
mov dword [edi + 0x40], eax
mov eax, dword [ebx + 4]
mov dword [esi + 4], eax
mov eax, dword [ebx + 8]
mov dword [esi + 8], eax
mov eax, dword [ebx + 0xc]
mov dword [esi + 0xc], eax
mov eax, dword [ebx + 0x10]
mov dword [esi + 0x10], eax
mov eax, dword [ebx + 0x14]
mov dword [esi + 0x14], eax
mov eax, dword [ebx + 0x18]
mov dword [esi + 0x18], eax
mov eax, dword [ebx + 0x1c]
mov dword [esi + 0x1c], eax
mov eax, dword [ebx + 0x20]
mov dword [esi + 0x20], eax
mov eax, dword [ebx + 0x24]
mov dword [esi + 0x24], eax
mov eax, dword [ebx + 0x28]
mov dword [esi + 0x28], eax
movzx eax, word [ebx + 0x2c]
mov ebx, dword [ebp - 0x2c0]
mov word [esi + 0x2c], ax
mov dword [esp + 8], esi
mov dword [esp + 4], str.__Trying__s..._n
mov dword [esp], ebx
call fcn.00416500
mov dword [esp], edi
call fcn.00414a10
mov eax, dword [ebx + 0x37c]
test eax, eax
jne 0x4153a7
mov eax, dword [ebp - 0x2b4]
mov dword [esp], eax
call fcn.00414cd0
mov eax, dword [ebp - 0x2c0]
mov eax, dword [eax + 0x47c]
test eax, eax
jne 0x415290
mov edi, dword [ebp - 0x2c0]
mov eax, dword [edi + 0x1e0]
test eax, eax
je 0x415198
mov edx, dword [ebp - 0x2b4]
mov dword [esp + 8], 0
mov dword [esp + 4], edx
mov edx, dword [edi + 0x1e4]
mov dword [esp], edx
call eax
cmp eax, 2
je 0x415410
test eax, eax
jne 0x415577
mov dword [ebp - 0x2d8], 0
mov eax, dword [ebp - 0x1a8]
lea edi, [ebp - 0x114]
mov dword [ebp - 0x2b0], 0
mov dword [ebp - 0x2d4], eax
mov eax, dword [ebp - 0x2b4]
mov esi, eax
mov dword [ebp - 0x2c8], eax
mov eax, dword [ebp - 0x2bc]
mov ecx, dword [eax]
mov eax, dword [ecx + 0x1b4]
movzx edx, word [ecx + 0x1b0]
mov ebx, dword [ecx + 0x3bc]
mov dword [ebp - 0x2cc], ecx
mov ecx, 0x3f
mov dword [ebp - 0x2e0], eax
xor eax, eax
test dx, dx
mov dword [ebp - 0x118], 0
rep stosd dword es:[edi], eax
jne 0x415476
test ebx, ebx
mov eax, esi
jne 0x415476
mov dword [esp + 4], 1
mov dword [esp], eax
call fcn.00413d80
call fcn.00420e30
mov edi, dword [ebp - 0x2bc]
cmp dword [edi + 0x214], 1
mov dword [edi + 0x20c], eax
mov dword [edi + 0x210], edx
jle 0x415261
mov eax, dword [edi + 0x218]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x2c0]
mov dword [esp], eax
call fcn.0041f230
mov ecx, dword [ebp - 0x2d8]
test ecx, ecx
jne 0x41527b
mov eax, dword [ebp - 0x2bc]
cmp dword [eax + 0x74], 1
je 0x4156bb
mov eax, dword [ebp - 0x2b4]
mov edx, dword [ebp - 0x2c4]
mov dword [edx], eax
jmp 0x415075
mov ebx, dword [ebp - 0x2b4]
lea eax, [ebp - 0x2a8]
mov dword [ebp - 0x2a8], 1
mov dword [esp + 0x10], 4
mov dword [esp + 0xc], eax
mov dword [esp + 8], 8
mov dword [esp + 4], 0xffff
mov dword [esp], ebx
call dword [sym.imp.WS2_32.dll_setsockopt]
sub esp, 0x14
test eax, eax
js 0x41589d
mov edi, dword [ebp - 0x2c0]
mov dword [ebp - 0x118], 1
mov eax, dword [edi + 0x480]
mov dword [esp], eax
call fcn.00413e20
imul eax, eax, 0x3e8
mov dword [ebp - 0x2a8], eax
mov dword [ebp - 0x114], eax
mov eax, dword [edi + 0x484]
mov dword [esp], eax
call fcn.00413e20
mov dword [esp + 0x20], 0
mov dword [esp + 0x1c], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0xc
imul eax, eax, 0x3e8
mov dword [esp + 4], 0x98000004
mov dword [esp], ebx
mov dword [ebp - 0x2a8], eax
mov dword [ebp - 0x110], eax
lea eax, [ebp - 0x228]
mov dword [esp + 0x18], eax
lea eax, [ebp - 0x118]
mov dword [esp + 8], eax
call dword [sym.imp.WS2_32.dll_WSAIoctl]
sub esp, 0x24
test eax, eax
je 0x41515a
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [esp + 8], ebx
mov dword [esp + 4], str.Failed_to_set_SIO_KEEPALIVE_VALS_on_fd__d:__d_n
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x2c0]
mov dword [esp], eax
call fcn.00416500
jmp 0x41515a
mov eax, dword [ebp - 0x2bc]
mov ebx, dword [eax]
mov eax, dword [ebx + 0x37c]
mov dword [esp + 0x10], 4
mov dword [esp + 8], 1
mov dword [esp + 4], 6
mov dword [ebp - 0x118], eax
lea eax, [ebp - 0x118]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x2b4]
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_setsockopt]
sub esp, 0x14
test eax, eax
js 0x4158bc
mov dword [esp + 4], str.TCP_NODELAY_set_n
mov dword [esp], ebx
call fcn.00416500
jmp 0x415138
mov dword [ebp - 0x2d8], 1
jmp 0x4151a2
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, dword [ebp - 0x2bc]
mov dword [esp], edi
mov dword [esp + 4], eax
mov ebx, eax
call fcn.00413750
mov dword [esp + 8], ebx
mov dword [esp + 4], str.sa_addr_inet_ntop___failed_with_errno__d:__s
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x2c0]
mov dword [esp], eax
call fcn.00416580
mov eax, dword [ebp - 0x2b4]
xor ebx, ebx
mov dword [esp], edi
mov dword [esp + 4], eax
call fcn.00414ea0
lea esp, [ebp - 0xc]
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
xor eax, eax
mov ecx, 0x20
lea edi, [ebp - 0x2a8]
test ebx, ebx
rep stosd dword es:[edi], eax
je 0x4155a0
mov dword [esp], ebx
mov dword [ebp - 0x2d0], edx
call sub.msvcrt.dll_strlen
mov edx, dword [ebp - 0x2d0]
cmp eax, 0xfe
ja 0x4155a0
mov esi, 0x466f2f
mov ecx, 3
mov edi, ebx
repe cmpsb byte [esi], byte es:[edi]
jne 0x415797
add ebx, 3
mov esi, 1
mov eax, dword [ebp - 0x2bc]
lea edi, [ebp - 0x118]
mov dword [esp + 0x10], 0x100
mov dword [esp + 0xc], edi
mov dword [esp + 8], ebx
mov eax, dword [eax + 0x70]
mov dword [ebp - 0x2d0], edx
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x2d4]
mov dword [esp], eax
call fcn.004236e0
cmp eax, 1
je 0x4159f6
mov edx, dword [ebp - 0x2d0]
jb 0x415adc
cmp eax, 2
jne 0x415772
mov eax, dword [ebp - 0x2d4]
mov dword [esp + 0xc], edi
mov dword [esp + 8], ebx
mov dword [esp + 4], str.Local_Interface__s_is_ip__s_using_address_family__i_n
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0x2cc]
mov dword [ebp - 0x2d0], edx
mov dword [esp], eax
call fcn.00416500
mov edx, dword [ebp - 0x2d0]
cmp dword [ebp - 0x2d4], 0x17
je 0x415a00
cmp dword [ebp - 0x2d4], 2
je 0x41594e
mov dword [ebp - 0x2d0], 0
jmp 0x4155c4
mov eax, dword [ebp - 0x2b4]
mov ebx, 0x2a
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x2bc]
mov dword [esp], eax
call fcn.00414ea0
jmp 0x415077
cmp dword [ebp - 0x2d4], 0x17
je 0x4159b9
cmp dword [ebp - 0x2d4], 2
mov dword [ebp - 0x2d0], 0
je 0x41597c
mov ebx, dword [ebp - 0x2e0]
lea edi, [edx + ebx]
jmp 0x415612
sub ebx, 1
test ebx, ebx
jle 0x415707
mov eax, dword [ebp - 0x2cc]
movzx esi, si
mov dword [esp + 8], esi
mov dword [esp + 4], str.Bind_to_local_port__hu_failed__trying_next_n
mov dword [esp], eax
call fcn.00416500
mov eax, edi
sub eax, ebx
movzx eax, ax
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_ntohs]
sub esp, 4
mov word [ebp - 0x2a6], ax
mov eax, dword [ebp - 0x2d0]
mov esi, edi
sub esi, ebx
mov dword [esp + 8], eax
lea eax, [ebp - 0x2a8]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x2c8]
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_bind]
sub esp, 0xc
test eax, eax
js 0x4155d0
lea edx, [ebp - 0x228]
xor eax, eax
mov edi, edx
mov ecx, 0x20
rep stosd dword es:[edi], eax
lea eax, [ebp - 0x2ac]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x2c8]
mov dword [ebp - 0x2ac], 0x80
mov dword [esp + 4], edx
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_getsockname]
sub esp, 0xc
test eax, eax
js 0x4158ed
mov eax, dword [ebp - 0x2cc]
movzx esi, si
mov dword [esp + 8], esi
mov dword [esp + 4], str.Local_port:__hu_n
mov dword [esp], eax
call fcn.00416500
mov eax, dword [ebp - 0x2bc]
mov dword [eax + 0x204], 1
mov eax, dword [ebp - 0x2b4]
jmp 0x415219
mov eax, dword [ebp - 0x19c]
mov dword [esp + 8], eax
lea eax, [ebp - 0x198]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x2b4]
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_connect]
sub esp, 0xc
cmp eax, 0xffffffff
je 0x415b25
xor eax, eax
mov edx, dword [ebp - 0x2bc]
cmp dword [ebp - 0x1a8], 0x17
sete al
mov dword [edx + 0x1c4], eax
jmp 0x41527b
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edi, dword [ebp - 0x2cc]
mov ebx, eax
mov eax, dword [ebp - 0x2bc]
mov dword [edi + 0x8604], ebx
mov dword [esp + 4], ebx
mov dword [esp], eax
call fcn.00413750
mov dword [esp + 8], ebx
mov ebx, 0x2d
mov dword [esp + 4], str.bind_failed_with_errno__d:__s
mov dword [esp], edi
mov dword [esp + 0xc], eax
call fcn.00416580
mov eax, dword [ebp - 0x2b4]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x2bc]
mov dword [esp], eax
call fcn.00414ea0
cmp ebx, 1
mov eax, 0
cmove ebx, eax
jmp 0x415077
test esi, esi
je 0x4157ae
mov eax, dword [ebp - 0x2cc]
mov dword [esp + 8], ebx
mov ebx, 0x2d
mov dword [esp + 4], str.Couldnt_bind_to__s
mov dword [esp], eax
call fcn.00416580
jmp 0x41574a
mov esi, str.host_
mov ecx, 5
mov edi, ebx
repe cmpsb byte [esi], byte es:[edi]
jne 0x415947
add ebx, 5
mov eax, dword [ebp - 0x2bc]
cmp dword [ebp - 0x2d4], 2
mov edi, dword [eax + 0x224]
je 0x415aa9
cmp dword [ebp - 0x2d4], 0x17
je 0x415ac7
mov eax, dword [ebp - 0x2bc]
lea esi, [ebp - 0x2b0]
mov dword [esp + 0xc], esi
mov dword [esp + 8], 0
mov dword [esp + 4], ebx
mov dword [esp], eax
mov dword [ebp - 0x2d0], edx
call fcn.004176f0
mov edx, dword [ebp - 0x2d0]
cmp eax, 1
je 0x415b08
mov eax, dword [ebp - 0x2bc]
mov dword [ebp - 0x2d0], edx
mov dword [eax + 0x224], edi
mov eax, dword [ebp - 0x2b0]
test eax, eax
je 0x415776
lea edi, [ebp - 0x118]
mov dword [esp + 8], 0x100
mov dword [esp + 4], edi
mov eax, dword [eax]
mov dword [esp], eax
call fcn.00417510
mov eax, dword [ebp - 0x2b0]
mov eax, dword [eax]
mov eax, dword [eax + 4]
mov dword [esp + 8], ebx
mov ebx, dword [ebp - 0x2cc]
mov dword [esp + 0x10], edi
mov dword [esp + 4], str.Name__s_family__i_resolved_to__s_family__i_n
mov dword [esp + 0x14], eax
mov eax, dword [ebp - 0x2d4]
mov dword [esp], ebx
mov dword [esp + 0xc], eax
call fcn.00416500
mov eax, dword [ebp - 0x2b0]
mov dword [esp], ebx
mov dword [esp + 4], eax
call fcn.00417940
mov edx, dword [ebp - 0x2d0]
jmp 0x415551
mov eax, dword [ebp - 0x2c0]
mov dword [esp + 8], ebx
mov dword [esp + 4], str.Failed_to_set_SO_KEEPALIVE_on_fd__d_n
mov dword [esp], eax
call fcn.00416500
jmp 0x41515a
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x2bc]
mov dword [esp], eax
call fcn.00413750
mov dword [esp + 4], str.Could_not_set_TCP_NODELAY:__s_n
mov dword [esp], ebx
mov dword [esp + 8], eax
call fcn.00416500
jmp 0x415138
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edi, dword [ebp - 0x2cc]
mov esi, dword [ebp - 0x2bc]
mov ebx, eax
mov dword [edi + 0x8604], ebx
mov dword [esp + 4], ebx
mov dword [esp], esi
call fcn.00413750
mov dword [esp + 8], ebx
mov ebx, 0x2d
mov dword [esp + 4], str.getsockname___failed_with_errno__d:__s
mov dword [esp], edi
mov dword [esp + 0xc], eax
call fcn.00416580
mov eax, dword [ebp - 0x2b4]
mov dword [esp], esi
mov dword [esp + 4], eax
call fcn.00414ea0
jmp 0x415077
xor esi, esi
jmp 0x4154c8
lea eax, [ebp - 0x2a4]
mov dword [esp + 8], eax
mov dword [esp + 4], edi
mov dword [esp], 2
mov dword [ebp - 0x2d0], edx
call fcn.004237d0
mov edx, dword [ebp - 0x2d0]
test eax, eax
jle 0x41556b
movzx eax, dx
mov ebx, 2
mov dword [ebp - 0x2d4], edx
mov word [ebp - 0x2a8], bx
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_htons]
mov edx, dword [ebp - 0x2d4]
mov dword [ebp - 0x2d0], 0x10
sub esp, 4
mov word [ebp - 0x2a6], ax
jmp 0x4155c4
movzx eax, dx
mov esi, 0x17
mov dword [ebp - 0x2d4], edx
mov word [ebp - 0x2a8], si
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_htons]
mov edx, dword [ebp - 0x2d4]
mov dword [ebp - 0x2d0], 0x1c
sub esp, 4
mov word [ebp - 0x2a6], ax
jmp 0x4155c4
mov ebx, 1
jmp 0x41574a
mov dword [esp + 4], 0x25
mov dword [esp], edi
mov dword [ebp - 0x2d0], edx
call sub.msvcrt.dll_strchr
mov edx, dword [ebp - 0x2d0]
test eax, eax
je 0x415ba0
lea ebx, [eax + 1]
mov byte [eax], 0
lea eax, [ebp - 0x2a0]
mov dword [esp + 8], eax
mov dword [esp + 4], edi
mov dword [esp], 0x17
mov dword [ebp - 0x2d0], edx
call fcn.004237d0
mov edx, dword [ebp - 0x2d0]
test eax, eax
jle 0x415ab8
movzx eax, dx
mov edi, 0x17
mov word [ebp - 0x2a8], di
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_htons]
mov edx, dword [ebp - 0x2d0]
sub esp, 4
test ebx, ebx
mov word [ebp - 0x2a6], ax
je 0x415ab8
mov dword [esp], ebx
mov dword [ebp - 0x2d4], edx
call sub.msvcrt.dll_atoi
mov edx, dword [ebp - 0x2d4]
mov dword [ebp - 0x2d0], 0x1c
mov dword [ebp - 0x290], eax
jmp 0x4155c4
mov dword [eax + 0x224], 1
jmp 0x4157d4
mov dword [ebp - 0x2d0], 0x1c
jmp 0x4155c4
mov eax, dword [ebp - 0x2bc]
mov dword [eax + 0x224], 2
jmp 0x4157d4
test esi, esi
je 0x4157ae
mov eax, dword [ebp - 0x2cc]
mov dword [esp + 8], ebx
mov ebx, 0x2d
mov dword [esp + 4], str.Couldnt_bind_to_interface__s
mov dword [esp], eax
call fcn.00416580
jmp 0x41574a
mov eax, dword [ebp - 0x2bc]
mov dword [esp + 4], esi
mov dword [esp], eax
call fcn.00416d60
mov edx, dword [ebp - 0x2d0]
jmp 0x41580d
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edx, dword [ebp - 0x2bc]
mov ebx, eax
xor eax, eax
cmp dword [ebp - 0x1a8], 0x17
sete al
cmp ebx, 0xb
mov dword [edx + 0x1c4], eax
je 0x41527b
jl 0x415b5f
lea eax, [ebx - 0x2733]
cmp eax, 1
jbe 0x41527b
mov edi, dword [ebp - 0x2bc]
mov dword [esp + 4], ebx
mov dword [esp], edi
call fcn.00413750
mov esi, dword [ebp - 0x2c0]
mov dword [esp + 4], str.Failed_to_connect_to__s:__s
mov dword [esp], esi
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x2dc]
mov dword [esp + 8], eax
call fcn.00416580
mov dword [esi + 0x8604], ebx
jmp 0x415458
xor ebx, ebx
jmp 0x415a2a