Cheat Engine
The Official Site of Cheat Engine

Author Message
Twistedfate
Expert Cheater
Reputation: 0

Joined: 11 Mar 2016
Posts: 210

Posted: Wed Apr 26, 2017 4:06 am    Post subject: Auto increment of offset

if first monster name address in my game is

 Code: r=readInteger("[game.exe]+220")

the 2nd is
0x220+1c68 =1E88

 Code: r2=readInteger("[game.exe]+1E88")
+1c68 . ... . . .

r3=....

Is that possible to make auto increment to get all monsters addresses ?
FreeER
Grandmaster Cheater
Reputation: 23

Joined: 09 Aug 2013
Posts: 633

Posted: Wed Apr 26, 2017 5:29 am    Post subject:

Sure, though you do need some way to tell how many monsters there are so that you know when to stop.

1 way is to assume you know (or can find) a length:

 Code: -- get numeric address local enemyBase = getAddress("[game.exe]+220") -- loop over each enemy for i=0,length-1 do   r=readInteger(enemyBase+0x1c68*i)   -- do something with r, eg. table.insert(enemyList, r) or writeInteger(enemyBase+0x1c68*i, r-100) end

you could also assume that there's a 0 value after the last enemy (like how C strings are 0 terminated) eg,

 Code: local i=0 while true do   local strAddress = "[game.exe]+" .. string.format('%X', 0x220 +0x1C68*i)   r=readInteger(strAddress)   i=i+1   if r == 0 then break end -- stop the loop if done   -- do something with r end
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
 All times are GMT - 6 Hours Page 1 of 1

 Jump to: Select a forum Cheat Engine----------------Cheat EngineCheat Engine Lua ScriptingCheat Engine TutorialsGeneral GamehackingAuto Assembler tutorialsPointer tutorialsGame specific tutorialsWebbrowser stuff related tutorialsConsole ModdingLUA TutorialsLua Extensions General Discussions----------------General DiscussionsArtComputer TalkRandom spamArt RequestsArt TutorialsWillekeurige RotzooiGuestsHorse Excrement Cheat Requests----------------Single player cheat request Cheat Engine Downloads----------------TablesTrainersAuto Assemble scripts Coding----------------Cheat Engine SourceCETC Server and ClientsDBVMPlugin developmentGeneral programmingBinariesCrackmesGeneral programming+Game Development2D Graphics3D ModelingGameplay designWeb Development Games----------------Flash GamesGaia OnlineStick Arena
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

Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites