Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Any easy+quick way to add a specific sum to all table addr?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Forumic
How do I cheat?
Reputation: 0

Joined: 01 Sep 2017
Posts: 5
Location: Finland

PostPosted: Tue May 17, 2022 4:01 am    Post subject: Any easy+quick way to add a specific sum to all table addr? Reply with quote

Hi!

So, just asking, if there's an easy & quick way to add a specific sum to all addresses in the table?

I have all the header pointers of a file in the table, and I'd need to add an offset to all of them (an offset of dec 768 specifically).

I've got them all in the table as arrays of bytes, and to accomplish what I need, I'd basically just have to add "03" in hex to the 2nd byte in all addresses.

I probably explained that in a horrible and confusing way, but anyone who got what I meant, is it possible? If it requires the Lua functions, you'll have to guide me a bit, as I'm not at all familiar with them.

Thanks in advance.

-EDIT: Added image to clear any confusion.



Capture.PNG
 Description:
So what I'm looking for is to easily add the same amount to all of the address values; So to make the first one go from 10 99 02 00 to 10 9C 02 00 and so on.
 Filesize:  32.73 KB
 Viewed:  1658 Time(s)

Capture.PNG


Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4718

PostPosted: Tue May 17, 2022 10:35 am    Post subject: Reply with quote

Change them all to 4-byte values, select them all, and change the value (shortcut enter) to "value+0x300" no quotes

PS: that image makes me more confused. The first page of any process (addresses 0-0xFFF) should be unmapped- they can't have values. Are you offsetting the base of the address space somehow? (I forget the Lua function)

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 37

Joined: 16 Feb 2017
Posts: 1533

PostPosted: Tue May 17, 2022 10:46 am    Post subject: Reply with quote

In my case this code works.



Code:
function AddValue(byt,val)
  local al=getAddressList()
  cnt = addresslist_getCount(al)
  if cnt > 0 then
     for i=0, cnt-1 do
         local mr = addresslist_getMemoryRecord(al,i).Address.."+"..byt
         --print(i,mr)
         val1=readByte(mr) + val
         --print(val1)
         writeBytes(mr,val1)
     end
  end
end

--Let's consider the byte calculation as follows;
-- 1 - 2 - 3 - 4 --> Bytes Value
-- 0 - 1 - 2 - 3 --> Address List
--10-99-02-00 --> Byte 2 = addList 1 = "99"
--AddValue( add byte, add value)

AddValue("01","03") --10 99 02 00 --> 10 9C 02 00

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Forumic
How do I cheat?
Reputation: 0

Joined: 01 Sep 2017
Posts: 5
Location: Finland

PostPosted: Tue May 17, 2022 7:14 pm    Post subject: Reply with quote

ParkourPenguin wrote:
Change them all to 4-byte values, select them all, and change the value (shortcut enter) to "value+0x300" no quotes

PS: that image makes me more confused. The first page of any process (addresses 0-0xFFF) should be unmapped- they can't have values. Are you offsetting the base of the address space somehow? (I forget the Lua function)


Ahh, huge thanks. That works. Cheers!
And yeah, I was opening a file in CE, basically using it as a hex editor (because CE supports wildcard AoB scanning.)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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