Jump to content
Sign in to follow this  
AwAke

Memory Address, What type of memory.

Recommended Posts

AwAke

Ok so im using cheatengine to pick up memory addresses in wow.

Now the problem that I face is;

$Value = _MemoryRead(0x1B52BE68, $DllInformation, "<HERE>")

The value type in cheatengine to find the value is 'Text' and not 4 Bytes (which is default).

So im asking what would I fill in that space, what type am is it as if I put text in it doesnt work.

Thanks, all the help is appreciated.

Share this post


Link to post
Share on other sites
Fend

Char[]

should do the trick


I like cookies?

Share this post


Link to post
Share on other sites
AwAke

Uhm nope, perhaps its my code? eitherway it just returns an error. My code is;

#Include <Memory1.au3>
Opt("WinTitleMatchMode", 4)
Global $ProcessID = WinGetProcess("classname=GxWindowClassD3d","")
If $ProcessID = -1 Then
    MsgBox(4096, "ERROR", "Failed to detect process.")
    Exit
EndIf

If Not IsAdmin() Then
    Msgbox(4096, "Administrative Rights", "You do not have administrative rights.")
EndIf

$PlayerHP = Read_WoW_Memory()
MsgBox(0, "HP", $PlayerHP)

Func Read_WoW_Memory()
    Local $Value
    Local $DllInformation = _MemoryOpen($ProcessID)
    If @Error Then
        MsgBox(4096, "ERROR", "Failed to open memory.")
        Exit
    EndIf
   
    $Value = _MemoryRead(0x1B52BE68, $DllInformation, 'char[]')
    If @Error Then
        MsgBox(4096, "ERROR", "Failed to read memory.")
        Exit
    EndIf
   
    _MemoryClose($DllInformation)
    If @Error Then
        MsgBox(4096, "ERROR", "Failed to close memory.")
        Exit
    EndIf
   
    Return $Value
EndFunc

Share this post


Link to post
Share on other sites
Fend

I dont play wow, but it strikes me as odd that the game would store HP in a string. normally it would be $Value = _MemoryRead(0x1B52BE68, $DllInformation)

If you are sure the value is a string then try stating the size char[8] or whatever. If it is ascii then try byte[8]or whatever size you expect...I am at work or I would test out a few things on some games.

On a side note, I have read that for wow you need to setPriviledge, SetPrivilege("SeDebugPrivilege", 1)

Also have you tested that WinGetProcess("classname=GxWindowClassD3d","") is giving you what you need as far as your process?

Edited by Fend

I like cookies?

Share this post


Link to post
Share on other sites
AwAke

Thanks for the reply, the thing that was causing my problem was WoW protects memory reading and writing and therefore you need a program to get around this.

The program im using is PermEdit and its doing a great job, so now I can succusfully read memorys :)

Thanks for your help anyway, I appreciate it.

Share this post


Link to post
Share on other sites
Szhlopp

Thanks for the reply, the thing that was causing my problem was WoW protects memory reading and writing and therefore you need a program to get around this.

The program im using is PermEdit and its doing a great job, so now I can succusfully read memorys :)

Thanks for your help anyway, I appreciate it.

He is right, it is the "char" type. However you need to supply it a length:

MsgBox(0, "", $Value = _MemoryRead(0x009BC5F0, $DllInformation, "char[10]"))

Hope that helps,

Szhlopp

Share this post


Link to post
Share on other sites
AwAke

Szhlopp do you have experience in Lua/Xml? Ive been reading around on how to get the rotation of your character and have come across.

http://www.wowwiki.com/GetPlayerBearing

I was wondering and if you dont mind helping me, how would I go around making this into an addon. With the most simplistic interface so I can simply read from it

to get the rotation of my character on any given time.

I took a look at Malu05 however his way is far beyond my expertise so with making this an addon I could simply read from it which would be easier for me.

Thanks for your time to help.

Share this post


Link to post
Share on other sites
AwAke

Unless there is an easier way on how I can sort out the rotation? All help is appreciated.

Thanks in advance :)

Share this post


Link to post
Share on other sites
JRowe

Probably a float, either from 0 to 360 or from -180 to 180. Both everquest 1 and 2 used that method, along with shadowbane and guildwars.

So search for a float, between 0 and 360, and do search/filter routines on your character, doing rotations between filters.

So... find the pertinent offsets for your character (health, mana, stamina, locX,Y, orientation, faction values, agro, entity ID, target ID) and then find a single offset and pointer for another entity. Apply the rest of your offsets to the pointer for the other entity, and if they work, you don't have to spend all that time trying to find offsets for NPCs and other characters.

Also, most games use floats for a majority of their data, so try searching with data type Floating Point on values representing hitpoints, mana, damage, and so on. For indexes, or values that an engine would use to represent an entity, use 4 bytes.

