Jump to content

Strange output from Hex() Function


Recommended Posts

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 by Tyranna


 

Link to comment
Share on other sites

  • Replies 45
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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 here
RegExp tutorial: enough to get started
PCRE 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

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 by Tyranna


 

Link to comment
Share on other sites

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

$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 by czardas
Link to comment
Share on other sites

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

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.

Link to comment
Share on other sites

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

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 by czardas
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...