Hello, everybody.

the below code can't work. what's wrong?

;=========================
invoke gethostbyaddr,addr ip,4,2 ;gets host info from address info
;--------------------------------------------------
;whostent hostent <?>
                ;format db "%s",0
;hostent STRUCT
;? h_name? ? ? DWORD? ? ? ?
;? h_alias? ? ?DWORD? ? ? ?
;? h_addr? ? ? WORD? ? ? ??
;? h_len? ? ? ?WORD? ? ? ??
;? h_list? ? ? DWORD? ? ? ?
;hostent ENDS
;-------------------------------------------------
.if eax !=0? ? ? ? ? ?; see if gethost...worked
invoke wsprintf,addr host_buffer,addr format, addr whostent.h_name, whostent.h_alias, \
whostent.h_addr, whostent.h_len, whostent.h_list
invoke MessageBox, NULL, addr host_buffer, addr dlgname, MB_OK
.else
invoke wsprintf, addr host_buffer, addr format, addr unknow
invoke MessageBox, NULL, addr host_buffer, addr dlgname, MB_OK

.endif? ? ? ? ? ? ? ?
;=========================

regards.

Posted on 2005-04-04 06:21:45 by dcskm4200
http://www.geocities.com/freehafer/zip/zhost.zip

First use WSAStartup.  If you call gethostbyaddr you have to call something like inet_addr first and be on the internet or just call gethostbyname.
Posted on 2005-04-10 16:40:58 by roaknog
hey, roaknog.
sorry. I responsed your post too late. I took a holiday about two weeks.

Thanks you very much.
zhost.zip help me a lot.

regards
Posted on 2005-04-24 10:26:56 by dcskm4200