Jump to content

Nomad Memory doesn't read char


Yorn
 Share

Recommended Posts

Here's the specific code in question and the output of the MsgBox that is created along with Cheat Engine stating quite clearly that there is a value there. Whenever there is a "text" value in cheat engine that I want to read as a char or even as a wchar in AutoIt, it just simply fails to read anything and I don't know why.

I'm not even trying to cheat or anything, just read variables to see if I can have beeps happen when a certain value has changed. There's no pointers involved, all the addresses I want to read are static.

The 0 that shows in the text box is a result of @error being 0 still.

post-26322-1221425390_thumb.jpg

post-26322-1221425400_thumb.jpg

Edited by Yorn
Link to comment
Share on other sites

Here's the specific code in question and the output of the MsgBox that is created along with Cheat Engine stating quite clearly that there is a value there. Whenever there is a "text" value in cheat engine that I want to read as a char or even as a wchar in AutoIt, it just simply fails to read anything and I don't know why.

I'm not even trying to cheat or anything, just read variables to see if I can have beeps happen when a certain value has changed. There's no pointers involved, all the addresses I want to read are static.

The 0 that shows in the text box is a result of @error being 0 still.

I have used NomadMemory functions to read a string from memory in another process without problems so I assume that there is something about the address which is not what you think. What does Text[15] mean? I know nothing about cheat engine but could it be an array of pointers to strings? If so then you need to read the address as an int then use that int as the address to read a string.

$startAddr = 0x024C541C
for $n = 0 to 14
 $Addr = _MemoryRead($startAddr + 32*$n,$handle,"int")
 $test = _MemoryRead($Addr,$handle,"char[256]")
 MsgBox(0,"mem",$test & @error)
next

but this is just guesswork.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

I have used NomadMemory functions to read a string from memory in another process without problems so I assume that there is something about the address which is not what you think. What does Text[15] mean? I know nothing about cheat engine but could it be an array of pointers to strings? If so then you need to read the address as an int then use that int as the address to read a string.

I tried your code, thanks for helping. Still have the same trouble.

It just gave me the errorcode 0 only. Cheat Engine can read this, I think even ArtMoney can read it, but nothing I do makes it actually show up in AutoIT.

Try

$finalADDR = 0x024C541C
that param is a hex number, enclosing in quotes makes it a string.

EDIT:too late

That's a good point, but I still have the same issue, it doesn't actually return anything. I'll look at this again a little later tonight. Any help is greatly appreciated.

Also, if someone knows of a program where reading in a char DOES work, please give it to me and give me an example address to read and I'll make sure it is working right.

Edited by Yorn
Link to comment
Share on other sites

Try

$finalADDR = 0x024C541C
that param is a hex number, enclosing in quotes makes it a string.

EDIT:too late

It's true but it will still work because in AutoIt the value of "0xabcd1234" is 0xabcd1234. I might even have caused the problem myself because I posted a few examples where I used a string like that and maybe that's been copied.

@Yorn

I use NomadMemory to pass strings from one AutoIt script to another and there is no problem at all which is why I am sure that the memory address you have is not simply the address where the string is stored.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Link to comment
Share on other sites

Have you tried changing the memory type? You need it to be something like "Chr(16)" in the read function or you won't get anything.

I have the exact code, exact output, and exact cheat engine reading of the address in the attached images. I think you meant "char(16)" and yes, I do have it.

The thing is, I'm just trying to read ASCII values. Again, if anyone has an example bit of code and executable that works for them when they try to read "char" from memory using NomadMemory I would be thrilled to take a look at it.

Link to comment
Share on other sites

I have the exact code, exact output, and exact cheat engine reading of the address in the attached images. I think you meant "char(16)" and yes, I do have it.

The thing is, I'm just trying to read ASCII values. Again, if anyone has an example bit of code and executable that works for them when they try to read "char" from memory using NomadMemory I would be thrilled to take a look at it.

It's "char[16]" not "chr(16)" and that is for reading a string. If you want to read ASCII values you need to read bytes "byte[16]".

$test = _MemoryRead($Addr,$handle,"byte[8]")
MsgBox(0,"mem","data = 0x" & Hex($test) & @CR & "@error = " &  @error)

There is an example here of a script sending a string and integers to another script using messages and _MemoryRead.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

It's "char[16]" not "chr(16)" and that is for reading a string. If you want to read ASCII values you need to read bytes "byte[16]".

$test = _MemoryRead($Addr,$handle,"byte[8]")
MsgBox(0,"mem","data = 0x" & Hex($test) & @CR & "@error = " &  @error)

There is an example here of a script sending a string and integers to another script using messages and _MemoryRead.

Ahh, ok, that might be worth a shot, I'll try byte[16] and see what happens, you're right, I do simply just want the ASCII characters. Edited by Yorn
Link to comment
Share on other sites

Okay. New plan, I want to search for the word "yorn" that exists SOMEWHERE in memory, i have some code that seems to do this here:

Func _getOffset($hMemory)
    Local $i = 0
    While $i <= 16^4 AND _MemoryRead('0x' & hex($i,4) & '541C',$hMemory,'char[4]') <> "Yorn"
        $i += 1
    WEnd
    Return '0x' & hex($i,4) & '02B4'
EndFunc

How do I modify this function to return the exact address where "Yorn" is found in Memory? Thanks in advance!

Edited by Yorn
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...