Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IPMac scanner
#1
How can I get the IP - MAC - HOSTNAME of computers conected in router (192.168.0.xxx) with QM?
#2
Can you get it with ipconfig? If not, I don't know.

RunConsole2 "ipconfig /all"
#3
In DOS there are commands like

NET VIEW
ARP -A
NBTSTAT -A IP

Do you know any way in windows?
#4
RunConsole2 "net VIEW"
RunConsole2 "arp -A"
#5
I was looking for something like a function or dll...
#6
Look in codeproject, codeguru, etc. But I think it will not be easy.
#7
I'm thinking in Ping to 192.168.0.0 - 192.168.0.255 and convert ip to mac using Iphlpapi.dll/SendARP...

Can you help with Iphlpapi.dll/SendARP?
#8
dll iphlpapi #SendARP DestIP SrcIP !*pMacAddr *PhyAddrLen
#9
Can you include an example?
#10
Macro Macro1447
Code:
Copy      Help
str computerName="comp"

dll iphlpapi #SendARP DestIP SrcIP !*pMacAddr *PhyAddrLen

str ipSrc ipDst
GetIpAddress "" &ipSrc
GetIpAddress computerName &ipDst
;out ipSrc
;out ipDst

str MAC.all(8); _i=8
if(SendARP(inet_addr(ipDst) inet_addr(ipSrc) MAC &_i)) end "failed"
MAC.fix(_i)
MAC.encrypt(8 MAC "" 1)
out MAC
#11
Thanks.
#12
Enumerates network computers, like NET VIEW.

Macro Macro1448
Code:
Copy      Help
def MAX_PREFERRED_LENGTH 0xFFFFFFFF
def SV_TYPE_NT 0x00001000
type SERVER_INFO_100 sv100_platform_id @*sv100_name
dll netapi32 #NetServerEnum @*servername level !**bufptr prefmaxlen *entriesread *totalentries servertype @*domain *resume_handle
dll netapi32 #NetApiBufferFree !*Buffer

SERVER_INFO_100* p
int n nt
if(NetServerEnum(0 100 &p MAX_PREFERRED_LENGTH &n &nt SV_TYPE_NT 0 0)) end "failed"

int i
for i 0 n
,str s.ansi(p[i].sv100_name)
,out s

NetApiBufferFree p
#13
Do you know any way to get hostname using ip?
#14
I know only this, but should be a better way. This does not support Unicode. Also appends some text.

Macro Macro1448
Code:
Copy      Help
GetIpAddress "" _s ;;just to call WSAStartup
int ia=inet_addr(IP)
hostent* hp = gethostbyaddr(+&ia 4 AF_INET)
out hp.h_name
#15
Thanks again.

note: int ia=inet_addr(IP) --> int ia=inet_addr(_s)
#16
no, _s here not used.
IP must be string containing IP address.


Forum Jump:


Users browsing this thread: 1 Guest(s)