Unc3nZureD Posted December 21, 2010 Share Posted December 21, 2010 Hello. I tried to use the FileRead & FileReadLine but i failed somewhere. So the Code: expandcollapse popup$DLL = FileExists(@ScriptDir & "/Base.dll") If $DLL = 0 Then Msgbox(0, "Security!", "Please do not delete or change the Base.dll !") $answ = Msgbox(36, "Security!", "Do you want to download the original Base.dll ?") If $answ = 6 Then Local $hDownload = InetGet("An URL address - currently not uploaded", @ScriptDir & "Base.dll", 1, 1) Do Sleep(250) Until InetGetInfo($hDownload, 2) Local $nBytes = InetGetInfo($hDownload, 0) InetClose($hDownload) If $answ = 7 Then Msgbox(48, "Security!", "^ERROR") exit 0 EndIf EndIf EndIf msgbox(0,"", $DLL) $Check = FileReadLine(@ScriptDir & "/Base.dll") If $Check Not = "Created by: [Unc3nZureD]" Then Msgbox(0, "DLL Guard!", "Please do not delete or change the Base.dll !") $answ = Msgbox(36, "DLL Guard!", "Do you want to download the original Base.dll ?") If $answ = 6 Then Local $hDownload = InetGet("An URL address - currently not uploaded", @ScriptDir & "Base.dll", 1, 1) Do Sleep(250) Until InetGetInfo($hDownload, 2) Local $nBytes = InetGetInfo($hDownload, 0) InetClose($hDownload) Sleep(500) If $answ = 7 Then Msgbox(48, "DLL Guard!", "^ERROR") exit 0 EndIf EndIf EndIf msgbox(0,"",$Check) msgbox(0,"","DONE") To edit Base.dll , just open with a simple notepad and read the 1st line. It can find the file and able to read the 1st line but it says: "Created by: [unc3nZureD]" = "What The Hell??!!" Why?Base.dll Link to comment Share on other sites More sharing options...
ZacUSNYR Posted December 21, 2010 Share Posted December 21, 2010 Are you opening/closing the file? Link to comment Share on other sites More sharing options...
Unc3nZureD Posted December 21, 2010 Author Share Posted December 21, 2010 What do u mean? It isn't opened when I run it. Link to comment Share on other sites More sharing options...
bogQ Posted December 21, 2010 Share Posted December 21, 2010 Look at the example on FileReadLineand youl see $file = FileOpen("test.txt", 0) look under FileReadLine second parametar and youl see "[, line] )"Look under FileReadLine first parametar and youl see that there isnt any line telling you that first parametar is file pathThe handle of a file, as returned by a previous call to FileOpen. Alternatively you may use a string filename as the first parameter. TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
Unc3nZureD Posted December 21, 2010 Author Share Posted December 21, 2010 But it says: "If no line number to read is given, the "next" line will be read. ("Next" for a newly opened file is initially the first line.)" But I will try to write 1 as line. Link to comment Share on other sites More sharing options...
Unc3nZureD Posted December 21, 2010 Author Share Posted December 21, 2010 Don't know why If i start the script it accept the "Created by: [unc3nZureD]" = "What The Hell??!!" and don't give my the choosing msgbox. Link to comment Share on other sites More sharing options...
BrewManNH Posted December 21, 2010 Share Posted December 21, 2010 The only thing I can see happening is that it's reading the first line of the dll and that first line says What The Hell??!!. I opened your dll file in notepad, and that is what the first line of the file says. The only things wrong with your code are You have the Not command after the $Check variable, and that's wrong, it has to be before it In the same line, you are looking for the words "Created by: [unc3nZureD]" in the first line of the dll, and that's not what's in the first line of the dll, so that check will always be that $Check does not equal "Created by: [unc3nZureD]". You can modify it so that the check will fail correctly by changing the If Not $Check = "Created by: [unc3nZureD]" to If $Check <> "Created by: [unc3nZureD]" then. 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...
sleepydvdr Posted December 21, 2010 Share Posted December 21, 2010 (edited) Why not do a checksum check instead of reading a single line from the file? ETA: In case it interests you: Edited December 21, 2010 by sleepydvdr #include <ByteMe.au3> Link to comment Share on other sites More sharing options...
Unc3nZureD Posted December 21, 2010 Author Share Posted December 21, 2010 Why not do a checksum check instead of reading a single line from the file?ETA: In case it interests you:Wow, MD5 will be great, but a bit hard I think the LineCheck will be enough Easy, simple, and a bit safe Thanks everything Link to comment Share on other sites More sharing options...
Unc3nZureD Posted December 22, 2010 Author Share Posted December 22, 2010 (edited) I have another problem If $DLL = 0 Then Msgbox(0, "CoD 4 _ ESP-box [by Unc3nZureD]", "Please do not delete or change the Hook.dll !") $answ = Msgbox(36, "CoD 4 _ ESP-box [by Unc3nZureD]", "Do you want to download the original Hook.dll ?") If $answ = 6 Then Local $hDownload = InetGet("http://WarningHOOK.yolasite.com/resources/Hook.res", @ScriptDir & "Hook.dll", 1, 1) Do Sleep(250) Until InetGetInfo($hDownload, 2) Local $nBytes = InetGetInfo($hDownload, 0) InetClose($hDownload) If $answ = 7 Then Msgbox(48, "WarningHOOK", "^ERROR") exit 0 EndIf EndIf EndIf When I Press NO Then it continues the script. (Same at the 2nd part of the script) Why? the Help file says: Button Pressed Return Value OK 1 CANCEL 2 ABORT 3 RETRY 4 IGNORE 5 YES 6 NO 7 TRY AGAIN ** 10 CONTINUE ** 11 So : If $answ = 7 Then msgbox(0,"","asd") exit 0 But it isn't detect it I tried to put this: msgbox(0,"",$answ) After the Yes/No. I pressed no and the answ was 7. So it's 7. Then why 7 don't = with 7 ? Edited December 22, 2010 by Unc3nZureD Link to comment Share on other sites More sharing options...
Developers Jos Posted December 22, 2010 Developers Share Posted December 22, 2010 proper formatting tells a 1000 words: If $DLL = 0 Then MsgBox(0, "CoD 4 _ ESP-box [by Unc3nZureD]", "Please do not delete or change the Hook.dll !") $answ = MsgBox(36, "CoD 4 _ ESP-box [by Unc3nZureD]", "Do you want to download the original Hook.dll ?") If $answ = 6 Then Local $hDownload = InetGet("http://WarningHOOK.yolasite.com/resources/Hook.res", @ScriptDir & "Hook.dll", 1, 1) Do Sleep(250) Until InetGetInfo($hDownload, 2) Local $nBytes = InetGetInfo($hDownload, 0) InetClose($hDownload) If $answ = 7 Then MsgBox(48, "WarningHOOK", "^ERROR") Exit 0 EndIf EndIf EndIf SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Unc3nZureD Posted December 22, 2010 Author Share Posted December 22, 2010 (edited) damn, sorry wrong script. I did that for another program, but i want the same security The other one: $DLL = FileExists(@ScriptDir & "/Base.dll") If $DLL = 0 Then Msgbox(0, "Security!", "Please do not delete or change the Base.dll !") $answ = Msgbox(36, "Security!", "Do you want to download the original Base.dll ?") If $answ = 6 Then Local $hDownload = InetGet("An URL address - currently not uploaded", @ScriptDir & "Base.dll", 1, 1) Do Sleep(250) Until InetGetInfo($hDownload, 2) Local $nBytes = InetGetInfo($hDownload, 0) InetClose($hDownload) If $answ = 7 Then Msgbox(48, "Security!", "^ERROR") exit 0 EndIf EndIf EndIf Edited December 22, 2010 by Unc3nZureD Link to comment Share on other sites More sharing options...
Developers Jos Posted December 22, 2010 Developers Share Posted December 22, 2010 damn, sorry wrong script. I did that for another program, but i want the same securityof courseI have given the answer any ways so better now stick to our policies here. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Recommended Posts