| View previous topic :: View next topic |
| Author |
Message |
sir-gunny Advanced Cheater
Reputation: 0
Joined: 15 Mar 2012 Posts: 82
|
Posted: Tue Feb 06, 2024 1:33 pm Post subject: AA: assert() with a type-cast address don't work |
|
|
Hi.
For some reason assert() wont work with a type-cast address. If i use the type-cast string at disassembler or hex-browser it point/jump to the correct address. The aob at this address are also correct but the assert() check wont start the script.
| Code: | | assert(gameSymbol+5+(LONG)[gameSymbol+1]+0x47, 11 22 33 FF) |
|
|
| Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4719
|
Posted: Tue Feb 06, 2024 2:08 pm Post subject: |
|
|
Parsing bug
Cheat Engine/autoassembler.pas:
| Code: | if uppercase(copy(currentline,1,7))='ASSERT(' then //assert(address,aob)
begin
if not syntaxcheckonly then
begin
a:=pos('(',currentline);
b:=pos(',',currentline);
c:=pos(')',currentline);
if (a>0) and (b>0) and (c>0) then
begin
s1:=trim(copy(currentline,a+1,b-a-1));
s2:=trim(copy(currentline,b+1,c-b-1));
...
|
Basically, CE looks for the first occurrence of ')' and assumes it's the end of `assert(...)`
Use {$lua} as a workaround:
| Code: | {$lua}
if syntaxcheck then
return 'define(address,0)'
end
local address = getAddress'gameSymbol+5+(LONG)[gameSymbol+1]+0x47'
return ('define(address,%X)'):format(address)
{$asm}
assert(address,12 34 56 78) |
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
| Back to top |
|
 |
sir-gunny Advanced Cheater
Reputation: 0
Joined: 15 Mar 2012 Posts: 82
|
Posted: Wed Feb 07, 2024 4:18 am Post subject: |
|
|
Ah, ok. Nice to know. Thanks.
Btw. Do the other functions then have the same bug? I tried it before with define(), but that didn't work either. |
|
| Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4719
|
Posted: Wed Feb 07, 2024 11:56 am Post subject: |
|
|
`define` is similar to a preprocessor macro substitution. It doesn't evaluate any addresses or anything- it just substitutes some text for some other text. Copying and pasting, if you will.
There's a weird interaction between `registersymbol` and `define` where it does have address semantics, but I'm pretty sure it's not helpful here. _________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
| Back to top |
|
 |
|