Function at 0x4d17b0
Capabilities:
Create tcp socket
Create udp socket
Get local ipv4 addresses
Get socket information
Get socket status
Send data
Send data on socket
Start tcp server

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x138
mov ebx, dword [ecx + 4]
mov dword [esp], 0xfffeffff
mov ebp, edx
mov edi, ecx
mov esi, 1
cmp dword [edx + 4], 0
jne 0x4d17e7
mov eax, dword [edi + 0xc]
xor esi, esi
lea ecx, [eax - 2]
cmp ecx, 9
ja 0x4d17e7
mov esi, dword [eax*4 + 0x59d218]
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 0xc]
cmp eax, 0xffffffff
je 0x4d18a1
mov edx, ecx
xor edx, eax
cmp edx, 0x12345678
jne 0x4d18a1
test esi, esi
je 0x4d18ca
mov dword [esp + 0x10], ebx
mov dword [esp + 0x1c], 0x10
push 0
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov ebx, eax
cmp eax, 0xffffffff
je 0x4d19fd
mov dword [esp + 0x14], esi
mov dword [esp + 0x34], 2
push str.127.0.0.1
call dword [sym.imp.WS2_32.dll_inet_addr]
lea esi, [esp + 0x34]
mov dword [esp + 0x38], eax
push 0x10
push esi
push ebx
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
js 0x4d1a52
lea eax, [esp + 0x1c]
push eax
push esi
push ebx
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
js 0x4d1a93
push 1
push ebx
call dword [sym.imp.WS2_32.dll_listen]
test eax, eax
js 0x4d1b68
movzx eax, word [esp + 0x36]
mov dword [esp + 4], ebx
mov ebx, dword [esp + 0x10]
mov dword [esp + 8], ebp
mov byte [edi + 0x1c], al
mov byte [edi + 0x1d], ah
jmp 0x4d18da
sub esp, 0x14
mov dword [esp + 0x10], ecx
mov dword [esp + 0xc], eax
mov dword [esp + 8], ebp
mov dword [esp + 4], str.dnssd_clientstub_deliver_request:_invalid_DNSServiceRef__p__08X__08X
call fcn.004d0a30
add esp, 0x14
mov eax, 0xfffefffb
jmp 0x4d1cdb
mov dword [esp + 8], ebp
mov dword [esp + 0x14], esi
mov dword [esp + 4], 0xffffffff
mov dword [esp + 0xc], edi
push edi
call fcn.004d3d30
add esp, 4
add ebx, 0x1c
mov dword [esp + 0x10], ebx
je 0x4d1923
mov eax, dword [esp + 8]
mov edi, dword [esp + 0x10]
mov ebx, dword [esp + 0xc]
mov esi, dword [eax + 8]
nop
push 0
push edi
push ebx
push esi
call dword [sym.imp.WS2_32.dll_send]
mov ebp, eax
test eax, eax
js 0x4d1a3e
cmp edi, ebp
jb 0x4d1a3e
add ebx, ebp
sub edi, ebp
jne 0x4d1900
mov esi, dword [esp + 0x14]
mov ebp, 0xffffffff
test esi, esi
jne 0x4d1941
mov eax, dword [esp + 8]
mov ebp, dword [eax + 8]
cmp dword [eax + 0x18], 0x10
jne 0x4d1ad4
cmp byte [0x5c4b08], 0
mov edi, dword [esp + 0xc]
mov ebx, dword [esp + 4]
mov dword [esp + 0x18], 0x10
jne 0x4d1cac
lea ecx, [esp + 0x2c]
mov dword [esp + 0x38], ebx
mov dword [esp + 0x2c], 0xa
mov dword [esp + 0x34], 1
mov dword [esp + 0x30], 0
lea eax, [ebx + 1]
lea edx, [esp + 0x34]
push ecx
push 0
push 0
push edx
push eax
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
je 0x4d1c3b
cmp byte [0x5c4b08], 1
je 0x4d1cac
lea eax, [esp + 0x18]
mov dword [esp], 0
lea ecx, [esp + 0x1c]
push eax
push ecx
push ebx
call dword [sym.imp.WS2_32.dll_accept]
mov ebp, eax
cmp eax, 0xffffffff
je 0x4d1c50
push ebx
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, dword [esp + 8]
mov ebx, 0xffffffff
cmp dword [eax + 0x18], 0x10
jne 0x4d1adc
mov dword [esp], 0
mov ebx, 0xffffffff
test esi, esi
jne 0x4d1cb7
jmp 0x4d1ccf
mov esi, dword [sym.imp.WS2_32.dll_WSAGetLastError]
call esi
mov ebp, ebx
mov ebx, eax
call esi
push eax
call fcn.004d3b00
add esp, 4
sub esp, 0x14
mov dword [esp + 0xc], ebx
mov dword [esp + 0x10], eax
mov ebx, ebp
mov dword [esp + 8], str.TCP_socket
mov dword [esp + 4], str.dnssd_clientstub_deliver_request:__s_failed__d___s_
call fcn.004d0a30
add esp, 0x14
jmp 0x4d1ba4
test ebp, ebp
js 0x4d1bb7
mov eax, 0x59c7ad
xor ecx, ecx
jmp 0x4d1bd0
mov esi, dword [sym.imp.WS2_32.dll_WSAGetLastError]
call esi
mov ebp, ebx
mov ebx, eax
call esi
push eax
call fcn.004d3b00
add esp, 4
sub esp, 0x14
mov dword [esp + 0xc], ebx
mov dword [esp + 0x10], eax
mov ebx, ebp
mov dword [esp + 8], str.TCP_bind
mov dword [esp + 4], str.dnssd_clientstub_deliver_request:__s_failed__d___s_
call fcn.004d0a30
add esp, 0x14
jmp 0x4d1ba4
mov esi, dword [sym.imp.WS2_32.dll_WSAGetLastError]
call esi
mov ebp, ebx
mov ebx, eax
call esi
push eax
call fcn.004d3b00
add esp, 4
sub esp, 0x14
mov dword [esp + 0xc], ebx
mov dword [esp + 0x10], eax
mov ebx, ebp
mov dword [esp + 8], str.TCP_getsockname
mov dword [esp + 4], str.dnssd_clientstub_deliver_request:__s_failed__d___s_
call fcn.004d0a30
add esp, 0x14
jmp 0x4d1ba4
mov edi, dword [esp + 0xc]
mov ebx, dword [esp + 4]
cmp byte [0x5c4b08], 0
jne 0x4d1cac
lea ecx, [esp + 0x1c]
mov dword [esp + 0x38], ebp
mov dword [esp + 0x1c], 0xa
mov dword [esp + 0x34], 1
mov dword [esp + 0x20], 0
lea eax, [ebp + 1]
lea edx, [esp + 0x34]
push ecx
push 0
push 0
push edx
push eax
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
je 0x4d1c92
cmp byte [0x5c4b08], 1
je 0x4d1cac
mov dword [esp], 0
mov edx, esp
mov ecx, ebp
push 4
call fcn.004d0dd0
add esp, 4
test eax, eax
js 0x4d1ce6
push dword [esp]
call dword [sym.imp.WS2_32.dll_ntohl]
mov dword [esp], eax
test esi, esi
jne 0x4d1cb7
jmp 0x4d1ccf
mov esi, dword [sym.imp.WS2_32.dll_WSAGetLastError]
call esi
mov ebp, ebx
mov ebx, eax
call esi
push eax
call fcn.004d3b00
add esp, 4
sub esp, 0x14
mov dword [esp + 0xc], ebx
mov dword [esp + 0x10], eax
mov ebx, ebp
mov dword [esp + 8], str.TCP_listen
mov dword [esp + 4], str.dnssd_clientstub_deliver_request:__s_failed__d___s_
call fcn.004d0a30
add esp, 0x14
mov ebp, 0xffffffff
cmp ebx, 0xffffffff
jne 0x4d1cbc
jmp 0x4d1cc3
mov ebx, dword [sym.imp.WS2_32.dll_WSAGetLastError]
call ebx
mov ecx, ebx
mov ebx, eax
call ecx
push eax
call fcn.004d3b00
mov ecx, ebx
add esp, 4
mov ebx, dword [esp + 4]
sub esp, 0x1c
mov dword [esp + 0x18], eax
mov dword [esp + 0x14], ecx
mov dword [esp + 0x10], edi
mov dword [esp + 0xc], ebp
mov dword [esp + 8], esi
mov dword [esp + 4], str.dnssd_clientstub_write_all__d__failed__ld__ld__d__s
call fcn.004d0a30
add esp, 0x1c
mov eax, dword [esp + 8]
mov eax, dword [eax + 8]
sub esp, 0x10
mov ecx, dword [esp + 0x20]
mov dword [esp + 8], eax
mov dword [esp + 4], str.dnssd_clientstub_deliver_request_ERROR:_write_all__d___lu_bytes__failed
mov dword [esp + 0xc], ecx
call fcn.004d0a30
add esp, 0x10
mov edi, dword [esp + 0xc]
mov esi, dword [esp + 0x14]
mov ebp, 0xffffffff
test esi, esi
jne 0x4d1cb7
jmp 0x4d1ccf
sub esp, 8
mov dword [esp + 4], str.dnssd_clientstub_wait_for_daemon_timed_out
call fcn.004d0a30
add esp, 8
jmp 0x4d1ca5
mov ebp, esi
mov esi, dword [sym.imp.WS2_32.dll_WSAGetLastError]
call esi
mov ebx, eax
call esi
mov esi, ebp
push eax
call fcn.004d3b00
add esp, 4
sub esp, 0x14
mov dword [esp + 0xc], ebx
mov ebx, dword [esp + 0x18]
mov dword [esp + 0x10], eax
mov dword [esp + 8], str.accept
mov dword [esp + 4], str.dnssd_clientstub_deliver_request:__s_failed__d___s_
call fcn.004d0a30
add esp, 0x14
jmp 0x4d1c29
sub esp, 8
mov dword [esp + 4], str.dnssd_clientstub_wait_for_daemon_timed_out
call fcn.004d0a30
add esp, 8
mov byte [0x5c4b08], 1
mov dword [esp], 0xfffeffe0
test esi, esi
je 0x4d1ccf
cmp ebx, 0xffffffff
je 0x4d1cc3
push ebx
call dword [sym.imp.WS2_32.dll_closesocket]
cmp ebp, 0xffffffff
je 0x4d1ccf
push ebp
call dword [sym.imp.WS2_32.dll_closesocket]
push edi
call fcn.00506b00
add esp, 4
mov eax, dword [esp]
add esp, 0x138
pop esi
pop edi
pop ebx
pop ebp
ret
mov dword [esp], 0xfffeffe5
test esi, esi
jne 0x4d1cb7
jmp 0x4d1ccf