Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

_UniCode UDF


  • Please log in to reply
11 replies to this topic

#1 Daniel W.

Daniel W.

    I hacked 127.0.0.1 !!!

  • Active Members
  • PipPipPipPipPipPip
  • 434 posts

Posted 21 June 2006 - 04:20 PM

Hi,

i wrote this function to get a unique code of a pc.
Updated it and changed the name :D
Here is the code:

AutoIt         
Func _UniquePCCode()     Local $return , $first     Local $pass = @ComputerName     $encrypt = _Stringencrypt( 1 , $pass , $pass ) & @OSLang & @OSTYPE & @OSVersion & @OSServicePack & DriveGetSerial("C:\")     $split = StringSplit( $encrypt , "a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z" )     For $a = 1 to $split[0]         For $b = 65 to 90             If StringInStr( $split[$a] , Chr($B) ) Then                 $split[$a] = StringReplace( $split[$a] , Chr($B), $b )             EndIf         Next         $first &= $split[$a]     Next     StringStripWS( $first , 8 )     $split1 = StringSplit( $first , "_" )     For $d = 1 to $split1[0]         $return &= $split[$d]     Next     $return = StringMid(  $return ,  StringLen( $return ) / 2 - 3 , 8 )     $second = Hex($return)     $return = ""     $split = StringSplit( $second , "a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z" )     For $a = 1 to $split[0]         For $b = 65 to 90             If StringInStr( $split[$a] , Chr($B) ) Then                 $split[$a] = StringReplace( $split[$a] , Chr($B), $b )             EndIf         Next         $return &= $split[$a]     Next     $return = StringMid(  $return ,  StringLen( $return ) / 2 - 3 , 8 )     Return $return EndFunc   ;==>_UniquePCCode


Note you need _stringencrypt from string.au3 for it.

Regards

Edited by Daniel W., 30 June 2006 - 04:38 PM.

--------------------------------------------------------------------------------------------------------------------------------Scripts : _Encrypt UDF_UniquePCCode UDF MS like calculatorInstall programm *UPDATED* --------------------------------------------------------------------------------------------------------------------------------

Have you ever tried surfing the internet with a milk-carton ?This is similar to what you're trying to do.








#2 Valik

Valik

    Former developer.

  • Active Members
  • PipPipPipPipPipPip
  • 18,879 posts

Posted 21 June 2006 - 04:44 PM

That's a terribly mis-leading name since there already is a term "unicode" in computing.

#3 Daniel W.

Daniel W.

    I hacked 127.0.0.1 !!!

  • Active Members
  • PipPipPipPipPipPip
  • 434 posts

Posted 21 June 2006 - 04:58 PM

narg is this a problem?
I can change the name if you want but i though unicode for uniquecode is no problem...
--------------------------------------------------------------------------------------------------------------------------------Scripts : _Encrypt UDF_UniquePCCode UDF MS like calculatorInstall programm *UPDATED* --------------------------------------------------------------------------------------------------------------------------------

Have you ever tried surfing the internet with a milk-carton ?This is similar to what you're trying to do.


#4 Valik

Valik

    Former developer.

  • Active Members
  • PipPipPipPipPipPip
  • 18,879 posts

Posted 22 June 2006 - 06:12 AM

So you need me to coerce you into changing the name? The fact that the term has a previous and highly widespread (as in global) definition is not a sufficient reason to stop using the term out of context?

#5 Daniel W.

Daniel W.

    I hacked 127.0.0.1 !!!

  • Active Members
  • PipPipPipPipPipPip
  • 434 posts

Posted 30 June 2006 - 04:00 PM

I updated it and changed the name
--------------------------------------------------------------------------------------------------------------------------------Scripts : _Encrypt UDF_UniquePCCode UDF MS like calculatorInstall programm *UPDATED* --------------------------------------------------------------------------------------------------------------------------------

Have you ever tried surfing the internet with a milk-carton ?This is similar to what you're trying to do.


#6 JSThePatriot

JSThePatriot

    carpe diem. vita brevis.

  • MVPs
  • 3,692 posts

Posted 30 June 2006 - 04:08 PM

I noticed you are trimming white space " " using StringReplace(). Maybe you could try to use StringTrimWS() as it may be slightly faster.

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)


#7 Daniel W.

Daniel W.

    I hacked 127.0.0.1 !!!

  • Active Members
  • PipPipPipPipPipPip
  • 434 posts

Posted 30 June 2006 - 04:22 PM

Done :D Thanks for the tip
--------------------------------------------------------------------------------------------------------------------------------Scripts : _Encrypt UDF_UniquePCCode UDF MS like calculatorInstall programm *UPDATED* --------------------------------------------------------------------------------------------------------------------------------

Have you ever tried surfing the internet with a milk-carton ?This is similar to what you're trying to do.


#8 JSThePatriot

JSThePatriot

    carpe diem. vita brevis.

  • MVPs
  • 3,692 posts

Posted 30 June 2006 - 04:26 PM

Done :D Thanks for the tip


NP Glad I could offer some possible help.

I havent seen anything else yet that may help.

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)


#9 Daniel W.

Daniel W.

    I hacked 127.0.0.1 !!!

  • Active Members
  • PipPipPipPipPipPip
  • 434 posts

Posted 30 June 2006 - 04:39 PM

Shortened again :D

Replaced this:
  Do            $return = StringTrimLeft( $return , 1 )            If StringLen( $return ) > 8 Then                 $return = StringTrimRight( $return , 1 )            EndIf       Until StringLen( $return ) = 8 ƒo݊÷ Ùh­†Øb±«­¢+Ø(˜ŒÀÌØíɕÑÕɸ€ôMÑÉ¥¹5¥ €€˜ŒÀÌØíɕÑÕɸ€°€MÑÉ¥¹1•¸ €˜ŒÀÌØíɕÑÕɸ€¤€¼€È€´€Ì€°€à€¤

Edited by Daniel W., 30 June 2006 - 04:40 PM.

--------------------------------------------------------------------------------------------------------------------------------Scripts : _Encrypt UDF_UniquePCCode UDF MS like calculatorInstall programm *UPDATED* --------------------------------------------------------------------------------------------------------------------------------

Have you ever tried surfing the internet with a milk-carton ?This is similar to what you're trying to do.


#10 ReaImDown

ReaImDown

    Slacker

  • Active Members
  • PipPipPipPipPipPip
  • 557 posts

Posted 18 December 2007 - 06:42 PM

nice work guys, I like it, this will come in handy

Edited by ReaImDown, 18 December 2007 - 06:42 PM.

~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs

#11 Xenobiologist

Xenobiologist

    Xx Code~Mega xX

  • MVPs
  • 4,856 posts

Posted 18 December 2007 - 10:22 PM

Hi,

shortened a little bit and made it useable even if there is no drive c:\

AutoIt         
Func _UniquePCCode1()     Local $return, $first     $split = StringSplit(_StringEncrypt(1, @ComputerName, @ComputerName) & _             @OSLang & @OSTYPE & @OSVersion & @OSServicePack & DriveGetSerial(StringLeft(@WindowsDir, 3)), _             "a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z")     For $a = 1 To $split[0]         For $b = 65 To 90             If StringInStr($split[$a], Chr($B)) Then                 $split[$a] = StringReplace($split[$a], Chr($B), $B)             EndIf         Next         $first &= $split[$a]     Next     $split1 = StringSplit(StringStripWS($first, 8), "_")     For $d = 1 To $split1[0]         $return &= $split[$d]     Next     $split = StringSplit(Hex(StringMid($return, StringLen($return) / 2 - 3, 8)), _             "a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z")     $return = ''     For $a = 1 To $split[0]         For $b = 65 To 90             If StringInStr($split[$a], Chr($B)) Then                 $split[$a] = StringReplace($split[$a], Chr($B), $B)             EndIf         Next         $return &= $split[$a]     Next     Return StringMid($return, StringLen($return) / 2 - 3, 8) EndFunc   ;==>_UniquePCCode1


So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files *new

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times


#12 ReaImDown

ReaImDown

    Slacker

  • Active Members
  • PipPipPipPipPipPip
  • 557 posts

Posted 19 December 2007 - 11:24 PM

Hi,

shortened a little bit and made it useable even if there is no drive c:\

AutoIt         
Func _UniquePCCode1()     Local $return, $first     $split = StringSplit(_StringEncrypt(1, @ComputerName, @ComputerName) & _             @OSLang & @OSTYPE & @OSVersion & @OSServicePack & DriveGetSerial(StringLeft(@WindowsDir, 3)), _             "a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z")     For $a = 1 To $split[0]         For $b = 65 To 90             If StringInStr($split[$a], Chr($B)) Then                 $split[$a] = StringReplace($split[$a], Chr($B), $B)             EndIf         Next         $first &= $split[$a]     Next     $split1 = StringSplit(StringStripWS($first, 8), "_")     For $d = 1 To $split1[0]         $return &= $split[$d]     Next     $split = StringSplit(Hex(StringMid($return, StringLen($return) / 2 - 3, 8)), _             "a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z")     $return = ''     For $a = 1 To $split[0]         For $b = 65 To 90             If StringInStr($split[$a], Chr($B)) Then                 $split[$a] = StringReplace($split[$a], Chr($B), $B)             EndIf         Next         $return &= $split[$a]     Next     Return StringMid($return, StringLen($return) / 2 - 3, 8) EndFunc   ;==>_UniquePCCode1


So long,

Mega


even better, lol
~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users