 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4718
|
Posted: Thu Dec 28, 2023 12:09 pm Post subject: |
|
|
Time is a concept that can be encoded in many different ways.
Sometimes games use a value that counts up/down to some limit. e.g. "reload time remaining" as a float counting down from 5 to 0
Other times they store a time point and check against that. e.g. "reload start time" stored once when the reload began, and check if `currentTime >= reloadStartTime + reloadTimeDuration`.
I'd start by searching for the former. To save you some time, that's not going to work for the first part of the graphical tutorial.
For the latter, I'd start reloading, do an unknown initial value scan, complete the reload and start a new one, do an increased value scan, etc. Unchanged value scans are fine while the reload is ongoing (if you're fast enough), but not while the reload is complete. The game might change it to some indeterminate value. If you want to do unchanged value scans when not reloading, do an "ignore value" scan first and then "unchanged value" scans. It might also just continue increasing or otherwise change while not reloading, but this doesn't happen in the tutorial.
It's probably beneficial to pause the process while scanning. There's an option for that in the "Memory Scan Options" in the main window, or do it manually in the "Advanced Options" window.
Once you get that value, figure out how it works. In the first part of the CE graphical tutorial, just freezing it at 0 works well enough. In general, you'd have to find out what instructions access that address and figure out how to do what you want by reading assembly. Probably change a jcc to something else.
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
| Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4718
|
Posted: Thu Dec 28, 2023 4:25 pm Post subject: |
|
|
`reloadTimeDuration` would just be some constant. In this case, 2000.
If that value you found didn't become 0 when you were done reloading, it's not the correct value.
Replacing instructions that write to it with NOPs probably won't do anything good. You have to be able to read assembly to know what change you're suppose to make.
See CE's source on github if you're confused. The code is in "Cheat Engine/Tutorial/graphical/gametutorial1.pas".
Short version:
| Code: | function TGame1.KeyHandler
...
ct:=GetTickCount64;
...
if reloading<>0 then exit;
...
if shotsfired=5 then
begin
reloading:=ct;
...
procedure tgame1.gametick
...
if reloading<>0 then
begin
if target<>nil then
...
if currenttime>(reloading+2000) then
begin
reloading:=0;
...
|
If you want something easier, you could just find the integer `shotsFired` and freeze that to 0 or nop the instruction incrementing it.
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25832 Location: The netherlands
|
Posted: Fri Dec 29, 2023 5:31 am Post subject: |
|
|
It can be done, but your difficulty level will go up from "difficult" to "very difficult" (if you use CE and don't just recompile the tutorial)
First off, the bullets are stored in an array that exists out of 5 entries inside the game class, so you can't just increase the limit of 5 to higher as you're going to overwrite the fields after it
So first you'll need to allocate more memory for the bullet storage and adjust all the code that references that array to the newly allocated memory (functions keyhandler, render and gametick) and there you can also adjust the maximum count (it's done using a loop counter)
Keep in mind that the array is in dynamic allocated memory(part of game1 class instance) so it's not a static address you can look for (class instance offset will work)
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
|
|
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
|
|