Hack Forums
[Shell] [batch] My Mac address creator - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Shell] [batch] My Mac address creator (/showthread.php?tid=3329868)



[batch] My Mac address creator - delta5 - Mar 15, 2013

I have not put in the rest of the code to make it change your mac address but here is a simple mac address generator.

Code
@ECHO OFF
setlocal
:loop
set /a n1=%random% %% 16
set /a n2=%random% %% 16
set /a n3=%random% %% 16
set /a n4=%random% %% 16
set /a n5=%random% %% 16
set /a n6=%random% %% 16
set /a n7=%random% %% 16
set /a n8=%random% %% 16
set /a n9=%random% %% 16
set /a n10=%random% %% 16
set /a n11=%random% %% 16
set /a n12=%random% %% 16
for %%a in ("10=a" "11=b" "12=c" "13=d" "14=e" "15=f") do (
    call set n1=%%n1:%%~a%%
    call set n2=%%n2:%%~a%%
    call set n3=%%n3:%%~a%%
    call set n4=%%n4:%%~a%%
    call set n5=%%n5:%%~a%%
    call set n6=%%n6:%%~a%%
    call set n7=%%n7:%%~a%%
    call set n8=%%n8:%%~a%%
    call set n9=%%n9:%%~a%%
    call set n10=%%n10:%%~a%%
    call set n11=%%n11:%%~a%%
    call set n12=%%n12:%%~a%%
)
if %n1%==%n2% goto loop
if %n3%==%n4% goto loop
if %n5%==%n6% goto loop
if %n7%==%n8% goto loop
if %n9%==%n10% goto loop
if %n11%==%n12% goto loop
CLS
echo %n1%%n2%%n3%%n4%%n5%%n6%%n7%%n8%%n9%%n10%%n11%%n12%
pause
goto loop



* - PigBacon - Mar 15, 2013

Can you even change your MAC address easily in Windows?
Also, does this produce 100% valid MAC addresses, or just ones which resemble valid addresses?


* - SoulByte - Mar 16, 2013

(Mar 15, 2013 05:01 PM)plausibility Wrote:  Can you even change your MAC address easily in Windows?
Also, does this produce 100% valid MAC addresses, or just ones which resemble valid addresses?

Yes, you only need to change a registry value.


* - delta5 - Mar 16, 2013

(Mar 15, 2013 05:01 PM)plausibility Wrote:  Can you even change your MAC address easily in Windows?
Also, does this produce 100% valid MAC addresses, or just ones which resemble valid addresses?

I have internet over cable so it is easy for me to get a new IP address. As for being 100% valid mac addresses it should work every time as the generator only produces 2 digit hex numbers.

The only issue I am having now is writing the code to find where your mac address is in reg and use that info for the changing of the mac address. For example the value I need to change is in /0012.

So I could write the batch file to change mine right now but with it that way everyone else would need to edit the batch and change the 0012 to their correct folder.