 |
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
markheloking Cheater
Reputation: 2
Joined: 21 Nov 2009 Posts: 35
|
Posted: Thu Jan 14, 2016 2:32 pm Post subject: |
|
|
Thank you very much. +rep for that solution right there.
|
|
Back to top |
|
 |
mgr.inz.Player I post too much
Reputation: 222
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Thu Jan 14, 2016 4:12 pm Post subject: |
|
|
Next revision of my previous script adds support for those:
- [sym1+100]+[sym2]*[sym3]
- [sym1+sym4*10]+[sym2]*[sym3]
and nested pointers, i.e. pointer used as offset (or base) for another pointer:
- [sym1+[sym4]*10]+[sym2]*[sym3]
- [[sym1+[sym4]*10]+[sym2]*[sym3]]
revision 2:
Code: | skipMoreAdvancedLookup=false
function moreAdvancedLookup(s)
if skipMoreAdvancedLookup then return nil end
if s=='' then return end
local copyofs,result=s
for out in s:gmatch('%b[]') do
local address = string.format('%x',(readPointer(out:sub(2,-2)) or 0))
local out2=out:gsub('[.*+%%[-]','%%%1') -- escape more chars, forgot about it in rev1
copyofs=copyofs:gsub(out2,address)
end
skipMoreAdvancedLookup=true
local errorOnLookupFailureOldState=errorOnLookupFailure(false)
result=getAddress(copyofs)
errorOnLookupFailure(errorOnLookupFailureOldState)
skipMoreAdvancedLookup=false
return result
end
if moreAdvancedLookupID~=nil then unregisterSymbolLookupCallback(moreAdvancedLookupID) end
moreAdvancedLookupID = registerSymbolLookupCallback(moreAdvancedLookup, slNotInt) |
Because it allows nested pointers it is much slower.
If you don't need nested pointers support, use this instead:
Code: | skipMoreAdvancedLookup=false
function moreAdvancedLookup(s)
if skipMoreAdvancedLookup then return nil end
if s=='' then return end
local copyofs,result=s
skipMoreAdvancedLookup=true
for out in s:gmatch('%b[]') do
local address = string.format('%x',(readPointer(out:sub(2,-2)) or 0))
local out2=out:gsub('[.*+%%[-]','%%%1') -- escape more chars, forgot about it in rev1
copyofs=copyofs:gsub(out2,address)
end
--skipMoreAdvancedLookup=true
local errorOnLookupFailureOldState=errorOnLookupFailure(false)
result=getAddress(copyofs)
errorOnLookupFailure(errorOnLookupFailureOldState)
skipMoreAdvancedLookup=false
return result
end
if moreAdvancedLookupID~=nil then unregisterSymbolLookupCallback(moreAdvancedLookupID) end
moreAdvancedLookupID = registerSymbolLookupCallback(moreAdvancedLookup, slNotInt) |
Edit:
forgot local for errorOnLookupFailureOldState variable
Edit2:
readPointer instead of readInteger
_________________
Last edited by mgr.inz.Player on Thu Jan 14, 2016 7:04 pm; edited 2 times in total |
|
Back to top |
|
 |
markheloking Cheater
Reputation: 2
Joined: 21 Nov 2009 Posts: 35
|
Posted: Thu Jan 14, 2016 6:14 pm Post subject: |
|
|
Even more amazing! Thank you so much!
|
|
Back to top |
|
 |
|
|
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
|
|