Adrive Posted August 17, 2010 Share Posted August 17, 2010 Hello how can we get a number/key of a computer which can never be matched with another one? i was using something like this: $Pc_Info = @ComputerName & @UserName & @CPUArch & @IPAddress1 & @OSType & @OSArch & @OSLang & @OSBuild & @OSVersion $Key = StringSplit(StringUpper(StringRegExpReplace($Pc_Info, "(?i)[^a-z0-9]+", "")), "") but it always gets changed when a new operating system is installed. any ideas? Link to comment Share on other sites More sharing options...
JohnOne Posted August 17, 2010 Share Posted August 17, 2010 There has been some debate whether you can or not, probably best using hardware rather than software for this. Try this UDF http://www.autoitscript.com/forum/index.php?showtopic=29404 AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Spiff59 Posted August 17, 2010 Share Posted August 17, 2010 Using the word "never" is where you get into trouble. A lot of software vendors have gone the hardware-key route. But stick in a bigger hard drive, more memory, or a faster CPU and you'll likely be calling them to reactivate. Link to comment Share on other sites More sharing options...
Richard Robertson Posted August 17, 2010 Share Posted August 17, 2010 The only way to match to a single computer is to have some piece of hardware that cannot be removed from the computer. Considering the number of virtual machines in use, this becomes impossible. Link to comment Share on other sites More sharing options...
BrewManNH Posted August 18, 2010 Share Posted August 18, 2010 Hello how can we get a number/key of a computer which can never be matched with another one? i was using something like this: $Pc_Info = @ComputerName & @UserName & @CPUArch & @IPAddress1 & @OSType & @OSArch & @OSLang & @OSBuild & @OSVersion $Key = StringSplit(StringUpper(StringRegExpReplace($Pc_Info, "(?i)[^a-z0-9]+", "")), "") but it always gets changed when a new operating system is installed. any ideas? Do the computers have serial numbers in BIOS, like Dells/HPs etc.? Use the serial number and then it will only get changed if you have to replace the motherboard and you don't have the option to reset it back. Other than a hardware check there isn't anything that won't ever change by something like an OS install and even with a hardware check, it's going to change if you ever change the hardware. In the computer world, there's nothing permanent. If you keep the computer names from OS version to new OS version, then you have that as something to track, user names/IP Addresses are as changeable as your underwear. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
jchd Posted August 19, 2010 Share Posted August 19, 2010 @Adrive, The problem is that your question is fundamentally ill-posed. If you expect a reasonable answer, then you first have to define "computer". That's where the problem begins. Let's assume that a "computer" consists of a chassis, a power supply, a motherboard, a CPU, memory, HDD, DVD, display, peripherals. Is that the same computer if I change any element in it against another compatible element? What does the "computer" become if I decide to disassemble it and place everyone of its elements into other "computers"? Even if you assume that you can uniquely identify every element with a unique number, which is currently essentially impossible using stock components, the answer to the above questions is the real issue. Now if the software used to check any unique ID is available for an open machine, it will become the weakest link, so you need to protect against that threat as well which is much harder than solving the --already hard-- hardware issue. That raises the question of tamper-resistance, to barr cheating. You quickly end up with unpractical, utterly expensive and proprietary solutions, which are likely to be broken anytime soon if it is worth it. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
spudw2k Posted August 19, 2010 Share Posted August 19, 2010 I'd say a fairly simple way would be to capture the Motherboard Serial, CPU ID, and perhaps and/all MAC addresses on a machine. Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
Dana Posted August 19, 2010 Share Posted August 19, 2010 Many copy protection schemes use the MAC address of the network adapter. Sure, you could move the network card into another computer if it's not part of the motherboard, but is it really an issue? Either way, there's only going to be one network card with that MAC address out of a pool of some 281 trillion possibilities. Sometimes it uses the serial number of the first hard drive in the [extremely unlikely, these days] event that a network adapter isn't found. Link to comment Share on other sites More sharing options...
jchd Posted August 19, 2010 Share Posted August 19, 2010 Most network adapters offer the option to change the MAC address to whatever you want. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
seandisanti Posted August 19, 2010 Share Posted August 19, 2010 Most network adapters offer the option to change the MAC address to whatever you want.and if they don't, madmacs does. i have my mac id's changed at every reboot Link to comment Share on other sites More sharing options...
JohnOne Posted August 19, 2010 Share Posted August 19, 2010 I have used "smac" to change mine on the occaision, its just a couple of clicks. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
seandisanti Posted August 19, 2010 Share Posted August 19, 2010 I have used "smac" to change mine on the occaision, its just a couple of clicks.madmacs is a quick and free, and originally made with autoit if i remember correctly. all it really does is a quick registry edit, but it lets you reset for any or all of your mac id's also which is nice when you're running wireless, lan, etc Link to comment Share on other sites More sharing options...
spudw2k Posted August 19, 2010 Share Posted August 19, 2010 ...i have my mac id's changed at every rebootparanoid much? sounds like a network security admin's nightmare. Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
seandisanti Posted August 19, 2010 Share Posted August 19, 2010 paranoid much? sounds like a network security admin's nightmare.i've been called that before, and paranoid Link to comment Share on other sites More sharing options...
Dana Posted August 24, 2010 Share Posted August 24, 2010 The various means of changing the MAC address don't actually change the MAC address which is burned into the card, only what gets reported to Windows networking. I don't know if a program like a copy protection scheme which relies on hardware would be able to read the true hardware MAC... if it couldn't it would seem to be a pretty big security hole for such programs. -Dana Link to comment Share on other sites More sharing options...
Yashied Posted August 24, 2010 Share Posted August 24, 2010 Look at _WinAPI_UniqueHardwareID() function from WinAPIEx.au3 library. Maybe this is exactly what you want. My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
anixon Posted August 25, 2010 Share Posted August 25, 2010 (edited) Hello how can we get a number/key of a computer which can never be matched with another one? i was using something like this: $Pc_Info = @ComputerName & @UserName & @CPUArch & @IPAddress1 & @OSType & @OSArch & @OSLang & @OSBuild & @OSVersion $Key = StringSplit(StringUpper(StringRegExpReplace($Pc_Info, "(?i)[^a-z0-9]+", "")), "") but it always gets changed when a new operating system is installed. any ideas? I use the following code to create an encryption key ;// Set Default Encryption Key [Machine Specific] Const $WinDirID = "HKLM\SOFTWARE\MICROSOFT\WINDOWS NT\CURRENTVERSION\" Global $uKeyR = RegRead($WinDirID, "InstallDate") ;//User Data Key Extracted from Windows Installation Date ;//Set to Default Key if Installation Date/Time less than 5 Digits If StringLen($uKeyR) < 5 Then $uKeyR = 1196279887 ;//Compile a Unique Encryption Key using Windows Install Date Converted to Num+Asc+Asc+Num] Global $uKey = StringLeft($uKeyR, 1) & Chr(62 + StringLeft($uKeyR, 1) + StringMid($uKeyR, 2, 1) + StringMid($uKeyR, 3, 1)) & _ Chr(94 + StringMid($uKeyR, 4, 1) + StringMid($uKeyR, 5, 1) + StringMid($uKeyR, 6, 1)) & StringRight($uKeyR, 1) I then use the unique key created from the windows install date/time to decrypt a variable stored in an INI file if it does not match the internal const variable then it fails the test which means that the Destop is not the same. Edited August 25, 2010 by anixon Link to comment Share on other sites More sharing options...
Richard Robertson Posted August 25, 2010 Share Posted August 25, 2010 But it would be easy to trick it. Link to comment Share on other sites More sharing options...
spudw2k Posted August 25, 2010 Share Posted August 25, 2010 But it would be easy to trick it.Agreed, a hardware serial is a better choice. Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
LoWang Posted September 3, 2010 Share Posted September 3, 2010 (edited) That's what we use in our company Func getpcserialnumber() ; Generated by AutoIt Scriptomatic $wbemFlagReturnImmediately = 0x10 $wbemFlagForwardOnly = 0x20 $colItems = "" $strComputer = "localhost" $Output="" $Output = $Output & "Computer: " & $strComputer & @CRLF $Output = $Output & "==========================================" & @CRLF $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2") if $objWMIService=0 then ;lognio("ERROR: WMI corrupted on workstation, cannot get the information.") return -1 endif $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_BIOS", "WQL", _ $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj($colItems) then For $objItem In $colItems $serialnumber = $objItem.SerialNumber Next Else $serialnumber=-1 Endif return $serialnumber endfunc Edited September 3, 2010 by LoWang Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now