| View previous topic :: View next topic |
| Author |
Message |
dazmouk How do I cheat?
Reputation: 0
Joined: 22 Mar 2009 Posts: 3
|
Posted: Mon Jan 25, 2021 5:12 am Post subject: Show updated timer value on form |
|
|
Hey all, sorry if this isn't in the right place.
This is my first proper go using Cheat Engine, I am trying to extract and show the in-game timer from Sniper Elite 4 which I think I got with a pointer scan. My problem is that I am unsure where to go from here..
I created a form within CE, added a timer on 1 second intervals on a label to show the value "in-game timer" and works, but when I re-created a standalone exe it doesn't. I have tried googled it and I am guessing it's because it reads from getMemoryRecordByDescription. And now I am unsure what to do to get it into its own exe.
The code is
| Code: |
timer = getAddressList().getMemoryRecordByDescription("In-Game Timer")
function UDF1_CETimer1Timer(sender)
UDF1.CELabel1.Caption = (string.format("%2.1f", timer.value))
end
|
Thank you
|
|
| Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4714
|
Posted: Mon Jan 25, 2021 5:02 pm Post subject: |
|
|
I don't know how exe trainers access the address list (if they even can), but I'd put the pointer path in directly.
| Code: | function UDF1_CETimer1Timer(sender)
UDF1.CELabel1.Caption = ("%2.1f"):format(readDouble'[[game.exe+123ABC]+4A8]+10')
end |
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
| Back to top |
|
 |
dazmouk How do I cheat?
Reputation: 0
Joined: 22 Mar 2009 Posts: 3
|
Posted: Tue Jan 26, 2021 6:47 am Post subject: |
|
|
Thank you for the reply.
It doesn't work unfortunatly. I kept getting a format error so remove the format and shows nothing.
| Code: | function UDF1_CETimer1Timer(sender)
UDF1.CELabel1.Caption = (readFloat'[[[[SniperElite4_DX11.exe+0xEB0BC8]+f40]+160]+18]+a0')
end
|
I got told before that it probably isn't possible, so I wasn't holding much hope, I thought I would ask. Thank you again.
|
|
| Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4714
|
Posted: Tue Jan 26, 2021 11:20 am Post subject: |
|
|
Are you sure you copied/pasted it correctly? Maybe the pointer path isn't always valid and readFloat returns nil? The formatting is fine:
| Code: | assert(("%2.1f"):format(392.681) == "392.6")
assert(("%2.1f"):format(0.001) == "0.0")
-- even works with non-normal numbers
assert(("%2.1f"):format(1.4013e-45) == "0.0")
assert(("%2.1f"):format(1.0/0.0) == "inf")
assert(("%2.1f"):format(-1.0/0.0) == "-inf")
assert(("%2.1f"):format(0.0/0.0) == "-nan") |
I'd guess it's a bad pointer. Make sure you copied the offsets in the correct order. Looking at a memory record's "change address" window, this would be bottom-up:
| Code: | memory record:
f40
160
18
a0
SniperElite4_DX11.exe+0xEB0BC8
pointer path:
[[[[SniperElite4_DX11.exe+0xEB0BC8]+a0]+18]+160]+f40 |
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
| Back to top |
|
 |
dazmouk How do I cheat?
Reputation: 0
Joined: 22 Mar 2009 Posts: 3
|
Posted: Thu Jan 28, 2021 5:23 am Post subject: |
|
|
Sorry for the late reply.
You were right I had the offsets back to front.
I placed the pointer path and correct offset, generated the exe and it works.
Thank you for your help!
|
|
| Back to top |
|
 |
|