Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Modifying an address based on another address' value
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
Sahfais
Newbie cheater
Reputation: 0

Joined: 12 Jun 2011
Posts: 15

PostPosted: Wed Jun 15, 2011 4:33 pm    Post subject: Modifying an address based on another address' value Reply with quote

I have to modify an address by +20 at a specific moment depending on the value of another pointer (which is a string), and change it back when the pointer no longer contains the value. Did a quick search and couldn't find anything of much help.

If that description was a bit confusing I basically mean this:

if (x = "class")
y = y+20
z = 1

if z = 1 && x != "class"
y = y-20
z = 0
Back to top
View user's profile Send private message
lucidity
Advanced Cheater
Reputation: 0

Joined: 16 Feb 2011
Posts: 91

PostPosted: Wed Jun 15, 2011 5:15 pm    Post subject: Reply with quote

Exactly how you would add them depends on the language you're doing it in.

If you want to add the decimal number 20 to a value, then you would probably convert the address to decimal and do normal addition.

If your language supports adding hex, then you would add 0x14 (not 20), since 0x14 is the hexadecimal equivalent of the decimal number 20.

Hope this helps.

_________________
» Antec Twelve Hundred Full Tower » EVGA E760 CLASSIFIED » EVGA GeForce GTX 580 SuperClocked 1536MB » i7-980XE » CORSAIR DOMINATOR 6GB PC3 12800 DDR3 » OS: Intel X25-M SSD » Game Storage: Raid-0 2 x WD VelociRaptor 10000 RPM » CE Cache Drive: 500GB WD Caviar » Power Supply: OCZ Z Series Gold 1000W
Back to top
View user's profile Send private message
Sahfais
Newbie cheater
Reputation: 0

Joined: 12 Jun 2011
Posts: 15

PostPosted: Thu Jun 16, 2011 1:21 am    Post subject: Reply with quote

My initial aim was to do it entirely through assembly, but after a bit more fiddling I see this probably isn't going to be the case. The image is a bit more descriptive so I felt the need to include it!

dl.dropbox[dot]com/u/15530379/classexmp.png

Each menu option is assigned an int that externally references it. I'm currently modifying the pointer directly through an external program, but it seems a little awkward due to cross-platform issues, and with the game presenting its own menu. My other option was, for instance, a series of conditional statements:

if (text string = "a")
entry line = 21

else if (text string = "b")
entry line = 22

And so on. I realised that simply adding 20 doesn't work due to the fact that the address is also used for other menu button (oops). I'm not even too sure where I should start with an Assembly script for something like the above, so I should probably drop that idea. Very Happy
Back to top
View user's profile Send private message
lucidity
Advanced Cheater
Reputation: 0

Joined: 16 Feb 2011
Posts: 91

PostPosted: Thu Jun 16, 2011 5:21 am    Post subject: Reply with quote

Sahfais wrote:
it seems a little awkward due to cross-platform issues


Different platforms have different ways of handling memory. I've never tried, but I'm 95% sure you aren't going to have an easy time making cheats for more than one platform (Windows, Mac, Linux). If you mean more than one version of windows, I don't think the "awkwardness" would apply.

Does Barbarian have a value of 0 for that top memory location you show?

You could always just send keystrokes and check the current text equivalent:

Code:
While(textString <> "Rogue")
    PressKey("Down")
    textString = _getNewClassTextString()
End While