Share this post


Link to post
Share on other sites
AwAke

Thanks for the reply Jrowe, it was exactly what I needed. Most of the values I use atm is text, as I find them almost instantly as im using addons such as xperl.

Thanks for your help mate :)

Share this post


Link to post
Share on other sites
AwAke

Probably a float, either from 0 to 360 or from -180 to 180. Both everquest 1 and 2 used that method, along with shadowbane and guildwars.

So search for a float, between 0 and 360, and do search/filter routines on your character, doing rotations between filters.

So... find the pertinent offsets for your character (health, mana, stamina, locX,Y, orientation, faction values, agro, entity ID, target ID) and then find a single offset and pointer for another entity. Apply the rest of your offsets to the pointer for the other entity, and if they work, you don't have to spend all that time trying to find offsets for NPCs and other characters.

Also, most games use floats for a majority of their data, so try searching with data type Floating Point on values representing hitpoints, mana, damage, and so on. For indexes, or values that an engine would use to represent an entity, use 4 bytes.

Uhm ok nevermind, so I was in college when I read it and thought yeah, that would work! however its a whole different story now that I actually got to try it.

According to the website, whilst the character is facing north the rotation is '000'. So I faced north, according to the map and searched for this value dont get me wrong there was hundres of addresses.

So then I turned my character to face east, now searching for the value of '090'. And so on and so on. So when I got the amount of memory addresses down I found that all the memory addresses always returned 'NAN'.

Is there any other way of finding your rotation?

Edited by AwAke

Share this post


Link to post
Share on other sites
JRowe

Don't search for text. Search for Floats. Also, search for a range of values, always. It might say East, but you're not pointed exactly at 90 degrees. So you point yourself east, search for a value between 80 and 100. Point yourself in the opposite direction, do a "has changed" filter. Return yourself to the original orientation, and do a range "80 to 100" filter. Rinse and repeat until you've found the address, then find the pointer and offset (which iirc cheatengine does automagically for you, so I'll spare you the methodology.)

The values are stored and used as floating point variables, before they are formatted as text or for any other functions. If you search for text, you're going to chase your tail endlessly, as you're two or more levels of abstraction away from the actual variable you're searching for. Yes, I know WoW has an xml API for use with mods and the like, but you still need to search for floating point values if you're using a hex editor and memory searches for your script.

Share this post


Link to post
Share on other sites
AwAke

Ah I see! Thank you for your reply once again JRowe, I really appreciate it and your insight on the topic im on seems quite superior to my knowledge anyway. Therefore would you mind if I have some sort of contacting service? Msn/xfire for example? Just incase I were to find problems again in the future. You dont have too ofcourse as I know its the least way you want to spend your time helping a little nooby :).

As for what you have posted, I will do it in the morning as I have to be up in the morning and am now of to bed.

Once again thank you for your help, couldnt of asked for anything more. :lmao:

With regards.

AwAke!

Share this post


Link to post
Share on other sites
JRowe

Its np, its just something you have to learn to do. Others will tell you its a matter of knowing ASM and how the instructions work, but for the limited application you're using it for, all you need to know is that there are variables in memory that you need to get at. Those variables can be formatted as 2/4/8 bytes, Floats, and Doubles. If the variable represents something like hitpoints or a fluid, dynamic value, then it's likely stored as a Float. If the value is a quantity of items or an index (amount of gold or player ID) then it's likely to be stored as a 4 Byte or 8 Byte variable. Use your best judgment, if the default assumptions don't seem to apply.

On top of those basics, you gotta know how to use cheat engine. Basically, figure out how your variable is likely to be stored, and how you change it. In your case, you're looking for orientation... a value between 0 and 360. Since North is 0, you don't want to get involved in the mathematical acrobatics involved in searching for a value that is between |350 to 360 | 0 to 10 |. So you start with a direction that gives you no logical trouble with searching a range... 80 to 100. That's anywhere close to facing east.

1.) Face your character as close to east as is easily possible.

2.) Search for a value between 80 and 100

3.) Repeat the search as a filter 3-5 times, to winnow down the list.

4.) Reverse your direction to as close to west as you can get.

5.) Do a filter search on range 260 to 280 (west is 270 degrees)

6.) Repeat the search as a filter 3-5 times

7.) Repeat steps 1 through 7 until you find an address for orientation/rotation.

If it's difficult to be that precise in guesstimating your direction, increase the search ranges to 20 degrees in either direction, or |70 to 110 | 250 to 290|

Once you have an address for your orientation, run it through cheatengine and get the pointer and offset. Voila, et toi, you have it! At least until the next patch.

Share this post


Link to post
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
Sign in to follow this  

×