Tyranna Posted July 24, 2017 Author Share Posted July 24, 2017 (edited) I do not know what is going on. Assuming there is some bug in hex. I use Ptr(MyVar) and everything outputs good. If I use Hex(MyVar) , the first conversion by Hex() works, then I add 1 to MyVar and the Hex(MyVar) outputs garbage. Something is happening in the backgroud with this function that I cannot see. I have spent over 3 days trying to nail this down with no luck whatsoever. Maybe its GOD's way of saying, USE THE POINTER FUNCTION! Edited July 24, 2017 by Tyranna Link to comment Share on other sites More sharing options...
jchd Posted July 24, 2017 Share Posted July 24, 2017 Until you post a short reproducer script, this will remain a mystery. But once you do, if ever, I bet all will clear up quickly. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
Tyranna Posted July 24, 2017 Author Share Posted July 24, 2017 (edited) This reads process memory , there is no real way to give you a 'short' reproducer script. I could give you a barebones version of what this is doing, but you would have to map it to some running process on your end and test it that way. Ill attach just in case... Script.rar Edited July 24, 2017 by Tyranna Link to comment Share on other sites More sharing options...
Tyranna Posted July 26, 2017 Author Share Posted July 26, 2017 A new development... Replacing: $MEMOUT &= " " & Hex( $CurrentMemorySearchAddress ) & " | " with: $MEMOUT &= " " & Hex( Int( $CurrentMemorySearchAddress) ) & " | " makes the output good again. Who can tell me why? Link to comment Share on other sites More sharing options...
czardas Posted July 26, 2017 Share Posted July 26, 2017 (edited) $CurrentMemorySearchAddress would appear not to be an integer data type. Converting the data gives you the output you expect. Whatever process created the variable $CurrentMemorySearchAddress holds all the clues as to how this situation occured. If the variable was a float, then you will get a completely different output: 1 = 1.0 Hex(1) <> Hex(1.0) Edit: Didn't notice the first page. LOL Edited July 26, 2017 by czardas operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Tyranna Posted July 26, 2017 Author Share Posted July 26, 2017 This variable is totally contained within the output subroutine. no declaration of any kind anywhere else. My script passes $MemorySearchAddress to the sub DisplayMemory( $MEMIN , $MemorySearchAddress ) then the output sub is: DisplayMemory( $MEMIN , $CurrentSerachAddress ) all instances of $CurrentSearchAddress are in here. EndFunc Link to comment Share on other sites More sharing options...
czardas Posted July 26, 2017 Share Posted July 26, 2017 12 minutes ago, Tyranna said: no declaration of any kind anywhere else It had to have come from somewhere. You should follow through with @RTFC's advice. Check the variable type with VarGetType(). It may be being corrupted somewhere, or originally different to what you expected. operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Tyranna Posted July 26, 2017 Author Share Posted July 26, 2017 The var is created when passed to the output subroutine. The variables first instance is a parameter of the DisplayMemory() function. Ex: DisplayMemory( $MEMIN , $CurrentSerachAddress ) all instances of $CurrentSearchAddress are in here. EndFunc Link to comment Share on other sites More sharing options...
czardas Posted July 26, 2017 Share Posted July 26, 2017 (edited) I'm sorry; I don't understand. The code you have posted will throw errors. You have two instances of $CurrentSerachAddress: one local and the other one global [edit: might have had something to do with it]. There isn't enough information here to solve this. Edited July 26, 2017 by czardas operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Tyranna Posted July 26, 2017 Author Share Posted July 26, 2017 Nope, it is just as described. I used that VarGetType() , and it comes in as a string, and then, when the addition is used on it, it is converted to a Double. Link to comment Share on other sites More sharing options...
Tyranna Posted July 26, 2017 Author Share Posted July 26, 2017 I wish I could just declare my variables as type Link to comment Share on other sites More sharing options...
czardas Posted July 26, 2017 Share Posted July 26, 2017 Variables are indeed created as empty strings if not assigned any original value (perhaps contraversial). For it to be an integer type, it would have to be assigned an integer value ($eg = 0). This is why Hex produces a different output, but it isn't entirely clear to me how this code (or Hex for that matter) is meant to behave. operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Tyranna Posted July 26, 2017 Author Share Posted July 26, 2017 So, I declared the variable global up top and set it to zero, and it produces garbage still. Link to comment Share on other sites More sharing options...
Tyranna Posted July 26, 2017 Author Share Posted July 26, 2017 its still coming as a string and then beeing converter to a double Link to comment Share on other sites More sharing options...
czardas Posted July 26, 2017 Share Posted July 26, 2017 Yeah, Hex sees an empty string as garbage ==> 00000000! Conversion to double? It seems you have solved the mystery and found the solution already. operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Tyranna Posted July 26, 2017 Author Share Posted July 26, 2017 but i want it to come into my sub as a specific type! Link to comment Share on other sites More sharing options...
czardas Posted July 26, 2017 Share Posted July 26, 2017 Can't you simply add $CurrentSearchAddress = Int($CurrentSearchAddress) as the first line of your DisplayMemory() function? operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Tyranna Posted July 26, 2017 Author Share Posted July 26, 2017 i can, lol. seems a little redundant... czardas 1 Link to comment Share on other sites More sharing options...
czardas Posted July 26, 2017 Share Posted July 26, 2017 Then do that! operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Tyranna Posted July 26, 2017 Author Share Posted July 26, 2017 thx 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