View previous topic :: View next topic |
Author |
Message |
cheatH13 How do I cheat? Reputation: 0
Joined: 29 Jul 2021 Posts: 2
|
Posted: Thu Jul 29, 2021 4:59 am Post subject: Lua Script | Read Address from the Cheat Table |
|
|
Here is my LUA script, u might recognize it XD.
Code: | address = 0x7FF940DB2014
lastValue=0;
function checkKeys(timer)
if (isKeyPressed(VK_R)) then
if lastValue ~= 1 then
writeQword(address, 1)
lastValue=1
end
else
if lastValue ~= 0 then
writeQword(address, 0)
lastValue=0
end
end
end
t=createTimer(nil)
timer_setInterval(t, 100)
timer_onTimer(t, checkKeys)
timer_setEnabled(t, true) |
The address at the top comes from a script in my table:
Please see attachment ce1.PNG
This is what I call it in the script:
Please see attachment ce2.PNG
The address changes every restart, I manually update my LUA.
How can I make it so the LUA script can find the correct address automatically?
I usually just google stuff like this, but I'm not well versed in LUA so I don't know what to search.
Help please.
P.S. Sorry I had to use attachments for the images. The forum won't let me post URLs yet.
Description: |
|
Filesize: |
3.39 KB |
Viewed: |
2767 Time(s) |
|
Description: |
|
Filesize: |
12.85 KB |
Viewed: |
2767 Time(s) |
|
|
|
Back to top |
|
|
LeFiXER Grandmaster Cheater Supreme Reputation: 20
Joined: 02 Sep 2011 Posts: 1055 Location: 0x90
|
Posted: Thu Jul 29, 2021 5:16 am Post subject: |
|
|
You either need to use an AOB injection script to pull the pointer from memory or find a basepointer manually.
This is an AOB injection script. I've commented the lines so you can understand what is happening.
Code: |
[ENABLE]
aobscanmodule([injection_point_name],[process_name],[AOB]) // (Note: Don't include the square brackets)
// AOB will look something like this and should be unique to work 48 8D 64 24 D8 C6 05 * * * * 00 4C (Note: */? are wildcards meaning it doesn't matter what the byte is)
alloc(newmem,$1000,[injection_point_name])
// This allocates 1,000 bytes near the injection point to write new code
label(code)
label(return)
newmem:
// New code goes here (Note: instructions under "code:" will still execute)
code:
// Below will be a few lines of instructions that followed the injection point
lea rsp,[rsp-28]
jmp return
// After executing instructions, return back to the injection point so the game can continue executing normally
[injection_point_name]:
jmp newmem
// jump to newly allocated memory, i.e. injection point
return:
registersymbol([injection_point_name])
// register a symbol so that CE can find where to remove the code when you disable it, or for use as reference within the table
[DISABLE]
[injection_point_name]:
db 48 8D 64 24 D8
// restore original bytes at the point of injection
unregistersymbol([injection_point_name])
dealloc(newmem)
// Bit of housework.
|
|
|
Back to top |
|
|
ByTransient Expert Cheater Reputation: 5
Joined: 05 Sep 2020 Posts: 240
|
Posted: Thu Jul 29, 2021 5:35 am Post subject: |
|
|
This works for me.
Code: | address = 0x7FF940DB2014
lastValue=0;
function checkKeys(timer)
if (isKeyPressed(VK_R)) then
if lastValue == 0 then
--sleep(100)
writeQword(address, 1)
lastValue=1
--print(lastValue)
else
writeQword(address, 0)
lastValue=0
--print(lastValue)
end
end
end
if t then t.Destroy() t=nil end
t=createTimer(nil)
timer_setInterval(t, 100)
timer_onTimer(t, checkKeys)
timer_setEnabled(t, true) |
|
|
Back to top |
|
|
TheyCallMeTim13 Wiki Contributor Reputation: 50
Joined: 24 Feb 2017 Posts: 976 Location: Pluto
|
Posted: Thu Jul 29, 2021 5:45 am Post subject: |
|
|
Looks like your memory record uses the symbol "set_suck" so you can use that as the address just make it a string. The functions CE has with an address parameter takes strings or numbers.
Thus just change the first line to something like this.
Code: | address = "set_suck" |
And I would nest it under the script that sets the symbol being used.
And just to note you can even use more complex addresses if need be.
Code: | address = "set_suck+4" |
Code: | address = "[mySymbol]+4" |
Code: | address = "[[game.exe+DEAD]+BEEF]+C" |
_________________
|
|
Back to top |
|
|
cheatH13 How do I cheat? Reputation: 0
Joined: 29 Jul 2021 Posts: 2
|
Posted: Thu Jul 29, 2021 6:09 pm Post subject: This works. Thanks. |
|
|
TheyCallMeTim13 wrote: | Looks like your memory record uses the symbol "set_suck" so you can use that as the address just make it a string. The functions CE has with an address parameter takes strings or numbers.
Thus just change the first line to something like this.
Code: | address = "set_suck" |
|
This works, thanks!
Funny thing, this is actually the first thing I tried, but I didn't use quotation marks, so that's why it didn't work. SMH, could have saved myself a lot of time.
|
|
Back to top |
|
|
|