Hello, Recently I tried to find a function that helps me to resolve me local IP address. So far i have looked through WinSock f-ns, no success yet. Someone plz point me on to some small example. Thanks!
Posted on 2000-11-21 01:24:00 by AndyCar
Hi, Currently I am working on a small Netspy Utility. I will published it in december. Here is a code snippet : ;--------------------------------------------------------------- ; API "gethostname" returns the standard host name local machine ;--------------------------------------------------------------- push 60h ;namelen, the length of the buffer push OFFSET Buffer ;name, pointer receives hostname call gethostname ;- API Function - cmp eax,0h ;error ? jne My_Error ;- ErrorRoutine - ;--------------------------------------------------------------- ; API "gethostbyname" gets host information for a host name. ;--------------------------------------------------------------- push OFFSET Buffer ;name, pointer to name of the host call gethostbyname ;- API Function - cmp eax,0h ;error ? je My_Error ;- ErrorRoutine - mov ebx, ;get h_addr_list from hostent struc mov eax, ;get far pointer mov ebx, ;get far pointer ;--------------------------------------------------------------- ; API "inet_ntoa" converts net address to string in dotted format ;--------------------------------------------------------------- push ebx ;in, struc Internet host address call inet_ntoa ;- API Function - cmp eax,0h ;error ?
Posted on 2000-11-21 04:38:00 by Test Department