kcd-clan Posted July 18, 2006 Share Posted July 18, 2006 (edited) I need to do this fast. So fair iv not even got to finish it cause it takes to long. I know il find a way soon enuff. Heres my code. O yea its not 40 mb its 4 mb but it still takes while. $i=0 $files = FileOpen($location&$file, 0) ; Check if file opened for reading OK If $files = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ; Read in 1 character at a time until the EOF is reached While 1 $i=$i+1 ToolTip("Bytes: "&$i) $chars = FileRead($files,1) If @error = -1 Then ExitLoop $hex=Asc ( $chars ) If $out<>"" Then $out=$out&" "&$hex EndIf If $out="" Then $out=$hex EndIf Wend MsgBox(0,0,$out) FileClose($files) Edited July 18, 2006 by kcd-clan Visit mEMy programs made.Iul - IulG-V Console - G-V Console_RandomLetter - _RandomLetter()Saftey Kill - Saftey Killcolorzone() = colorzone() Link to comment Share on other sites More sharing options...
jvanegmond Posted July 18, 2006 Share Posted July 18, 2006 (edited) FileRead the whole File StringSplit with a '' parameter in delimiters parameter Hex it, and store it as a string with &= Edit: This will take long, no matter what. Only i think my way is the fastest way of doing this.. Edited July 18, 2006 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
evilertoaster Posted July 18, 2006 Share Posted July 18, 2006 (edited) Try opening it in raw mode (4) and then doing FileRead() with no extra paramters. This will load the whole file in one command which is faster than byte by byte Edit: curses...my post was foiled agian Edited July 18, 2006 by evilertoaster Link to comment Share on other sites More sharing options...
kcd-clan Posted July 18, 2006 Author Share Posted July 18, 2006 What is raw mode? Visit mEMy programs made.Iul - IulG-V Console - G-V Console_RandomLetter - _RandomLetter()Saftey Kill - Saftey Killcolorzone() = colorzone() Link to comment Share on other sites More sharing options...
kcd-clan Posted July 18, 2006 Author Share Posted July 18, 2006 And how can i split sring if i dono where im splitting it cep that its ever chr Visit mEMy programs made.Iul - IulG-V Console - G-V Console_RandomLetter - _RandomLetter()Saftey Kill - Saftey Killcolorzone() = colorzone() Link to comment Share on other sites More sharing options...
jvanegmond Posted July 18, 2006 Share Posted July 18, 2006 That is when one is unabled or too lazy too open the helpfile to look up FileOpen.When using the mode=4 (Raw Read) the filename is defined as "\\.\A:" for reading sector on a floppy disk the count must be a multiple of sector size(512).I still don't know what it is though.. github.com/jvanegmond Link to comment Share on other sites More sharing options...
evilertoaster Posted July 18, 2006 Share Posted July 18, 2006 (edited) You need the beta verion of autoit i think for raw mode. When you have it, use file open with a 4 as the second parameter. Edit: also what raw mode does is read direct hex from the file so you won't have to manually convert it later Edited July 18, 2006 by evilertoaster Link to comment Share on other sites More sharing options...
jvanegmond Posted July 18, 2006 Share Posted July 18, 2006 (edited) And how can i split sring if i dono where im splitting it cep that its ever chr In beta this is done by: Dim $result $File = FileRead("C:\File.ext") $SplitFile = StringSplit($File,'') For $x = 0 to $SplitFile[0] $result &= Hex($SplitFile[$x]) Next Edit: Nice thing to know eviltoaster! Thanks. Edited July 18, 2006 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
kcd-clan Posted July 18, 2006 Author Share Posted July 18, 2006 (edited) ......... I dono if its gunna work Edited July 18, 2006 by kcd-clan Visit mEMy programs made.Iul - IulG-V Console - G-V Console_RandomLetter - _RandomLetter()Saftey Kill - Saftey Killcolorzone() = colorzone() Link to comment Share on other sites More sharing options...
evilertoaster Posted July 18, 2006 Share Posted July 18, 2006 (edited) $path=FileOpenDialog("Choose a file",@ScriptDir,"All (*.*)") $File=FileOpen($path,4) $read=FileRead($file,FileGetSize($path)) ;MsgBox(0,"",String($read)) MsgBox(0,"",StringReplace(String($read),"0x","")) This will load a whole file and show it's hex string in a message box. Uncomment the first msgbox if you want the "0x" hex identifier to be there also Edit: BTW there's no error checking on this so dont do anything foolish Edited July 18, 2006 by evilertoaster Link to comment Share on other sites More sharing options...
kcd-clan Posted July 18, 2006 Author Share Posted July 18, 2006 (edited) I dono about you but that dont work for me. It just returnes the value of 0 I need ALL the hex code. And it shows the output of hex not the hex codes.... Edited July 18, 2006 by kcd-clan Visit mEMy programs made.Iul - IulG-V Console - G-V Console_RandomLetter - _RandomLetter()Saftey Kill - Saftey Killcolorzone() = colorzone() Link to comment Share on other sites More sharing options...
evilertoaster Posted July 18, 2006 Share Posted July 18, 2006 are you using the latest beta? Link to comment Share on other sites More sharing options...
kcd-clan Posted July 18, 2006 Author Share Posted July 18, 2006 now i am i just get the text output.... like open with notepad Visit mEMy programs made.Iul - IulG-V Console - G-V Console_RandomLetter - _RandomLetter()Saftey Kill - Saftey Killcolorzone() = colorzone() Link to comment Share on other sites More sharing options...
evilertoaster Posted July 18, 2006 Share Posted July 18, 2006 does that mean you didn't ahve beta before and now you do and it's showing you the 'garbled' text now? Link to comment Share on other sites More sharing options...
kcd-clan Posted July 18, 2006 Author Share Posted July 18, 2006 That ment that i had a older version of beta And still isnt working Visit mEMy programs made.Iul - IulG-V Console - G-V Console_RandomLetter - _RandomLetter()Saftey Kill - Saftey Killcolorzone() = colorzone() Link to comment Share on other sites More sharing options...
evilertoaster Posted July 18, 2006 Share Posted July 18, 2006 Just for clarification- Is it showing you garbled ASCI test or a long hex string? Link to comment Share on other sites More sharing options...
kcd-clan Posted July 18, 2006 Author Share Posted July 18, 2006 ....... I said it show what it would show if you open in notepad. Cause im trying ith a normal text file. It wont even work on a program type file with hex of 00-20 or whatever. Visit mEMy programs made.Iul - IulG-V Console - G-V Console_RandomLetter - _RandomLetter()Saftey Kill - Saftey Killcolorzone() = colorzone() Link to comment Share on other sites More sharing options...
evilertoaster Posted July 18, 2006 Share Posted July 18, 2006 I may be misunderstanding what you want. This will read the raw Hex data from a file (for instance if you opened it in a hex editor) if you use this on a .txt file i dont see what the point is but it should still work (i've now tried this on 3 computers). Is this not want you want? Link to comment Share on other sites More sharing options...
kcd-clan Posted July 18, 2006 Author Share Posted July 18, 2006 no I am geting alot of problems with this il probly ahve to write it all and define all hex values. When im reading hex in autoit it comes to a number when hex go from 0-f and autoit dose 0-9 because a declerations If i have to i can get it cause i have the way to read it and know the number on autoit of the hex code. Visit mEMy programs made.Iul - IulG-V Console - G-V Console_RandomLetter - _RandomLetter()Saftey Kill - Saftey Killcolorzone() = colorzone() Link to comment Share on other sites More sharing options...
evilertoaster Posted July 18, 2006 Share Posted July 18, 2006 When im reading hex in autoit it comes to a number when hex go from 0-f and autoit dose 0-9 because a declerationsIf i have to i can get it cause i have the way to read it and know the number on autoit of the hex code.I can't really tell what you're talking about...anyone want to translate? 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