| View previous topic :: View next topic |
| Author |
Message |
AylinCE Grandmaster Cheater Supreme
Reputation: 37
Joined: 16 Feb 2017 Posts: 1543
|
Posted: Thu Jan 15, 2026 5:04 pm Post subject: Is there a technical way to index pointers? |
|
|
Here's a question for those using pointers! (I'm not very familiar with pointers, as I'm more interested in the Lua side of CE.)
There are 2 possible outcomes a user might want:
| Code: | -- Scenario 1:
[[[executable.exe+00A1B2C3]+10D2SC]+20]+30
-- Scenario 2:
[[[[executable.exe]+00A1B2C3]+10D2SC]+20]+30 |
But all we have is the plain text:
| Code: | | executable.exe+00A1B2C3+10D2SC+20+30 |
Now the question is:
What is the correct approach to sum this up and wrap it in square brackets? (readPointer(executable.exe+00A1B2C3) or another approach...)
I could try parsing it superficially with Lua:
| Code: | input = 'executable.exe+00A1B2C3+10D2SC+20+30'
local bs = ""
local firstPart = true
for p in input:gmatch("[^%+]+") do
if firstPart then
if #p>5 then
if bs=="" then bs=p else firstPart=false p=bs.."+"..p print(p) end
end
else
print(p)
end
end |
result:
| Code: | executable.exe+00A1B2C3
10D2SC
20
30 |
But I'm not sure about its accuracy, or this variation will backfire if there are more than 6 inputs.
Is there a more technical way to properly parse this?
_________________
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25861 Location: The netherlands
|
Posted: Thu Jan 15, 2026 6:08 pm Post subject: |
|
|
if the user enters it as "executable.exe+00A1B2C3+10D2SC+20+30" then it's up to you to handle it the way you wish as there's no design for strings like that except just addition calculation
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
AylinCE Grandmaster Cheater Supreme
Reputation: 37
Joined: 16 Feb 2017 Posts: 1543
|
Posted: Thu Jan 15, 2026 8:15 pm Post subject: |
|
|
Ah... I'll choose this one. This is wonderful!
Since there's no formal design for parsing plain text strings, I implemented logic that treats 'Module + Initial Offset' as a single Base unit when a module extension (.exe/.dll) is detected.
This can prevent the static offset from being treated as a dynamic pointer offset in the Address List.
| Code: | --- Technically safest way to parse plain strings without formal brackets.
-- Standardizes: Module+Offset as a single Base unit.
function parsePlainPointer(input)
local parts = {}
local temp = {}
for p in input:gmatch("[^%+]+") do table.insert(temp, p) end
-- DarkByte's Choice: How to decide what is 'Base' vs 'Offset'?
-- Decision: If part 1 is a module OR part 2 is a static-sized Hex, they are the Base.
if #temp >= 2 and (temp[1]:find("%.") or #temp[2] > 5) then
table.insert(parts, temp[1] .. "+" .. temp[2]) -- Married Base
for i = 3, #temp do table.insert(parts, temp[i]) end
else
table.insert(parts, temp[1]) -- Simple Base
for i = 2, #temp do table.insert(parts, temp[i]) end
end
return parts
end |
Final Module:
https://forum.cheatengine.org/viewtopic.php?p=5794483
_________________
|
|
| Back to top |
|
 |
|