Page 1 of 1

retrieve MAC from registry ?

Posted: 27 Sep 2011 02:26
by Ed Dyreen
'
Is there a way to retrieve MAC from registry instead of the SLOW GetMAC.EXE :?:

Re: retrieve MAC from registry ?

Posted: 27 Sep 2011 03:31
by trap

Code: Select all

getmac >> MAC.txt

Re: retrieve MAC from registry ?

Posted: 27 Sep 2011 03:34
by Ed Dyreen
'
from registry :shock:

Re: retrieve MAC from registry ?

Posted: 27 Sep 2011 06:56
by trap
Idk how you get it from registry :) Why isnt that batch enough? Why do you call it slow? :p

Re: retrieve MAC from registry ?

Posted: 27 Sep 2011 07:15
by Ed Dyreen
'
GetMAC takes around 3000ms on my machine, that's about 900.000.000.000 instructions wasted on a 3GHz pc.
RegRead is much faster, I just don't know which key :|

Re: retrieve MAC from registry ?

Posted: 27 Sep 2011 09:15
by dbenham
I don't know much about the registry or MACs, but a Google search indicates it is possible to over-ride the physical MAC specified by the card by using the registry. But based on my casual search it doesn't look like the registry typically has the value unless it has been over-ridden.

Why not use IPCONFIG /ALL :?: - The MAC is listed under "Physical Address"

IPCONFIG /ALL is much faster than GETMAC on my machine.

This works on my Vista machine with a single NIC:

Code: Select all

for /f "tokens=3 delims=:. " %%A in ('ipconfig /all^|findstr /c:"Physical Address"') do set MAC=%%A


Dave Benham

Re: retrieve MAC from registry ?

Posted: 27 Sep 2011 09:39
by Ed Dyreen
'
Love ya :D
I'll just add an 'if defined' construct to that, I program in VM so I have at least 3NIC's.
Luckily the physical NIC is always listed first.

Vista you say, hmm I hope you have autorun.virus disabled :lol:

Re: retrieve MAC from registry ?

Posted: 27 Sep 2011 22:05
by Ed Dyreen
'
I don't know much about the registry or MACs,
I use MAC to differentiate computer systems from one another.

That way my program can identify who it's dealing with, and personalize the target.
This only works for systems powered with a physical NIC !

If someone knows a better way, I'd like to know :wink: