Alpino Posted August 13, 2013 Share Posted August 13, 2013 the problem is : I put the HWID generated in my website (hwid.txt), but the script does not read the HWID text , and get the error HWID Not Found , Any fix? thx #include <Inet.au3> #include <Array.au3> #include <String.au3> MsgBox(4096, '', 'HWID: ' & _HWID()) Local $sHWID = _HWID() If _GetHWID($sHWID) Then MsgBox(4096, '', 'HWID Found.') Else MsgBox(4096, '', 'HWID Not Found.') ProcessClose ( "Program.exe" ) ProcessClose ( "Program2.exe" ) EndIf Func _GetHWID($sHWID) Local $aArray = StringSplit(StringToBinary(InetRead('http://XXX/hwid.txt')), @LS) If @error Then Return SetError(1, 0, 0) EndIf Return _ArraySearch($aArray, $sHWID) > -1 EndFunc ;==>_GetHWID Func _HWID() Local $sOSDrive = StringLeft(@SystemDir, 3) Local $sHWID = '0' & @CPUArch & @KBLayout & DriveGetSerial(@HomeDrive) & StringUpper(DriveGetType($sOSDrive)) & DriveSpaceTotal($sOSDrive) $sHWID = StringMid($sHWID, Round(StringLen($sHWID) / 2), Round(StringLen($sHWID) / 2)) $sHWID = _StringReverse($sHWID) Return $sHWID EndFunc ;==>_HWID Link to comment Share on other sites More sharing options...
0xdefea7 Posted August 13, 2013 Share Posted August 13, 2013 (edited) This might be your issue: Local $aArray = StringSplit(StringToBinary(InetRead('http://XXX/hwid.txt')), @LS) Should be @LF not @LS. Unless for some reason that you have a "@LS" delimiter in there. Edit: Local $aArray = StringSplit(BinaryToString(InetRead('http://xxx/HWID.txt')), @LF) I think you want to do it that way to read the file as if it was opened in notepad. You can change to binary in a loop later line by line if you need to. Edited August 13, 2013 by 0xdefea7 Link to comment Share on other sites More sharing options...
kylomas Posted August 13, 2013 Share Posted August 13, 2013 'http://XXX/hwid.txt' This is your Web site? Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
0xdefea7 Posted August 13, 2013 Share Posted August 13, 2013 (edited) This is your Web site? http://xxx/HWID.txt I found that it was NSFW, so I decided to use another site for my testing Edited August 13, 2013 by 0xdefea7 Link to comment Share on other sites More sharing options...
Alpino Posted August 13, 2013 Author Share Posted August 13, 2013 (edited) This might be your issue: Local $aArray = StringSplit(StringToBinary(InetRead('http://XXX/hwid.txt')), @LS) Should be @LF not @LS. Unless for some reason that you have a "@LS" delimiter in there. Edit: Local $aArray = StringSplit(BinaryToString(InetRead('http://xxx/HWID.txt')), @LF) I think you want to do it that way to read the file as if it was opened in notepad. You can change to binary in a loop later line by line if you need to. Thx for reply , but same problem , is not working , HWID not found :/ Edited August 13, 2013 by Alpino Link to comment Share on other sites More sharing options...
JohnOne Posted August 13, 2013 Share Posted August 13, 2013 Because there are no deliminators found in the string to split. 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...
Alpino Posted August 13, 2013 Author Share Posted August 13, 2013 Because there are no deliminators found in the string to split. and what is the right solution?. Link to comment Share on other sites More sharing options...
kylomas Posted August 13, 2013 Share Posted August 13, 2013 Alpino, I don't think you are getting anything from the inetget. Hence my earlier question This is your Web site? Can you post a sample of HWID.txt? kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
0xdefea7 Posted August 13, 2013 Share Posted August 13, 2013 What does your output look like when you are reading it? Use ConsoleWrite() then check against your $HWID value. Link to comment Share on other sites More sharing options...
Alpino Posted August 13, 2013 Author Share Posted August 13, 2013 What does your output look like when you are reading it? Use ConsoleWrite() then check against your $HWID value. Thx , now is working , i change Func _GetHWID($sHWID) Local $aArray = StringSplit(StringToBinary(InetRead('http://XXX/hwid.txt')), @LS) If @error Then Return SetError(1, 0, 0) EndIf Return _ArraySearch($aArray, $sHWID) > -1 EndFunc ;==>_GetHWID to : Func _GetHWID($sHWID) Local $aArray = StringSplit (BinaryToString(InetRead('http://MywebPage.com/hwid.txt')), @LF) Return _ArraySearch($aArray, $sHWID) > -1 ConsoleWrite($sHWID) EndFunc ;==>_GetHWID Link to comment Share on other sites More sharing options...
JohnOne Posted August 13, 2013 Share Posted August 13, 2013 Because, you removed error checking. That error checking was telling you there were no line feeds in the string. #include <Array.au3> _GetHWID("Line") Func _GetHWID($sHWID) Local $aArray = StringSplit("Myhwidisthiswithnolinefeeddelininators", @LF) If @error Then MsgBox(0,"Error","No @LF found to split at") EndIf _ArrayDisplay($aArray) Return _ArraySearch($aArray, $sHWID) > -1 EndFunc ;==>_GetHWID 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...
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