I would look for a "Collection" or "Enum" or "HashMap" in your language, rather than chaining ~20+ if/else conditions together. These are common methodologies for storing values to cross-reference (enum included since you're using numeric values anyhow).

_________________
» Antec Twelve Hundred Full Tower » EVGA E760 CLASSIFIED » EVGA GeForce GTX 580 SuperClocked 1536MB » i7-980XE » CORSAIR DOMINATOR 6GB PC3 12800 DDR3 » OS: Intel X25-M SSD » Game Storage: Raid-0 2 x WD VelociRaptor 10000 RPM » CE Cache Drive: 500GB WD Caviar » Power Supply: OCZ Z Series Gold 1000W
Back to top
View user's profile Send private message
Sahfais
Newbie cheater
Reputation: 0

Joined: 12 Jun 2011
Posts: 15

PostPosted: Thu Jun 16, 2011 2:06 pm    Post subject: Reply with quote

A '0' or invalid value returns Barbarian, and it then increments by 1 for each entry.

dl.dropbox[dot]com/u/15530379/baseprestigeclasses.png

As you can see from every entry under the Wizard, the game only supports "Prestige" classes after its vanilla release (which means you can't take them at level 1, but once the requirements are met). A class with no requirements at all can still only be taken at level 2, hence the reason for such a silly workaround. There have been quite a lot of attempts to sort this out by other members of the community but they always tend to involve selecting a different class at level 1 and then having the class altered, which is a bit of a stretch for new players. Smile
Back to top
View user's profile Send private message
lucidity
Advanced Cheater
Reputation: 0

Joined: 16 Feb 2011
Posts: 91

PostPosted: Thu Jun 16, 2011 2:16 pm    Post subject: Reply with quote

Your question has pseudo code with "x" and "y" vars... can you explain in words what you're trying to do?

Trying to select a class only if it is available? trying to hack the game so they are all accessible?

If these specifics don't matter, then what is your question? Sounds like more of a statement.

"I have to..."

Well then do it!

_________________
» Antec Twelve Hundred Full Tower » EVGA E760 CLASSIFIED » EVGA GeForce GTX 580 SuperClocked 1536MB » i7-980XE » CORSAIR DOMINATOR 6GB PC3 12800 DDR3 » OS: Intel X25-M SSD » Game Storage: Raid-0 2 x WD VelociRaptor 10000 RPM » CE Cache Drive: 500GB WD Caviar » Power Supply: OCZ Z Series Gold 1000W
Back to top
View user's profile Send private message
Sahfais
Newbie cheater
Reputation: 0

Joined: 12 Jun 2011
Posts: 15

PostPosted: Thu Jun 16, 2011 4:10 pm    Post subject: Reply with quote

At first I was trying to make all of them accessible, but I've had a lot of trouble getting that working. My less complicated idea was basically to add my custom classes and have them stored like this:

20 - custom 1
21 - custom 2
etc

Then you'd pick the class at 0 - Barbarian - it'd add 20 to the class value, and you'd end with the custom 1 class with the value = 20. Does that make sense?
Back to top
View user's profile Send private message
lucidity
Advanced Cheater
Reputation: 0

Joined: 16 Feb 2011
Posts: 91

PostPosted: Thu Jun 16, 2011 4:12 pm    Post subject: Reply with quote

Why wouldn't you just make it so you can select any one you want?
_________________
» Antec Twelve Hundred Full Tower » EVGA E760 CLASSIFIED » EVGA GeForce GTX 580 SuperClocked 1536MB » i7-980XE » CORSAIR DOMINATOR 6GB PC3 12800 DDR3 » OS: Intel X25-M SSD » Game Storage: Raid-0 2 x WD VelociRaptor 10000 RPM » CE Cache Drive: 500GB WD Caviar » Power Supply: OCZ Z Series Gold 1000W
Back to top
View user's profile Send private message
Sahfais
Newbie cheater
Reputation: 0

Joined: 12 Jun 2011
Posts: 15

PostPosted: Thu Jun 16, 2011 4:13 pm    Post subject: Reply with quote

I've had -so- many issues getting that to work that I found this method a heck of a lot easier. Granted, it's less of a fix and more of a workaround. Razz
Back to top
View user's profile Send private message
lucidity
Advanced Cheater
Reputation: 0

Joined: 16 Feb 2011
Posts: 91

PostPosted: Thu Jun 16, 2011 4:19 pm    Post subject: Reply with quote

It would be the real solution imo; find the value which dictates whether or not they should be unlocked and change it.

Almost always the simplest solution is the best.

_________________
» Antec Twelve Hundred Full Tower » EVGA E760 CLASSIFIED » EVGA GeForce GTX 580 SuperClocked 1536MB » i7-980XE » CORSAIR DOMINATOR 6GB PC3 12800 DDR3 » OS: Intel X25-M SSD » Game Storage: Raid-0 2 x WD VelociRaptor 10000 RPM » CE Cache Drive: 500GB WD Caviar » Power Supply: OCZ Z Series Gold 1000W
Back to top
View user's profile Send private message
Sahfais
Newbie cheater
Reputation: 0

Joined: 12 Jun 2011
Posts: 15

PostPosted: Thu Jun 16, 2011 6:31 pm    Post subject: Reply with quote

Very Happy

I'm so glad you told me to go back and do that.

I found an address that is '0' when a class is a base class, and '1' for a prestige class. Froze it at 0 and every class is selectable. There are a few issues, namely the class names and the 'OK' button are still greyed out, but I don't think they're enough of a problem to really care about at the moment. I can probably edit the 'OK' button by simply editing the .gui tga files and removing the text chunk of it.

Once I find the static address for it I think I can just write a basic patcher for it.

Seems I was just skipping over something that was, in fact, far simpler than I thought!
Back to top
View user's profile Send private message
lucidity
Advanced Cheater
Reputation: 0

Joined: 16 Feb 2011
Posts: 91

PostPosted: Thu Jun 16, 2011 7:00 pm    Post subject: Reply with quote

I wrote:
Almost always the simplest solution is the best.


It'll make additional changes much easier too.

Glad you were able to make some progress, keep going! Smile

_________________
» Antec Twelve Hundred Full Tower » EVGA E760 CLASSIFIED » EVGA GeForce GTX 580 SuperClocked 1536MB » i7-980XE » CORSAIR DOMINATOR 6GB PC3 12800 DDR3 » OS: Intel X25-M SSD » Game Storage: Raid-0 2 x WD VelociRaptor 10000 RPM » CE Cache Drive: 500GB WD Caviar » Power Supply: OCZ Z Series Gold 1000W
Back to top
View user's profile Send private message
Sahfais
Newbie cheater
Reputation: 0

Joined: 12 Jun 2011
Posts: 15

PostPosted: Thu Jun 16, 2011 10:55 pm    Post subject: Reply with quote

The address' byte value and in CE continually swaps between "??" and 0/1, making it rather annoying to freeze (the address also does the same) - I assume this means it operates on a timer? I figure if I freeze it before it's accessed it should be fine, but I haven't tried it yet.

I also managed to find eight multilevel pointers that all reference the same address, which is something I haven't seen before (granted, I don't have a huge amount of experience with CE, but still). Does it actually matter which one I select if they all seem to function identically when frozen at 0? Should I be thinking about freezing ALL of them for the patch file?
Back to top
View user's profile Send private message
lucidity
Advanced Cheater
Reputation: 0

Joined: 16 Feb 2011
Posts: 91

PostPosted: Fri Jun 17, 2011 4:06 am    Post subject: Reply with quote

Quote:
The address' byte value and in CE continually swaps between "??" and 0/1, making it rather annoying to freeze (the address also does the same) - I assume this means it operates on a timer?


Can't you freeze it and change it to whatever you want? (You should've done this in the tutorial)

As for pointer validity - Restart the game and rescan, perhaps even restart your computer and rescan. Once you've really filtered them, I usually just use the first one in the list.

_________________
» Antec Twelve Hundred Full Tower » EVGA E760 CLASSIFIED » EVGA GeForce GTX 580 SuperClocked 1536MB » i7-980XE » CORSAIR DOMINATOR 6GB PC3 12800 DDR3 » OS: Intel X25-M SSD » Game Storage: Raid-0 2 x WD VelociRaptor 10000 RPM » CE Cache Drive: 500GB WD Caviar » Power Supply: OCZ Z Series Gold 1000W
Back to top
View user's profile Send private message
Sahfais
Newbie cheater
Reputation: 0

Joined: 12 Jun 2011
Posts: 15

PostPosted: Fri Jun 17, 2011 10:48 am    Post subject: Reply with quote

The pointer is only an active address once I'm up to that menu screen - before that it's '????????' which means I can't freeze it. Unless there's another method I didn't learn in the tutorial. Either that or I'm just silly. Smile

I'm up to my 9th re-scan (I isolated these eight on my 4th) and there's six still there, so I'm curious if I should just keep going or use the first. Razz

EDIT: It looks like sometimes the game uses the other pointers instead...?
I can freeze the top one at 0 and open and close the menu a few times, and it'll stop working. Then the others have to be frozen at 0 for it to function. Looks like I have to do the lot.

EDIT EDIT: Seems if I do it enough times that none of the pointers on the list are active... looks like I'm missing something. Possibly grabbing the wrong pointers. Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites