ancp Posted February 17, 2007 Share Posted February 17, 2007 First, sorry for my bad english. Can anybody help me with this problem? I need read part of strings between specific hex char from few big files (more than 1GB). e.g.: i need get strings between A7 23 01 01 22 ... and ... A7 23 01 02 hex part. How find (get position) first part (A7 23 01 01 22)? Thanks for help! Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted February 17, 2007 Moderators Share Posted February 17, 2007 Had you looked at _StringBetween()?... and I'm sure it wouldn't have spaces . Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
ancp Posted February 17, 2007 Author Share Posted February 17, 2007 Had you looked at _StringBetween()?... and I'm sure it wouldn't have spaces .SmOke_N, thanks for reply, but...My problem is that i don't know how to search bin data How to obtain first (and next) occurrence specified hex values from bin data?Is FileRead a convert from bin to hex right way? Because, searched files is very long (e.g. 3,6GB) and read file per line is very slow or not? Further, lenght of searched string can be more than on 1 line. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted February 17, 2007 Moderators Share Posted February 17, 2007 SmOke_N, thanks for reply, but...My problem is that i don't know how to search bin data How to obtain first (and next) occurrence specified hex values from bin data?Is FileRead a convert from bin to hex right way? Because, searched files is very long (e.g. 3,6GB) and read file per line is very slow or not? Further, lenght of searched string can be more than on 1 line.There's nothing that's going to read 3.6 gb fast like you want it in AutoIt... that's kind of rediculous... what is it a couple of movies? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
ancp Posted February 17, 2007 Author Share Posted February 17, 2007 (edited) ...what is it a couple of movies?map file (img file). I need fast obtain any info from this file. Edited February 17, 2007 by ancp Link to comment Share on other sites More sharing options...
ancp Posted February 18, 2007 Author Share Posted February 18, 2007 ok, i tried write this, but is this right way for big files? Dim $file, $hexstr, $result Dim $pos, $mytmp $file = FileOpen("C:\mpdd.ig", 0) $hexstr = "A723010122" ; find 14 chars after this hexadecimal ; convert all from bin to hex $mytmp = Hex(BinaryString(FileRead($file))) $mytmp = BinaryString($mytmp) $mytmp = String($mytmp) ; position after hexstr $pos = StringInStr ($mytmp, $hexstr) + StringLen($hexstr) ; get next 14 chars $myvalue = StringMid ($mytmp, $pos, 14) $result = ConvertHexToString($myvalue) MsgBox (0, "",$result) FileClose($file) ; Converting from hexadecimal to string Func ConvertHexToString($myHex) Local $i, $myText="", $mytmp For $i=1 to StringLen($myHex) Step 2 $mytmp = Dec(StringMid ($myHex, $i ,2)) $mytmp = Chr($mytmp) $myText = $myText & $mytmp Next Return $myText EndFunc Link to comment Share on other sites More sharing options...
Seagul Posted February 18, 2007 Share Posted February 18, 2007 cant you just use some sort of memory patcher? Link to comment Share on other sites More sharing options...
ancp Posted February 18, 2007 Author Share Posted February 18, 2007 (edited) cant you just use some sort of memory patcher?Sort of memory patcher? Sorry, i don't understant... What do you mean by it? ... However, when i apply my script (above) to large file, my memory collapsing. This my script isn't useful Edited February 18, 2007 by ancp 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