zxuiji Advanced Cheater Reputation: 1
Joined: 26 Sep 2016 Posts: 70
|
Posted: Mon Jan 15, 2018 4:37 am Post subject: Subtraction from value somehow producing even bigger value |
|
|
The value I should be getting atm is 76B0041 but Cheat Engine is showing 365243F987. Is anyone able to understand what's going wrong here?
Here's my code with some added notes:
Code: |
-- Cheat Engine Shows pFoes to be DE4717F0
-- http://forum.cheatengine.org/viewtopic.php?p=5734498#5734498
function AOBScanRegion( SYMBOL, AOB, START, END)
-- temporary symbol name to register (should be unique of course)
local aobscanregionSymbol = 'aobscanregionSymbol'
local CODE = [[aobscanregion(%s, %s, %s, %s)
unregisterSymbol(%s)
registerSymbol(%s)]]
if type(START) == 'number' then
START = ('%X'):format(START) end
if type(END) == 'number' then
END = ('%X'):format(END) end
CODE = CODE:format( SYMBOL,
START, END, AOB, SYMBOL, SYMBOL )
local result = autoAssemble(CODE)
if not result then return nil end
return getAddress( SYMBOL )
end
-- ...
function zAddr( original, addsub, offset )
return '' .. (original or 0) .. addsub .. offset
end
-- ...
local pFoes = AOBScanRegion(
'pFoes',
"A0 A0 00 00 A1 2F", "D0000000", "DFFFFFFF" )
-- ...
local xFoeRdCap = zAddr( pFoes, '-', 'D6DC17AF' )
|
Note: Gonna go to Subway for breakfast while I wait so don't expect a quick reply
Edit: Found a way to fix it:
Code: |
-- Added these lines
local zFormat = string.format
function zNum2Hex( num )
if type(num) == 'number' then
num = zFormat( '%X', num ) end
return num
end
-- And changed zAddr to this:
function zAddr( base, addsub, offset )
base = zNum2Hex( base or 0 )
offset = zNum2Hex( offset or 0 )
return '' .. base .. addsub .. offset
end
|
_________________
Those who do not trust in christ to save them from their sins will only experience hell when their soul is released from it's earthly vessel. |
|