I was wondering if anybody could share or make a lua script for cheat engine to do a 4byte scan and replace all results with another value.
Kinda similar to this
scan = (100, 300)
replace = (500, 400)
Where you would scan for 100, And replace all with 500. And if you did multiple it would also scan for 300 and replace all with the 400.
4Byte Scan and Replace all Results
-
- What is cheating?
- Posts: 3
- Joined: Mon Mar 28, 2022 11:07 pm
- Reputation: 0
-
- Expert Cheater
- Posts: 855
- Joined: Fri Oct 12, 2018 10:25 pm
- Reputation: 891
Re: 4Byte Scan and Replace all Results
You can do something like this:
This as a function:
And then change values with this line:
But be aware that you gotta tinker with the scan range and other settings, otherwise it will change things that you don't want to, from other modules, etc.
This as a function:
Code: Select all
function ChangeValues(v, v2)
local MemScan = createMemScan()
MemScan.firstScan(soExactValue, vtDword, nil, v, nil, '0', '700000000000', '*W*C', fsmAligned, '0', false, true, false, false)
MemScan.waitTillDone()
local Results = createFoundList(MemScan)
Results.initialize()
for i=0,Results.Count-1 do
writeInteger(Results[i],v2)
end
MemScan.destroy()
Results.destroy()
end
Code: Select all
ChangeValues(100, 500) -- Search for 100, change results to 500.
-
- What is cheating?
- Posts: 3
- Joined: Mon Mar 28, 2022 11:07 pm
- Reputation: 0
Re: 4Byte Scan and Replace all Results
This is exactly what I need, However instead of going into the lua engine to type and call changevalue is there a way to add it to the cheat table and just clicking on it to change values that are set so I can do that when I boot the game?
-
- Expert Cheater
- Posts: 855
- Joined: Fri Oct 12, 2018 10:25 pm
- Reputation: 891
Re: 4Byte Scan and Replace all Results
Create a script, add {$lua} under [ENABLE], and add the LUA code.
-
- What is cheating?
- Posts: 3
- Joined: Mon Mar 28, 2022 11:07 pm
- Reputation: 0
Re: 4Byte Scan and Replace all Results
Thank you, Works for exactly what I need it to do.
Who is online
Users browsing this forum: BLEXBot