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 


[HELP][BEGINNER] Conditional Increase

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
FanTasMa_
How do I cheat?
Reputation: 0

Joined: 15 Mar 2023
Posts: 2

PostPosted: Wed Mar 15, 2023 7:43 am    Post subject: [HELP][BEGINNER] Conditional Increase Reply with quote

Hey, everyone!

So, I'm a begginer on game hacking and I'm trying to work on a cheat in a sigleplayer game that goes around two variables: InGame Gold (IGG) and Kill Count (KC). What I want to do is: whenever my KC increases, my Gold must increase as well, not discarding the other ways to gain gold (through Chests and Coins found).

I got the static values for the two variables and I'm trying to inject a code (via AOB Script) on the 'KC gain' line. But have no clue how to make the other variable increase. How do I do it? What should I write?

Static Values is something like:
IGG.: "GameAssembly.dll"+02011088 + 2B0 + B0 + 20
KC.: "GameAssembly.dll"+01EEF800 + 40 + 28 + 130

[NOTE]: The variables doesn't share the same module or data structure.

Thanks in advance for your help and apologies for possible grammar mistakes.



CE clueless.png
 Description:
 Filesize:  27.94 KB
 Viewed:  1498 Time(s)

CE clueless.png


Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Wed Mar 15, 2023 11:31 am    Post subject: Reply with quote

Presumably, the instruction that handles KC is only executed when your kill count increases. As such, you can simply create a boolean that increases by 1 each time that particular instruction gets executed.

For the gold instruction, use an instruction that constantly accesses your gold, if possible. Inside the gold script, check to see if your custom bool value is 1. If it is, reward yourself with more gold by jumping to a segment of code that will do that, while also resetting the bool back to 0.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4718

PostPosted: Wed Mar 15, 2023 1:52 pm    Post subject: Reply with quote

If the pointers are correct, you can simply add gold using that.
Code:
...
newmem:
  push rax
{$try}
  mov rax,["GameAssembly.dll"+02011088]
  mov rax,[rax+2B0]
  mov rax,[rax+B0]
  add [rax+20],1
{$except}
  pop rax
code:
  add [rcx+130],edx
  jmp return
...

If the pointers aren't good, use injection copy to get the address of gold instead.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
FanTasMa_
How do I cheat?
Reputation: 0

Joined: 15 Mar 2023
Posts: 2

PostPosted: Wed Mar 15, 2023 6:33 pm    Post subject: Reply with quote

ParkourPenguin wrote:
If the pointers are correct, you can simply add gold using that.
Code:
...
newmem:
  push rax
{$try}
  mov rax,["GameAssembly.dll"+02011088]
  mov rax,[rax+2B0]
  mov rax,[rax+B0]
  add [rax+20],1
{$except}
  pop rax
code:
  add [rcx+130],edx
  jmp return
...

If the pointers aren't good, use injection copy to get the address of gold instead.


Hey, ParkourPenguin, it worked! I really appreciate your help! The 'push/pop' of the register was the key I needed. Thank you again!

METHOS, I thank for your reply as well, it gave me some ideas for future scripts!
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
Page 1 of 1

 
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