View previous topic :: View next topic |
Author |
Message |
Feel_Fried How do I cheat? Reputation: 0
Joined: 18 Feb 2024 Posts: 3
|
Posted: Sun Feb 18, 2024 7:49 pm Post subject: String replace script |
|
|
Hi guys,sorry for being so noob but I'm new to CE and not even sure that it's a correct tool for what I need, but anyway
If short I have a game with encryted scripts but I found out that after game load some they are decrypted in memory and I can modify them with CE
So I need some CE script that will search for a string in memory (for every same string) and then replace it(them) with another string, on a background each 10 seconds or on key press (if it's possible)
for example I have string Berifier_Punisher_Do and I wanna to replace it with
Verifier_Punisher_Do
Description: |
here I found original strings |
|
Filesize: |
39.01 KB |
Viewed: |
894 Time(s) |
|
Description: |
here I replaced them with new ones manually
but problem is I wanna a script that will do it automatically |
|
Filesize: |
40.48 KB |
Viewed: |
894 Time(s) |
|
|
|
Back to top |
|
|
LeFiXER Grandmaster Cheater Supreme Reputation: 20
Joined: 02 Sep 2011 Posts: 1055 Location: 0x90
|
Posted: Sun Feb 18, 2024 9:16 pm Post subject: |
|
|
This will replace all values found in the foundlist after conducting the initial search:
Code: |
local string_to_find = 'Berifier_Punisher_Do'
local string_to_write = 'Verifier_Punisher_Do'
local fl = getCurrentMemscan().FoundList
if fl == nil then error('Invalid foundlist.') end
for i = 0, fl.Count - 1 do
if fl[i] ~= nil and fl.Value[i] == string_to_find then
writeString(fl[i], string_to_write, false) -- set to true if widestring
end
end
|
|
|
Back to top |
|
|
Feel_Fried How do I cheat? Reputation: 0
Joined: 18 Feb 2024 Posts: 3
|
Posted: Sun Feb 18, 2024 9:49 pm Post subject: |
|
|
LeFiXER wrote: | This will replace all values found in the foundlist after conducting the initial search: |
If I understand it correctly it will search in scan results from manually runned scan... but how to run scan from lua?
|
|
Back to top |
|
|
LeFiXER Grandmaster Cheater Supreme Reputation: 20
Joined: 02 Sep 2011 Posts: 1055 Location: 0x90
|
Posted: Sun Feb 18, 2024 10:54 pm Post subject: |
|
|
This should do the trick:
Code: |
local string_to_find = 'Berifier_Punisher_Do'
local string_to_write = 'Verifier_Punisher_Do'
ms = createMemScan()
ms.firstScan(soExactValue, vtString, 0, string_to_find, "" , 0, 0xffffffffffffffff, "", fsmNotAligned, "1", false, false, false, false)
ms.waitTillDone()
f=createFoundList(ms);
f.initialize();
resultToWrite = stringToByteTable(string_to_write .. string.char(0))
for i = 0, f.Count - 1 do
writeString(f.Address[i], string_to_write)
writeBytes(("0x" .. f.Address[i]) + 4, 0)
end
f.destroy()
ms.destroy()
|
Credits: DB
There is more information in the celua.txt documentation
|
|
Back to top |
|
|
Feel_Fried How do I cheat? Reputation: 0
Joined: 18 Feb 2024 Posts: 3
|
Posted: Mon Feb 19, 2024 12:37 am Post subject: |
|
|
Thank you!
|
|
Back to top |
|
|
|