hello,all protocol:GGP ip address:224.0.0.22 ;=================== what's the package function? regards
try to create DatagramSocket() object. if false, you must setup: 1. Socket, 2. ServerSocket 3. Thread support 4. THREAD NETWORK DRIVER 5. ip6
HELLO,opennetworks thanks your answer. while a local network was crashed, the package appears. which computer does send the package? DNS server, or gateway?
Shift. To detect Computer kind you can user InetAddress object. to get host by address: Код (Text): InetAddress iana = new InetAddress("224.0.0.22"); String host = iana.getByName(); *** So you can detect ServerName. Try to create connection on 221 or 111 not 80 xor 110 ports to view open ports. send PACK message to 221 port: msglist 224.0.0.22 221 PACK localhost AS THIS >224.0.0.22: 127.0.0.1 1ms * 192.168.0.1 msglist 224.0.0.22 221 PACK $NS$ THIS AS THIS >224.0.0.22: ns1.servername.zone in-addr.arpa 255.255.255.0 if last message valid - this is DNS SERVER if last message - >224.0.0.22: ROUTE TABLE 00 DF 04 C7 AA C0 * 0.0.0.255 then it is router
hey,opennetworks thanks. i can't understand what you said the packet was disappeared while i used [ip port software] to scan. that's meaning "can't detect Computer" the ip address(224.0.0.22) is strange in our local net. so i think the Computer of the ip address has a especial function.
How do you send packets. PACKET command only available on UDP protocol DatagramPacket() object must be used and IOException throwed
Код (Text): .586 .model flat,stdcall option casemap:none ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> include \masm32\include\windows.inc include \masm32\include\user32.inc include \masm32\include\kernel32.inc include \masm32\include\masm32.inc include \masm32\include\wsock32.inc includelib \masm32\lib\user32.lib includelib \masm32\lib\kernel32.lib includelib \masm32\lib\masm32.lib includelib \masm32\lib\wsock32.lib ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> include \masm32\macros\macros.asm ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ICO_ICON equ 2000 DLG_MAIN equ 2000 IDC_IP equ 2001 IDC_RECVTEXT equ 2002 IDC_SENDTEXT equ 2003 IDC_PORT equ 2004 ID_SEND equ 3001 WM_SOCKET equ WM_USER + 100 ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> .data? hInstance dd ? hWinMain dd ? hSocket dd ? szReadBuffer db 32768 dup (?) @stWsa WSADATA <?> ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> .const szPort db '221',0 szIP db '224.0.0.22',0 szErrIP db 'INVALID Ip Address!',0 dwReturn dd -1 ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> .code ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> _RecvData proc _hSocket:SOCKET local @dwRecv,@dwSize local xxSin:sockaddr_in mov @dwSize,sizeof xxSin invoke RtlZeroMemory,addr szReadBuffer,sizeof szReadBuffer invoke RtlZeroMemory,addr xxSin,sizeof xxSin invoke recvfrom,_hSocket,addr szReadBuffer,sizeof szReadBuffer,0,addr xxSin,addr @dwSize .if eax != SOCKET_ERROR invoke sendto,hSocket,addr dwReturn,4,0,addr xxSin,sizeof sockaddr_in .if eax == SOCKET_ERROR invoke WSAGetLastError .if eax == WSAEWOULDBLOCK invoke GetDlgItem,hWinMain,ID_SEND invoke EnableWindow,eax,FALSE .endif .endif invoke GetDlgItem,hWinMain,IDC_RECVTEXT mov ebx,eax invoke GetWindowTextLength,ebx invoke SendMessage,ebx,EM_SETSEL,eax,eax invoke SendMessage,ebx,EM_REPLACESEL,FALSE,addr szReadBuffer .endif ret _RecvData endp ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> _SendData proc USES ECX local SendBuffer[512]:byte local xxSin:sockaddr_in invoke RtlZeroMemory,addr SendBuffer,sizeof SendBuffer invoke RtlZeroMemory,addr xxSin,sizeof xxSin invoke GetDlgItemText,hWinMain,IDC_IP,addr SendBuffer,sizeof SendBuffer invoke inet_addr,addr SendBuffer .if eax == INADDR_NONE invoke MessageBox,hWinMain,addr szErrIP,NULL,MB_OK or MB_ICONWARNING jmp @Exit .endif mov xxSin.sin_addr,eax mov xxSin.sin_family,AF_INET invoke GetDlgItemText,hWinMain,IDC_PORT,addr SendBuffer,sizeof SendBuffer invoke atodw, addr SendBuffer invoke htons,eax mov xxSin.sin_port,ax invoke GetDlgItemText,hWinMain,IDC_SENDTEXT,addr SendBuffer,sizeof SendBuffer invoke lstrlen,addr SendBuffer .if eax mov ecx,eax invoke sendto,hSocket,addr SendBuffer,ecx,0,addr xxSin,sizeof sockaddr_in .if eax == SOCKET_ERROR invoke WSAGetLastError .if eax == WSAEWOULDBLOCK invoke GetDlgItem,hWinMain,ID_SEND invoke EnableWindow,eax,FALSE .endif .endif .endif @Exit: ret _SendData endp ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> _ProcDlg proc hWnd:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM .if uMsg == WM_SOCKET mov eax,lParam .if ax == FD_READ invoke _RecvData,wParam .elseif ax == FD_WRITE invoke GetDlgItem,hWnd,ID_SEND invoke EnableWindow,eax,TRUE .endif .elseif uMsg == WM_COMMAND mov eax,wParam .if ax == ID_SEND invoke _SendData .endif .elseif uMsg == WM_CLOSE invoke closesocket,hSocket invoke WSACleanup invoke EndDialog,hWinMain,NULL .elseif uMsg == WM_INITDIALOG m2m hWinMain,hWnd invoke LoadIcon,hInstance, ICO_ICON invoke SendMessage, hWnd, WM_SETICON, ICON_SMALL or ICON_BIG, eax invoke SetDlgItemText,hWinMain,IDC_PORT,addr szPort invoke SetDlgItemText,hWinMain,IDC_IP,addr szIP invoke WSAStartup,202h,addr @stWsa invoke socket,AF_INET,SOCK_DGRAM,0 mov hSocket,eax invoke WSAAsyncSelect,hSocket,hWinMain,WM_SOCKET,FD_READ or FD_WRITE .else mov eax,FALSE ret .endif mov eax,TRUE ret _ProcDlg endp ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> start: invoke GetModuleHandle,NULL mov hInstance, eax invoke DialogBoxParam,hInstance,DLG_MAIN,NULL,offset _ProcDlg,0 invoke ExitProcess,NULL ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> end start
language not supported For Network programming i am using Microsoft Visual Studio cause windows or ANT cause UNIX I am using ASM for creating Low-level applications only. Would you like to view full code in MSVS?