Modifying values of pointers

Anything Cheat Engine related, bugs, suggestions, helping others, etc..
Post Reply
HailoSir
Noobzor
Noobzor
Posts: 11
Joined: Thu May 18, 2017 3:16 pm
Reputation: 3

Modifying values of pointers

Post by HailoSir »

1) I have a multilevel pointer which gives the value for money with a multiplier applied to the value shown in the game. However, I don't want to open my calculator every time to apply the multiplier to the amount I want... Is it possible to change the value to the amount I want with a script that applies the multiplier automatically?

2) Also, this money pointer is at all times 8 bytes away from another useful address pointing toward an honor value. How would I go about writing a script to calculate the honor address based off the money pointer?

TimFun13
Expert Cheater
Expert Cheater
Posts: 1354
Joined: Fri Mar 03, 2017 12:31 am
Reputation: 6

Re: Modifying values of pointers

Post by TimFun13 »

1.) You can add a custom type and set the pointer value type to that.
Here is a script for an integer (4 byte) divided by 100, you'll need to add this to the table Lua script:

Code: Select all


local TypeName = 'Int / 100'
local ByteCount = 4
local IsFloat = false

local function bytesToValue( ... )
	local bytes = { ... }
	return (byteTableToDword({ bytes[1], bytes[2], bytes[3], bytes[4] }) / 100)
end
local function valueToBytes(value)
	local bytes = dwordToByteTable(value * 100)
	return bytes[1], bytes[2], bytes[3], bytes[4]
end

registerCustomTypeLua(TypeName, ByteCount, bytesToValue, valueToBytes, IsFloat)

2.) Just add to the final offset. Copy & paste the pointer, then add to the final offset (the one at the top in the CE address/pointer window).

User avatar
SunBeam
Administration
Administration
Posts: 4765
Joined: Sun Feb 04, 2018 7:16 pm
Reputation: 4403

Re: Modifying values of pointers

Post by SunBeam »

Yeah, sure he'll know wtf you mean with Lua code ;)

HailoSir
Noobzor
Noobzor
Posts: 11
Joined: Thu May 18, 2017 3:16 pm
Reputation: 3

Re: Modifying values of pointers

Post by HailoSir »

Thanks, ShyTwig16! Everything is working :D

Post Reply

Who is online

Users browsing this forum: No registered users