Function at 0x407a57
Capabilities:
Get socket status
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x9ec
mov eax, dword [ebp + 0xc]
mov ebx, dword [ebp + 8]
mov dword [ebp - 0x9a8], 0
mov dword [ebp - 0x9a4], 0
mov dword [ebp - 0x998], eax
lea eax, [ebp - 0x99c]
mov dword [esp], eax
mov dword [ebp - 0x99c], ebx
call sym._startTunReadThread
mov dword [ebp - 0x9c8], eax
mov eax, dword [ebp + 0xc]
mov dword [eax], 1
mov dword [esp], 0
call dword [sym.imp.msvcrt.dll_time]
mov dword [esp], ebx
mov dword [esp + 4], eax
call sym._update_supernode_reg
mov dword [ebp - 0x9c4], 0
mov dword [ebp - 0x9b4], 0
mov eax, dword [ebp + 0xc]
cmp dword [eax], 0
je 0x408601
mov edx, dword [ebx + 0x154]
mov eax, dword [ebx + 0x158]
mov dword [ebp - 0x91c], 1
mov dword [ebp - 0x918], edx
cmp edx, eax
jne 0x4085ec
cmp edx, eax
lea ecx, [ebp - 0x994]
mov dword [ebp - 0x994], 0xa
cmovge eax, edx
mov dword [esp + 0x10], ecx
lea ecx, [ebp - 0x91c]
mov dword [esp + 4], ecx
inc eax
mov dword [esp + 0xc], 0
mov dword [ebp - 0x990], 0
mov dword [esp + 8], 0
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_select]
sub esp, 0x14
mov esi, eax
mov dword [esp], 0
call dword [sym.imp.msvcrt.dll_time]
mov dword [ebp - 0x9b0], eax
sub eax, dword [ebp - 0x9c4]
cmp eax, 0xa
jle 0x407b92
mov eax, dword [ebp - 0x9b0]
mov dword [esp + 4], eax
lea eax, [ebx + 0xf4]
mov dword [esp], eax
call dword [ebx + 0x10c]
mov eax, dword [ebp - 0x9b0]
mov dword [ebp - 0x9c4], eax
test esi, esi
jg 0x407be7
mov eax, dword [ebp - 0x9b0]
mov dword [esp], ebx
mov dword [esp + 4], eax
call sym._update_supernode_reg
lea eax, [ebp - 0x9a8]
mov dword [esp + 4], eax
lea eax, [ebx + 0x178]
mov dword [esp], eax
call sym._purge_expired_registrations
mov esi, eax
lea eax, [ebp - 0x9a4]
mov dword [esp + 4], eax
lea eax, [ebx + 0x17c]
mov dword [esp], eax
call sym._purge_expired_registrations
add eax, esi
jne 0x4084e7
jmp 0x40853b
lea eax, [ebp - 0x91c]
mov dword [esp + 4], eax
mov eax, dword [ebx + 0x154]
mov dword [esp], eax
call sym.___WSAFDIsSet_8
push esi
push esi
test eax, eax
je 0x407c17
mov eax, dword [ebx + 0x154]
mov dword [esp], ebx
mov dword [esp + 4], eax
call sym._readFromIPSocket
lea eax, [ebp - 0x91c]
mov dword [esp + 4], eax
mov eax, dword [ebx + 0x158]
mov dword [esp], eax
call sym.___WSAFDIsSet_8
push ecx
push ecx
test eax, eax
je 0x407b96
mov dword [esp], 0
lea esi, [ebp - 0x98c]
lea edi, [ebp - 0x818]
call dword [sym.imp.msvcrt.dll_time]
mov dword [esp + 0x10], esi
mov dword [ebp - 0x9b8], eax
lea eax, [ebp - 0x9a0]
mov dword [esp + 0x14], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x800
mov dword [esp + 4], edi
mov eax, dword [ebx + 0x158]
mov dword [ebp - 0x9a0], 0x10
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_recvfrom]
sub esp, 0x18
test eax, eax
jns 0x407cd7
call dword [sym.imp.msvcrt.dll__errno]
mov eax, dword [eax]
mov dword [esp], eax
call sym._strerror
mov dword [esp + 0xc], str.mgmt_recvfrom_failed_with__s
mov dword [esp + 0x10], eax
mov dword [esp + 8], 0x4ca
mov dword [esp + 4], str._n2n_lucktu_cnn2n_src_edge_utils.c
mov dword [esp], 0
call sym._traceEvent
jmp 0x4084d6
mov dword [esp + 8], 4
mov dword [esp + 4], str.help
mov dword [esp], edi
call sym._memcmp
test eax, eax
je 0x407cfc
cmp byte [ebp - 0x818], 0x3f
jne 0x407d42
lea esi, [ebp - 0x818]
mov dword [esp + 8], str.Help_for_edge_management_console:_n_tstop_____Gracefully_exit_edge_n_thelp_____This_help_message_n_tverb____Increase_verbosity_of_logging_n_t_verb____Decrease_verbosity_of_logging_n_t_enter___Display_statistics_n_n
mov dword [esp + 4], 0x800
mov dword [esp], esi
call dword [sym.imp.msvcrt.dll__snprintf]
lea edx, [ebp - 0x98c]
mov dword [esp + 4], esi
mov dword [esp + 0x14], 0x10
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
jmp 0x4084c4
mov dword [esp + 8], 4
mov dword [esp + 4], str.stop
mov dword [esp], edi
call sym._memcmp
test eax, eax
jne 0x407d90
mov dword [esp + 0xc], str.stop_command_received.
mov dword [esp + 8], 0x4e0
mov dword [esp + 4], str._n2n_lucktu_cnn2n_src_edge_utils.c
mov dword [esp], 0
call sym._traceEvent
mov eax, dword [ebp + 0xc]
mov dword [eax], 0
jmp 0x4084d6
mov dword [esp + 8], 5
mov dword [esp + 4], str.verb
mov dword [esp], edi
call sym._memcmp
test eax, eax
jne 0x407e2a
call sym._getTraceLevel
inc eax
mov dword [esp], eax
call sym._setTraceLevel
call sym._getTraceLevel
mov dword [esp + 0xc], str.verb_traceLevel_u
mov dword [esp + 0x10], eax
mov dword [esp + 8], 0x4e9
mov dword [esp + 4], str._n2n_lucktu_cnn2n_src_edge_utils.c
mov dword [esp], 0
call sym._traceEvent
call sym._getTraceLevel
mov dword [esp + 8], str.__OK_traceLevel_u_n
mov dword [esp + 0xc], eax
mov dword [esp + 4], 0x800
mov dword [esp], edi
call dword [sym.imp.msvcrt.dll__snprintf]
mov dword [esp + 0x14], 0x10
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
mov dword [esp + 4], edi
jmp 0x4084c4
mov dword [esp + 8], 5
mov dword [esp + 4], str._verb
mov dword [esp], edi
call sym._memcmp
test eax, eax
jne 0x407ee8
call sym._getTraceLevel
test eax, eax
jle 0x407e74
call sym._getTraceLevel
dec eax
mov dword [esp], eax
call sym._setTraceLevel
call sym._getTraceLevel
mov dword [esp + 8], str.___OK_traceLevel_u_n
mov dword [esp + 0xc], eax
jmp 0x407e85
call sym._getTraceLevel
mov dword [esp + 8], str.___NOK_traceLevel_u_n
mov dword [esp + 0xc], eax
mov dword [esp + 4], 0x800
mov dword [esp], edi
call dword [sym.imp.msvcrt.dll__snprintf]
mov esi, eax
call sym._getTraceLevel
mov dword [esp + 0xc], str._verb_traceLevel_u
mov dword [esp + 0x10], eax
mov dword [esp + 8], 0x4ff
mov dword [esp + 4], str._n2n_lucktu_cnn2n_src_edge_utils.c
mov dword [esp], 0
call sym._traceEvent
lea eax, [ebp - 0x98c]
mov dword [esp + 8], esi
mov dword [esp + 0x14], 0x10
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
jmp 0x4084ba
mov dword [esp + 0xc], str.mgmt_status_rq
mov esi, 0x800
mov dword [esp + 8], 0x506
mov dword [esp + 4], str._n2n_lucktu_cnn2n_src_edge_utils.c
mov dword [esp], 4
call sym._traceEvent
lea eax, [ebx + 0x64]
mov dword [esp], edi
mov dword [esp + 0xc], eax
mov eax, dword [sym.imp.msvcrt.dll__snprintf]
mov dword [esp + 8], str.community:__s_n
mov dword [esp + 4], 0x800
mov dword [ebp - 0x9ac], eax
call eax
mov dword [esp + 8], str.____id____mac________________lan_ip___________wan_ip___________________lseen_n
mov ecx, eax
mov eax, esi
sub eax, ecx
mov dword [ebp - 0x9bc], ecx
mov dword [esp + 4], eax
lea eax, [edi + ecx]
mov dword [esp], eax
mov eax, dword [ebp - 0x9ac]
call eax
mov ecx, dword [ebp - 0x9bc]
mov dword [esp + 8], str.___v2__________________________________________________________________v2____n
add ecx, eax
mov eax, esi
sub eax, ecx
mov dword [ebp - 0x9bc], ecx
mov dword [esp + 4], eax
lea eax, [edi + ecx]
mov dword [esp], eax
mov eax, dword [ebp - 0x9ac]
call eax
mov ecx, dword [ebp - 0x9bc]
mov dword [esp + 8], str.PsP_with:_n
add ecx, eax
lea eax, [edi + ecx]
sub esi, ecx
mov dword [ebp - 0x9bc], ecx
mov dword [esp + 4], esi
mov dword [esp], eax
mov eax, dword [ebp - 0x9ac]
call eax
mov ecx, dword [ebp - 0x9bc]
mov esi, dword [ebx + 0x17c]
mov dword [ebp - 0x9bc], 0
lea edi, [eax + ecx]
test esi, esi
je 0x4080fe
mov dword [ebp - 0x9ac], 0
mov ecx, dword [esi + 0x48]
mov eax, dword [esi + 8]
inc dword [ebp - 0x9bc]
test eax, eax
je 0x4080f0
mov dword [ebp - 0x9d4], ecx
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_htonl]
push ecx
mov dword [ebp - 0x9c0], eax
mov eax, dword [ebp - 0x9b8]
sub eax, dword [esi + 0x28]
mov dword [ebp - 0x9cc], eax
lea eax, [esi + 0x10]
mov dword [esp + 4], eax
lea eax, [ebp - 0x95c]
mov dword [esp], eax
call sym._sock_to_cstr
mov dword [ebp - 0x9d0], eax
mov eax, dword [ebp - 0x9c0]
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_inet_ntoa]
push edx
mov dword [ebp - 0x9c0], eax
lea eax, [ebp - 0x97c]
mov dword [esp + 4], esi
lea esi, [ebp - 0x818]
mov dword [esp], eax
call sym._macaddr_str
mov edx, dword [ebp - 0x9cc]
inc dword [ebp - 0x9ac]
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0x9ac]
mov dword [esp + 0x1c], edx
mov edx, dword [ebp - 0x9d0]
mov dword [esp + 0xc], eax
mov eax, 0x800
mov dword [esp + 0x18], edx
sub eax, edi
mov edx, dword [ebp - 0x9c0]
mov dword [esp + 4], eax
lea eax, [esi + edi]
mov dword [esp + 0x14], edx
mov dword [esp + 8], str.______4u____17s____15s____21s_____lu_n
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll__snprintf]
lea edx, [ebp - 0x98c]
mov dword [esp + 4], esi
add eax, edi
mov dword [esp + 0x10], edx
xor edi, edi
mov dword [esp + 0x14], 0x10
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
mov eax, dword [ebx + 0x158]
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_sendto]
mov ecx, dword [ebp - 0x9d4]
sub esp, 0x18
test ecx, ecx
je 0x4080fe
mov esi, ecx
mov ecx, dword [ecx + 0x48]
jmp 0x407fe2
mov eax, 0x800
mov dword [esp + 8], str.P2P_with:_n
sub eax, edi
mov dword [esp + 4], eax
lea eax, [ebp + edi - 0x818]
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll__snprintf]
mov esi, dword [ebx + 0x178]
mov dword [ebp - 0x9c0], 0
add edi, eax
test esi, esi
je 0x408264
mov dword [ebp - 0x9ac], 0
mov ecx, dword [esi + 0x48]
mov eax, dword [esi + 8]
inc dword [ebp - 0x9c0]
test eax, eax
je 0x408256
mov dword [ebp - 0x9d8], ecx
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_htonl]
push ecx
mov dword [ebp - 0x9cc], eax
mov eax, dword [ebp - 0x9b8]
sub eax, dword [esi + 0x28]
mov dword [ebp - 0x9d0], eax
lea eax, [esi + 0x10]
mov dword [esp + 4], eax
lea eax, [ebp - 0x95c]
mov dword [esp], eax
call sym._sock_to_cstr
mov dword [ebp - 0x9d4], eax
mov eax, dword [ebp - 0x9cc]
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_inet_ntoa]
push edx
mov dword [ebp - 0x9cc], eax
lea eax, [ebp - 0x97c]
mov dword [esp + 4], esi
lea esi, [ebp - 0x818]
mov dword [esp], eax
call sym._macaddr_str
inc dword [ebp - 0x9ac]
mov edx, dword [ebp - 0x9d4]
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0x9ac]
mov ecx, dword [ebp - 0x9d0]
mov dword [esp + 0x18], edx
mov dword [esp + 0xc], eax
mov eax, 0x800
mov edx, dword [ebp - 0x9cc]
sub eax, edi
mov dword [esp + 0x1c], ecx
mov dword [esp + 4], eax
lea eax, [esi + edi]
mov dword [esp + 0x14], edx
mov dword [esp + 8], str.______4u____17s____15s____21s_____lu_n
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll__snprintf]
lea edx, [ebp - 0x98c]
mov dword [esp + 4], esi
add eax, edi
mov dword [esp + 0x10], edx
xor edi, edi
mov dword [esp + 0x14], 0x10
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
mov eax, dword [ebx + 0x158]
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_sendto]
mov ecx, dword [ebp - 0x9d8]
sub esp, 0x18
test ecx, ecx
je 0x408264
mov esi, ecx
mov ecx, dword [ecx + 0x48]
jmp 0x408148
mov eax, 0x800
mov dword [esp + 8], str.___v2__________________________________________________________________v2____n
sub eax, edi
mov dword [esp + 4], eax
lea eax, [ebp - 0x818]
add eax, edi
mov dword [esp], eax
mov eax, dword [sym.imp.msvcrt.dll__snprintf]
mov dword [ebp - 0x9ac], eax
call eax
mov dword [esp], 0
lea esi, [eax + edi]
mov edi, 0xe10
call dword [sym.imp.msvcrt.dll_time]
mov ecx, 0x15180
xor edx, edx
sub eax, dword [ebx + 0x18c]
div ecx
mov dword [esp + 8], str.uptime__lud__luh_
mov ecx, eax
mov eax, edx
xor edx, edx
div edi
mov dword [esp + 0xc], ecx
mov dword [esp + 0x10], eax
mov eax, 0x800
sub eax, esi
mov dword [esp + 4], eax
lea eax, [ebp - 0x818]
add eax, esi
mov dword [esp], eax
mov eax, dword [ebp - 0x9ac]
call eax
mov dword [esp + 8], str.pend_known_peers__u_
lea edi, [eax + esi]
mov eax, dword [ebp - 0x9bc]
mov dword [esp + 0xc], eax
mov eax, 0x800
sub eax, edi
mov dword [esp + 4], eax
lea eax, [ebp - 0x818]
add eax, edi
mov dword [esp], eax
mov eax, dword [ebp - 0x9ac]
call eax
mov dword [esp + 8], str._u_
add edi, eax
mov eax, dword [ebp - 0x9c0]
mov dword [esp + 0xc], eax
mov eax, 0x800
sub eax, edi
mov dword [esp + 4], eax
lea eax, [ebp - 0x818]
add eax, edi
mov dword [esp], eax
mov eax, dword [ebp - 0x9ac]
call eax
add edi, eax
mov eax, dword [ebp - 0x9b8]
sub eax, dword [ebx + 0x188]
mov dword [esp + 8], str.last_super_p2p__ld_
mov dword [esp + 0xc], eax
mov eax, 0x800
sub eax, edi
mov dword [esp + 4], eax
lea eax, [ebp - 0x818]
add eax, edi
mov dword [esp], eax
mov eax, dword [ebp - 0x9ac]
call eax
add edi, eax
mov eax, dword [ebp - 0x9b8]
sub eax, dword [ebx + 0x184]
mov dword [esp + 8], str._lds_ago_n
mov dword [esp + 0xc], eax
mov eax, 0x800
sub eax, edi
mov dword [esp + 4], eax
lea eax, [ebp - 0x818]
add eax, edi
mov dword [esp], eax
mov eax, dword [ebp - 0x9ac]
call eax
add edi, eax
mov eax, dword [ebx + 0x104]
mov dword [esp + 0x10], eax
mov eax, dword [ebx + 0x100]
mov dword [esp + 8], str.transop__u__u_
mov dword [esp + 0xc], eax
mov eax, 0x800
sub eax, edi
mov dword [esp + 4], eax
lea eax, [ebp - 0x818]
add eax, edi
mov dword [esp], eax
mov eax, dword [ebp - 0x9ac]
call eax
add edi, eax
mov eax, dword [ebx + 0x19c]
mov dword [esp + 0x10], eax
mov eax, dword [ebx + 0x198]
mov dword [esp + 8], str.super__u__u_
mov dword [esp + 0xc], eax
mov eax, 0x800
sub eax, edi
mov dword [esp + 4], eax
lea eax, [ebp - 0x818]
add eax, edi
mov dword [esp], eax
mov eax, dword [ebp - 0x9ac]
call eax
add edi, eax
mov eax, dword [ebx + 0x194]
mov dword [esp + 0x10], eax
mov eax, dword [ebx + 0x190]
mov dword [esp + 8], str.p2p__u__u_n
mov dword [esp + 0xc], eax
mov eax, 0x800
sub eax, edi
mov dword [esp + 4], eax
lea eax, [ebp - 0x818]
add eax, edi
mov dword [esp], eax
mov eax, dword [ebp - 0x9ac]
call eax
mov dword [esp + 8], str._nType__help__to_see_more_commands._n_n
add edi, eax
mov eax, 0x800
sub eax, edi
mov dword [esp + 4], eax
lea eax, [ebp - 0x818]
add eax, edi
mov dword [esp], eax
mov eax, dword [ebp - 0x9ac]
call eax
lea edx, [ebp - 0x98c]
mov dword [esp + 0x14], 0x10
add eax, edi
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
lea eax, [ebp - 0x818]
mov dword [esp + 4], eax
mov eax, dword [ebx + 0x158]
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_sendto]
sub esp, 0x18
mov eax, dword [ebp + 0xc]
cmp dword [eax], 0
jne 0x407b96
jmp 0x408601
mov edx, dword [ebx + 0x178]
xor ecx, ecx
test edx, edx
je 0x4084f9
mov edx, dword [edx + 0x40]
mov ecx, dword [edx + 0xc]
mov esi, dword [ebx + 0x17c]
xor edx, edx
test esi, esi
je 0x40850b
mov edx, dword [esi + 0x40]
mov edx, dword [edx + 0xc]
mov dword [esp + 0x18], ecx
mov dword [esp + 0x14], edx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str._u_peers_removed._now:_pending_u__operational_u
mov dword [esp + 8], 0x878
mov dword [esp + 4], str._n2n_lucktu_cnn2n_src_edge_utils.c
mov dword [esp], 3
call sym._traceEvent
cmp byte [ebx + 0x88], 2
jne 0x4085ca
mov eax, dword [ebp - 0x9b0]
sub eax, dword [ebp - 0x9b4]
cmp eax, 0x1e
jle 0x4085ca
mov esi, dword [ebx + 0xe8]
mov dword [esp + 0xc], str.Re_checking_dynamic_IP_address.
mov dword [esp + 8], 0x882
mov dword [esp + 4], str._n2n_lucktu_cnn2n_src_edge_utils.c
mov dword [esp], 2
call sym._traceEvent
lea eax, [ebx + 0xac]
mov dword [esp], eax
call sym._tuntap_get_address
mov eax, dword [ebp - 0x9b0]
mov edx, dword [ebx + 0xe8]
mov dword [ebp - 0x9b4], eax
cmp edx, esi
je 0x4085ca
mov eax, dword [ebx + 0x12c]
test eax, eax
je 0x4085ca
mov dword [esp + 8], edx
mov dword [esp + 4], esi
mov dword [esp], ebx
call eax
mov eax, dword [ebp - 0x9b0]
mov dword [ebp - 0x9b4], eax
mov eax, dword [ebx + 0x130]
test eax, eax
je 0x407ad3
mov edx, dword [ebp - 0x9b0]
mov dword [esp], ebx
mov dword [esp + 4], edx
call eax
jmp 0x407ad3
mov dword [ebp - 0x914], eax
mov dword [ebp - 0x91c], 2
jmp 0x407b03
mov eax, dword [ebp - 0x9c8]
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push eax
push eax
mov eax, dword [ebx + 0x154]
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_closesocket]
xor eax, eax
push edx
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret