| View previous topic :: View next topic |
| Author |
Message |
makotech222 Expert Cheater
Reputation: 0
Joined: 12 May 2011 Posts: 199
|
Posted: Tue Oct 01, 2019 10:32 pm Post subject: Pointer isn't updating when dependant address is updated |
|
|
I have a address where i'm editing a value, and this value should be used to update pointer offsets. Problem is, the updating of pointer offset never seems to occur. Below is a shortened snippet of my ct file.
| Code: |
<CheatEntry>
<ID>5486</ID>
<Description>"Character"</Description>
<DropDownList DescriptionOnly="1" DisplayValueAsItem="1">
1:Test
2:Second Test
</DropDownList>
<LastState Value="00000000" RealAddress="09410000"/>
<ShowAsHex>1</ShowAsHex>
<VariableType>4 Bytes</VariableType>
<Address>iPartySlot</Address>
<CheatEntries>
<CheatEntry>
<ID>5487</ID>
<Description>"Level"</Description>
<VariableType>2 Bytes</VariableType>
<Address>pOffsetPtr</Address>
<Offsets>
<Offset>[QtyOffset]+[iPartySlot]-1C</Offset>
</Offsets>
</CheatEntry>
|
So, when i change my dropdown, it should update where the second cheat entry is pointing to, but it doesn't update the value for [iPartySlot]. IPartySlot stays equal to 0.
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25807 Location: The netherlands
|
Posted: Tue Oct 01, 2019 11:26 pm Post subject: |
|
|
Rightclick the offset and choose the way it should update.
_________________
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 |
|
 |
makotech222 Expert Cheater
Reputation: 0
Joined: 12 May 2011 Posts: 199
|
Posted: Tue Oct 01, 2019 11:44 pm Post subject: |
|
|
Slightly better. I changed the offset to use both ways to update
<Offset Interval="1000" UpdateOnFullRefresh="1">
It still doesn't really update automatically. I have to double click on the address and then close the window before the value updates. The timer doesn't seem to force update either.
Edit: Side note, why is this window popup not resizeable? Its so tiny! This is the updating address window you get when you double click on an address.
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25807 Location: The netherlands
|
Posted: Wed Oct 02, 2019 1:38 am Post subject: |
|
|
Try interval only
Also, does it update when you cancel the change? because it can be a display thing and internally it does the right address
_________________
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 |
|
 |
makotech222 Expert Cheater
Reputation: 0
Joined: 12 May 2011 Posts: 199
|
Posted: Wed Oct 02, 2019 9:05 am Post subject: |
|
|
Tried interval only. No go. If I press cancel on the window, it doesn't update. If I press Okay, it updates.
This is on CE 7.0 x64, btw.
|
|
| 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: Wed Oct 02, 2019 5:26 pm Post subject: |
|
|
| makotech222 wrote: | | Edit: Side note, why is this window popup not resizeable? Its so tiny! |
I'm using custom CE where that window is bigger (edtOffset width * 8):
I ported it to Lua extension. Create .lua file inside autorun folder and paste this code (CE7.0):
| Code: | if cheatEngineIs64Bit() then
local script=[[aobscanmodule(edtOffset_GetTextWidth,00400000,48 8D 15 xx xx xx xx E8 xx xx xx xx 89 C2 48 8B 4B 38 E8)
registersymbol(edtOffset_GetTextWidth)
alloc(newmem,$1000,00400000)
label(return)
newmem:
imul eax,eax,8 // multiply calculated value by 8
mov edx,eax
mov rcx,[rbx+38]
jmp return
edtOffset_GetTextWidth+C:
jmp newmem
nop
return:]]
autoAssemble(script,true)
else
local script=[[aobscanmodule(edtOffset_GetTextWidth,00400000,BA xx xx xx xx E8 xx xx xx xx 89 C2 8B 43 1C E8)
registersymbol(edtOffset_GetTextWidth)
alloc(newmem,$1000)
label(return)
newmem:
imul eax,eax,8 // multiply calculated value by 8
mov edx,eax
mov eax,[ebx+1C]
jmp return
edtOffset_GetTextWidth+A:
jmp newmem
return:]]
autoAssemble(script,true)
end
|
_________________
|
|
| Back to top |
|
 |
makotech222 Expert Cheater
Reputation: 0
Joined: 12 May 2011 Posts: 199
|
Posted: Thu Oct 03, 2019 4:36 pm Post subject: |
|
|
| Nice, thanks for that!
|
|
| Back to top |
|
 |
makotech222 Expert Cheater
Reputation: 0
Joined: 12 May 2011 Posts: 199
|
Posted: Fri Oct 04, 2019 8:30 am Post subject: |
|
|
| Okay can confirm this is a regression in CE 7.0. I downgraded to 6.7, and it was working properly.
|
|
| 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: Fri Oct 04, 2019 2:36 pm Post subject: |
|
|
pOffsetPtr
QtyOffset
iPartySlot
All of them are user registered symbols? Registered with AA command registersymbol() or Lua function registerSymbol().
Keep in mind that [iPartySlot] used in offset will read 4bytes in 32bit targets and 8bytes in 64bit targets.
What is iPartySlot? Is it address of your allocated memory? If yes, make sure you use it as 4bytes for 32bit targets, or just use 8bytes for 32bit and 64bit targets.
| Code: |
iPartySlot:
dd 0
or
iPartySlot:
dq 0 |
EDIT:
OK I created a script to test this issue with any process attached:
| Code: | <?xml version="1.0" encoding="utf-8"?>
<CheatTable>
<CheatEntries>
<CheatEntry>
<ID>1</ID>
<Description>"test complex PTR"</Description>
<LastState/>
<VariableType>Auto Assembler Script</VariableType>
<AssemblerScript>{$strict}
[ENABLE]
alloc(newmem,$1000)
label(pOffsetPtr)
label(QtyOffset)
label(iPartySlot)
registersymbol(pOffsetPtr)
registersymbol(QtyOffset)
registersymbol(iPartySlot)
newmem:
pOffsetPtr:
dq newmem+600
QtyOffset:
dq 100
newmem+700:
dd #5 //iPartySlot 0 level
dd #8 //iPartySlot 1 level
dd #13 //iPartySlot 2 level
dd #21 //iPartySlot 3 level
newmem+F00:
iPartySlot:
dq 0
[DISABLE]
dealloc(newmem)
unregistersymbol(pOffsetPtr)
unregistersymbol(QtyOffset)
unregistersymbol(iPartySlot)
</AssemblerScript>
<CheatEntries>
<CheatEntry>
<ID>2</ID>
<Description>"iPartySlot"</Description>
<DropDownList ReadOnly="1" DescriptionOnly="1" DisplayValueAsItem="1">0:slot0
1:slot1
2:slot2
3:slot3
</DropDownList>
<VariableType>8 Bytes</VariableType>
<Address>iPartySlot</Address>
</CheatEntry>
<CheatEntry>
<ID>3</ID>
<Description>"complex ptr"</Description>
<VariableType>4 Bytes</VariableType>
<Address>pOffsetPtr</Address>
<Offsets>
<Offset Interval="100">[QtyOffset]+[iPartySlot]*4</Offset>
</Offsets>
</CheatEntry>
<CheatEntry>
<ID>4</ID>
<Description>"complex address"</Description>
<VariableType>4 Bytes</VariableType>
<Address>[pOffsetPtr]+[QtyOffset]+[iPartySlot]*4</Address>
</CheatEntry>
</CheatEntries>
</CheatEntry>
</CheatEntries>
</CheatTable>
|
I also tested my older scripts with complex PTRs. Looks like something is wrong with CE.
"complex ptr" doesn't work
"complex address" works
EDIT2:
@DB
MemoryRecordUnit.pas
| Code: | procedure TMemrecOffset.setOffsetText(s: string);
var
e: boolean;
s2: string;
stack: integer;
begin
funparsed:=true;
cleanupluaref;
text:=s;
special:=false;
try
foffset:=StrToQWordEx(ConvertHexStrToRealStr(s));
funparsed:=false;
exit;
except
foffset:=symhandler.getAddressFromNameShallow(s, false, e);
if not e then
begin
funparsed:=false;
exit;
end;
end;
...
...
|
Looks like more complex offsets, such as this one "[QtyOffset]+[iPartySlot]*4", are not treated as "special".
But, the same offset in formAddressChangeUnit form is treated as "special" (because StrToQWordEx failed).
What do you think about this patch:
| Code: | Index: MemoryRecordUnit.pas
===================================================================
--- MemoryRecordUnit.pas (wersja 4442)
+++ MemoryRecordUnit.pas (kopia robocza)
@@ -621,10 +621,11 @@
cleanupluaref;
text:=s;
- special:=false;
+ special:=true;
try
foffset:=StrToQWordEx(ConvertHexStrToRealStr(s));
+ special:=false;
funparsed:=false;
exit;
except
@@ -637,8 +638,6 @@
end;
- special:=true;
-
//parse it as lua (because that can be called by ref, which is faster, and gets the memrec and address variables), if that fails, try the symbolhandler
s2:='local memrec, address=... ; return '+s;
stack:=lua_Gettop(luavm);
|
_________________
|
|
| 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: Sun Oct 06, 2019 4:05 am Post subject: |
|
|
@makotech222
For now, just use this:
Or this:
_________________
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25807 Location: The netherlands
|
Posted: Sun Oct 06, 2019 5:32 am Post subject: |
|
|
I'll look into it (when i have time, likely after my wedding)
_________________
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 |
|
 |
mgr.inz.Player I post too much
Reputation: 222
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Sun Oct 06, 2019 7:28 am Post subject: |
|
|
Don't know if you want to treat all offsets which are successfully parsed by getAddressFromNameShallow function as special.
I think we can add another MemoryRecord property: fThisOffsetIsFrequentlyUpdatedByUser.
I think I can prepare a PR commit today.
_________________
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25807 Location: The netherlands
|
Posted: Sun Oct 06, 2019 8:58 am Post subject: |
|
|
we have to be careful with this as reinterpreting is slow and some tables have a thousand pointers each with 5 offsets or more
Only reinterpret offsets when it is absolutely necesary
_________________
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 |
|
 |
mgr.inz.Player I post too much
Reputation: 222
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Sun Oct 06, 2019 11:02 am Post subject: |
|
|
Currently, all MemrecOffset which are Lua scripts are reinterpreted (and there's no "no-update" rule set by default).
OK, Instead of MemoryRecord property, it will be MemrecOffset property. I think this would be OK.
MemrecOffset property "FrequentlyUpdatedByUser" set to false by default. XML attribute - "FrequentlyUpdated".
If user has much more pointers with offset FrequentlyUpdatedByUser set to true, then we can suggest to also use one of "no-update" (OnlyUpdateAfterInterval or OnlyUpdateWithReinterpret) rules.
The patch will be (waiting to send this PR): https://github.com/cheat-engine/cheat-engine/compare/master...mgrinzPlayer:MemrecOffsetFrequentlyUpdatedByUser?expand=1
It is backward compatible with older CT files.
_________________
|
|
| Back to top |
|
 |
|