c# - how to spoof MAC address via code -


i'm trying spoof mac address of computer executes program. right i'm getting current mac address of machine using 'getmac' command via cmd, want change via 'registrykey' class(windows.system32).

the issue don't know string pass opensubkey method.

for example method read current mac registry key reading:

 private string readmac()     {         registrykey rkey;         string mac;         rkey = registry.localmachine.opensubkey("system\\currentcontrolset\\control\\class\\{4d36e972-e325-11ce-bfc1-08002be10318}\\0012", true); //--->this string change          mac = (string)rkey.getvalue("networkaddress");         rkey.close();         return mac;     } 

this should point in right direction, you're going have figure out code:

  1. look in hkey_local_machine\system\currentcontrolset\services\tcpip\parameters\interfaces\ , you'll see few sub keys corresponding interfaces in "network connections" control panel. 1 have valid ip, , others have 0.0.0.0 you'll need pattern matching figure out 1 right one.
  2. get key name interface (it's guid, or @ least looks one), , go hkey_local_machine\system\currentcontrolset\control\class\{4d36e972-e325-11ce-bfc1-08002be10318} , check each one's netcfginstanceid value (or search) guid of interface.

Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -