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

Disassembly:
push ebp
mov ebp, esp
push esi
push ebx
sub esp, 0x140
mov eax, dword [ebp + 8]
mov dword [ebp - 0xfc], eax
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x100], eax
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x104], eax
mov eax, dword [ebp + 0x14]
mov dword [ebp - 0x108], eax
mov eax, dword [ebp + 0x18]
mov dword [ebp - 0x10c], eax
mov eax, dword [ebp + 0x1c]
mov dword [ebp - 0x110], eax
mov eax, dword [sym.imp.libssp_0.dll___stack_chk_guard]
mov dword [ebp - 0xc], eax
xor eax, eax
mov dword [ebp - 0xec], 0
mov dword [ebp - 0xe4], 0xffffffff
call fcn.0058de8a
mov dword [ebp - 0xd4], eax
mov word [ebp - 0xf0], 0
mov word [ebp - 0xee], 0
mov dword [ebp - 0xe0], 0
mov dword [ebp - 0xdc], 0
cmp dword [ebp - 0x110], 0
je 0x40a1cd
mov eax, dword [ebp - 0x110]
mov dword [eax], 0
mov eax, dword [ebp - 0xfc]
movzx eax, word [eax]
cmp ax, 2
je 0x40a1ef
mov eax, dword [ebp - 0xfc]
movzx eax, word [eax]
cmp ax, 0x17
jne 0x40a724
cmp dword [ebp - 0x104], 0xf
setne al
movzx eax, al
mov dword [ebp - 0xd0], eax
cmp dword [ebp - 0xd0], 0
je 0x40a215
mov dword [ebp - 0xe0], 1
lea eax, [ebp - 0xf0]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0xfc]
mov dword [esp + 4], eax
lea eax, [ebp - 0xb8]
mov dword [esp], eax
call fcn.006b1b15
movzx eax, word [ebp - 0xf0]
movzx eax, ax
mov dword [esp + 4], eax
lea eax, [ebp - 0xb8]
mov dword [esp], eax
call fcn.006b4279
mov ebx, eax
mov eax, dword [ebp - 0x104]
mov dword [esp], eax
call fcn.004079b2
mov dword [esp + 0x18], ebx
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], str.Opening__s_on__s
mov dword [esp + 0xc], 0x70450c
mov dword [esp + 4], 4
mov dword [esp + 8], 0
mov dword [esp], 5
call fcn.006bf072
cmp dword [ebp - 0xd0], 0
je 0x40a2a7
mov esi, 6
jmp 0x40a2ac
mov esi, 0x11
cmp dword [ebp - 0xd0], 0
je 0x40a2bc
mov ebx, 1
jmp 0x40a2c1
mov ebx, 2
lea eax, [ebp - 0xb8]
mov dword [esp], eax
call fcn.004076be
movzx eax, ax
mov dword [esp + 8], esi
mov dword [esp + 4], ebx
mov dword [esp], eax
call fcn.006b865c
mov dword [ebp - 0xe4], eax
cmp dword [ebp - 0xe4], 0xffffffff
jne 0x40a378
mov eax, dword [ebp - 0xe4]
mov dword [esp], eax
call fcn.006b8d37
mov dword [ebp - 0xc0], eax
cmp dword [ebp - 0xc0], 0x2728
je 0x40a321
cmp dword [ebp - 0xc0], 0x2747
jne 0x40a335
call fcn.00409f1c
mov dword [ebp - 0xdc], 1
jmp 0x40aaf7
mov eax, dword [ebp - 0xc0]
mov dword [esp], eax
call fcn.006b8dc5
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], str.Socket_creation_failed:__s
mov dword [esp + 0xc], 0x70450c
mov dword [esp + 4], 4
mov dword [esp + 8], 0
mov dword [esp], 4
call fcn.006bf072
jmp 0x40aaf7
mov eax, dword [ebp - 0xe4]
mov dword [esp], eax
call fcn.00409fd7
test eax, eax
jns 0x40a3df
mov eax, dword [sym.imp.msvcrt.dll__errno]
call eax
mov eax, dword [eax]
mov dword [esp], eax
call fcn.006b8dc5
mov ebx, eax
mov eax, dword [ebp - 0x104]
mov dword [esp], eax
call fcn.004079b2
mov dword [esp + 0x18], ebx
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], str.Error_setting_SO_REUSEADDR_flag_on__s:__s
mov dword [esp + 0xc], 0x70450c
mov dword [esp + 4], 4
mov dword [esp + 8], 0
mov dword [esp], 4
call fcn.006bf072
mov eax, dword [ebp - 0xe4]
mov dword [esp], eax
call fcn.0040a004
test eax, eax
jns 0x40a446
mov eax, dword [sym.imp.msvcrt.dll__errno]
call eax
mov eax, dword [eax]
mov dword [esp], eax
call fcn.006b8dc5
mov ebx, eax
mov eax, dword [ebp - 0x104]
mov dword [esp], eax
call fcn.004079b2
mov dword [esp + 0x18], ebx
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], str.Error_setting_SO_EXCLUSIVEADDRUSE_flag_on__s:__s
mov dword [esp + 0xc], 0x70450c
mov dword [esp + 4], 4
mov dword [esp + 8], 0
mov dword [esp], 4
call fcn.006bf072
mov eax, dword [ebp - 0xfc]
movzx eax, word [eax]
cmp ax, 0x17
jne 0x40a4ee
mov dword [ebp - 0xe8], 1
mov eax, dword [ebp - 0xe4]
mov dword [esp + 0x10], 4
lea edx, [ebp - 0xe8]
mov dword [esp + 0xc], edx
mov dword [esp + 8], 0x1b
mov dword [esp + 4], 0x29
mov dword [esp], eax
mov eax, dword [sym.imp.WS2_32.dll_setsockopt]
call eax
sub esp, 0x14
test eax, eax
jns 0x40a4ee
mov eax, dword [ebp - 0xe4]
mov dword [esp], eax
call fcn.006b8d37
mov dword [ebp - 0xcc], eax
mov eax, dword [ebp - 0xcc]
mov dword [esp], eax
call fcn.006b8dc5
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], str.Error_setting_IPV6_V6ONLY_flag:__s
mov dword [esp + 0xc], 0x70450c
mov dword [esp + 4], 4
mov dword [esp + 8], 0
mov dword [esp], 4
call fcn.006bf072
mov eax, dword [ebp - 0xe4]
mov edx, dword [ebp - 0x100]
mov dword [esp + 8], edx
mov edx, dword [ebp - 0xfc]
mov dword [esp + 4], edx
mov dword [esp], eax
mov eax, dword [sym.imp.WS2_32.dll_bind]
call eax
sub esp, 0xc
test eax, eax
jns 0x40a5cb
mov dword [ebp - 0xd8], 0x70257b
mov eax, dword [ebp - 0xe4]
mov dword [esp], eax
call fcn.006b8d37
mov dword [ebp - 0xc4], eax
cmp dword [ebp - 0xc4], 0x2740
jne 0x40a566
mov dword [ebp - 0xd8], str.._Is_Tor_already_running_
cmp dword [ebp - 0x110], 0
je 0x40a566
mov eax, dword [ebp - 0x110]
mov dword [eax], 1
mov eax, dword [ebp - 0xc4]
mov dword [esp], eax
call fcn.006b8dc5
movzx edx, word [ebp - 0xf0]
movzx edx, dx
mov ecx, dword [ebp - 0xd8]
mov dword [esp + 0x20], ecx
mov dword [esp + 0x1c], eax
mov dword [esp + 0x18], edx
mov eax, dword [ebp - 0x108]
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], str.Could_not_bind_to__s:_u:__s_s
mov dword [esp + 0xc], 0x70450c
mov dword [esp + 4], 4
mov dword [esp + 8], 0
mov dword [esp], 4
call fcn.006bf072
jmp 0x40aaf7
cmp dword [ebp - 0xd0], 0
je 0x40a649
mov eax, dword [ebp - 0xe4]
mov dword [esp], eax
call fcn.0040a072
test eax, eax
jns 0x40a649
mov eax, dword [ebp - 0xe4]
mov dword [esp], eax
call fcn.006b8d37
mov dword [esp], eax
call fcn.006b8dc5
movzx edx, word [ebp - 0xf0]
movzx edx, dx
mov dword [esp + 0x1c], eax
mov dword [esp + 0x18], edx
mov eax, dword [ebp - 0x108]
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], str.Could_not_listen_on__s:_u:__s
mov dword [esp + 0xc], 0x70450c
mov dword [esp + 4], 4
mov dword [esp + 8], 0
mov dword [esp], 4
call fcn.006bf072
jmp 0x40aaf7
movzx eax, word [ebp - 0xf0]
test ax, ax
je 0x40a668
movzx eax, word [ebp - 0xf0]
mov word [ebp - 0xee], ax
jmp 0x40a799
mov dword [ebp - 0xe8], pe_nt_image_headers32
mov eax, dword [ebp - 0xe4]
lea edx, [ebp - 0xe8]
mov dword [esp + 8], edx
lea edx, [ebp - 0x90]
mov dword [esp + 4], edx
mov dword [esp], eax
mov eax, dword [sym.imp.WS2_32.dll_getsockname]
call eax
sub esp, 0xc
test eax, eax
jns 0x40a700
mov eax, dword [ebp - 0xe4]
mov dword [esp], eax
call fcn.006b8d37
mov dword [esp], eax
call fcn.006b8dc5
mov ebx, eax
mov eax, dword [ebp - 0x104]
mov dword [esp], eax
call fcn.004079b2
mov dword [esp + 0x18], ebx
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], str.getsockname___couldnt_learn_address_for__s:__s
mov dword [esp + 0xc], 0x70450c
mov dword [esp + 4], 4
mov dword [esp + 8], 0
mov dword [esp], 4
call fcn.006bf072
mov word [ebp - 0xee], 0
lea eax, [ebp - 0xee]
mov dword [esp + 8], eax
lea eax, [ebp - 0x90]
mov dword [esp + 4], eax
lea eax, [ebp - 0xa4]
mov dword [esp], eax
call fcn.006b1b15
jmp 0x40a799
mov eax, dword [ebp - 0xfc]
movzx eax, word [eax]
movzx eax, ax
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], str.Got_unexpected_address_family__d.
mov dword [esp + 0xc], 0x70450c
mov dword [esp + 4], 0x1000
mov dword [esp + 8], 0
mov dword [esp], 3
call fcn.006bf072
mov dword [esp], str.src_core_mainloop_connection.c
call fcn.006c14d2
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0x702626
mov dword [esp + 8], str.connection_listener_new
mov dword [esp + 4], 0x5d2
mov dword [esp], eax
call fcn.006c1140
call fcn.006c14b8
mov eax, dword [ebp - 0xfc]
movzx eax, word [eax]
movzx eax, ax
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x104]
mov dword [esp], eax
call fcn.004080fa
mov dword [ebp - 0xc8], eax
mov eax, dword [ebp - 0xc8]
mov dword [ebp - 0xec], eax
mov eax, dword [ebp - 0xfc]
movzx edx, word [eax]
mov eax, dword [ebp - 0xec]
movzx edx, dx
mov dword [eax + 0x34], edx
mov eax, dword [ebp - 0xec]
mov edx, dword [ebp - 0xe4]
mov dword [eax + 0xc], edx
mov dword [ebp - 0xe4], 0xffffffff
mov ebx, dword [ebp - 0xec]
mov eax, dword [ebp - 0x108]
mov dword [esp], eax
call fcn.006c53c8
mov dword [ebx + 0x54], eax
mov eax, dword [ebp - 0xec]
movzx edx, word [ebp - 0xee]
mov word [eax + 0x4c], dx
mov eax, dword [ebp - 0xec]
lea edx, [eax + 0x38]
lea eax, [ebp - 0xb8]
mov dword [esp + 4], eax
mov dword [esp], edx
call fcn.006b3861
mov eax, dword [ebp - 0x10c]
lea edx, [eax + 0x20]
mov eax, dword [ebp - 0xc8]
add eax, 0x74
mov dword [esp + 8], 0xc
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.msvcrt.dll_memcpy
mov eax, dword [ebp - 0x10c]
movzx eax, byte [eax + 0x20]
test al, al
je 0x40a8b9
mov eax, dword [ebp - 0x10c]
movzx edx, byte [eax + 0x20]
mov eax, dword [ebp - 0xc8]
mov byte [eax + 0x74], dl
mov eax, dword [ebp - 0x10c]
mov eax, dword [eax + 0x24]
test eax, eax
js 0x40a8a2
mov eax, dword [ebp - 0x10c]
mov edx, dword [eax + 0x24]
mov eax, dword [ebp - 0xc8]
mov dword [eax + 0x78], edx
jmp 0x40a8b9
mov eax, dword [0x6f40dc]
lea edx, [eax - 1]
mov dword [0x6f40dc], edx
mov edx, dword [ebp - 0xc8]
mov dword [edx + 0x78], eax
cmp dword [ebp - 0x104], 6
je 0x40a8f2
mov eax, dword [ebp - 0xc8]
movzx edx, byte [eax + 0x7c]
or edx, 4
mov byte [eax + 0x7c], dl
mov eax, dword [ebp - 0xc8]
movzx edx, byte [eax + 0x7c]
or edx, 8
mov byte [eax + 0x7c], dl
mov eax, dword [ebp - 0xc8]
movzx edx, byte [eax + 0x7c]
and edx, 0xffffffef
mov byte [eax + 0x7c], dl
mov eax, dword [ebp - 0xec]
mov dword [esp + 4], 0
mov dword [esp], eax
call fcn.0041758b
test eax, eax
jns 0x40a93d
mov dword [esp + 0x10], str.connection_add_for_listener_failed._Giving_up.
mov dword [esp + 0xc], 0x70450c
mov dword [esp + 4], 4
mov dword [esp + 8], 0
mov dword [esp], 4
call fcn.006bf072
jmp 0x40aaf7
movzx eax, word [ebp - 0xee]
movzx ebx, ax
mov eax, dword [ebp - 0x104]
mov dword [esp], eax
call fcn.004079b2
movzx ecx, word [ebp - 0xf0]
movzx edx, word [ebp - 0xee]
cmp cx, dx
jne 0x40a96f
mov edx, 7
jmp 0x40a974
mov edx, 5
mov dword [esp + 0x18], ebx
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], str._s_listening_on_port__u.
mov dword [esp + 0xc], 0x70450c
mov dword [esp + 4], 4
mov dword [esp + 8], 0
mov dword [esp], edx
call fcn.006bf072
mov eax, dword [ebp - 0xec]
mov byte [eax + 4], 0
cmp dword [ebp - 0xe0], 0
je 0x40a9c7
mov eax, dword [ebp - 0xec]
mov dword [esp], eax
call fcn.0041859d
jmp 0x40aa1f
cmp dword [ebp - 0x104], 0xf
sete al
movzx eax, al
test eax, eax
jne 0x40aa11
mov dword [esp], str.src_core_mainloop_connection.c
call fcn.006c14d2
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], str.type__15
mov dword [esp + 8], str.connection_listener_new
mov dword [esp + 4], 0x602
mov dword [esp], eax
call fcn.006c1140
call fcn.006c14b8
mov eax, dword [ebp - 0xec]
mov dword [esp], eax
call fcn.0049443f
call fcn.006b898d
mov dword [esp + 4], 0
mov dword [esp], eax
call fcn.00413dc5
mov eax, dword [ebp - 0xec]
mov eax, dword [eax + 0x34]
cmp eax, 1
jne 0x40aa8f
mov eax, dword [ebp - 0xec]
mov ebx, dword [eax + 0x54]
mov eax, dword [ebp - 0x104]
mov dword [esp], eax
call fcn.004079b2
mov dword [esp + 0x18], ebx
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], str.Opened__s_on__s
mov dword [esp + 0xc], 0x70450c
mov dword [esp + 4], 4
mov dword [esp + 8], 0
mov dword [esp], 5
call fcn.006bf072
jmp 0x40aaef
movzx eax, word [ebp - 0xee]
movzx eax, ax
mov dword [esp + 4], eax
lea eax, [ebp - 0xb8]
mov dword [esp], eax
call fcn.006b4279
mov ebx, eax
mov eax, dword [ebp - 0x104]
mov dword [esp], eax
call fcn.004079b2
mov dword [esp + 0x18], ebx
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], str.Opened__s_on__s
mov dword [esp + 0xc], 0x70450c
mov dword [esp + 4], 4
mov dword [esp + 8], 0
mov dword [esp], 5
call fcn.006bf072
mov eax, dword [ebp - 0xec]
jmp 0x40ab5c
cmp dword [ebp - 0xe4], 0xffffffff
je 0x40ab0e
mov eax, dword [ebp - 0xe4]
mov dword [esp], eax
call fcn.006b84eb
mov eax, dword [ebp - 0xec]
test eax, eax
je 0x40ab40
lea eax, [ebp - 0xec]
mov dword [ebp - 0xbc], eax
mov eax, dword [ebp - 0xbc]
mov eax, dword [eax]
mov dword [esp], eax
call fcn.00409381
mov eax, dword [ebp - 0xbc]
mov dword [eax], 0
call fcn.006b898d
mov edx, dword [ebp - 0xdc]
mov dword [esp + 4], edx
mov dword [esp], eax
call fcn.00413dc5
mov eax, 0
mov esi, dword [ebp - 0xc]
xor esi, dword [sym.imp.libssp_0.dll___stack_chk_guard]
je 0x40ab6c
call sub.libssp_0.dll___stack_chk_fail
lea esp, [ebp - 8]
pop ebx
pop esi
pop ebp
ret