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 


How i get symbol as value not as address to calculate

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

Joined: 18 Feb 2024
Posts: 9

PostPosted: Fri Jan 24, 2025 2:36 am    Post subject: How i get symbol as value not as address to calculate Reply with quote

how i extract CPVehicle value to get CVehicle symbol address

Code:

[ENABLE]
{$lua}
if syntaxcheck then return end

local PS2mem = getAddress("pcsx2-qt.EEmem")
PS2mem = readPointer(PS2mem)

if PS2mem then
  -- Define the offsets
  local CPVehicleOffset = 0x06FF420
  local CVehicleOffset = 0xE0

  -- Resolve CPVehicle
  local CPVehicle = readPointer(PS2mem + CPVehicleOffset)
  if CPVehicle then
    CPVehicle = CPVehicle + 0x4B4
    registerSymbol("CPVehicle", CPVehicle, false)

    -- Get the value stored at CPVehicle and add 0xE0
    local CPVehicleValue = readInteger(CPVehicle)
    if CPVehicleValue then
      local CVehicle = CPVehicleValue + CVehicleOffset
      registerSymbol("CVehicle", CVehicle, false)
    end
  end
end

[DISABLE]
unregisterSymbol("CPVehicle")
unregisterSymbol("CVehicle")



image_2025-01-24_164123605.png
 Description:
This meant for CVehicle
 Filesize:  21.68 KB
 Viewed:  725 Time(s)

image_2025-01-24_164123605.png



image_2025-01-24_163217703.png
 Description:
i was wondering if this still pulling CPVehicle Address value but not the value of that address
 Filesize:  6.29 KB
 Viewed:  729 Time(s)

image_2025-01-24_163217703.png



image_2025-01-24_163115456.png
 Description:
CVehicle value is 0x00ABBA30
 Filesize:  6.43 KB
 Viewed:  729 Time(s)

image_2025-01-24_163115456.png



image_2025-01-24_163014758.png
 Description:
CPVehicle symbol
 Filesize:  7.21 KB
 Viewed:  729 Time(s)

image_2025-01-24_163014758.png




Last edited by nirvada on Fri Jan 24, 2025 6:20 pm; edited 1 time in total
Back to top
View user's profile Send private message
Csimbi
I post too much
Reputation: 97

Joined: 14 Jul 2007
Posts: 3282

PostPosted: Fri Jan 24, 2025 3:54 pm    Post subject: Reply with quote

You need to register the offset (not the value).
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 Lua Scripting 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