Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Bug? in manual address expression calculator ??

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
peddroelm
Advanced Cheater
Reputation: 0

Joined: 03 Oct 2014
Posts: 84

PostPosted: Fri May 22, 2020 7:47 am    Post subject: Bug? in manual address expression calculator ?? Reply with quote

EC_Start is user defined symbol ([[[[TLR.exe+0x01DB04E0] + 0x3C] + 0x3C] + 0xEC * 0x34 + 0x2C])


{$lua}
U_NR = (I manually set from 1 to 5)
U_IDX = (I manually set from 1 to 5)


Using this expression as address (add address manually)
EC_start + 0x2BC * (U_NR -1) + 2 *( U_IDX -1) + 0xE

Works UNLESS U_NR == 1 or U_IDX == 1...then ?? cannot calculate address

Tried it with

{$lua}
U_NR = (manually from 0 to 4)
U_IDX = (manually from 0 to 4)

And expression
EC_start + 0x2BC * U_NR + 2 * U_IDX + 0xE
in manual address field. Same error (??) when U_NR or U_IDX ==0 ..

BUT "EC_start + 0x2BC * 0 + 2 * 0 + 0xE " WORKS ?!?!
Back to top
View user's profile Send private message
peddroelm
Advanced Cheater
Reputation: 0

Joined: 03 Oct 2014
Posts: 84

PostPosted: Fri May 22, 2020 9:58 pm    Post subject: Reply with quote

simpler example

EC_start+2BC*U_NR in the address field works as long as U_NR is not ZERO

EC_start+2BC*0 also works

What is this madness and how do I get around it ?
Back to top
View user's profile Send private message
peddroelm
Advanced Cheater
Reputation: 0

Joined: 03 Oct 2014
Posts: 84

PostPosted: Sat May 23, 2020 11:55 am    Post subject: ...And this Works (resolves into the proper address) Reply with quote

so this works even when U_NR==1
EC_start+(U_NR-1)*0x2bc+(U_IDX-1)*2+0xE

If you're gonna multiply a variable that can be zero and a constant in the address field , put the variable first ... Whatever works ...

EDIT: spoke too soon

EC_start+(U_NR-1)*0x2BC+(U_IDX-1)*2+0xE // WORKS
//next address bellow
EC_start+(U_NR-1)*0x2BC // DOESN't work ?!?!
//next address bellow resolves
EC_start+(U_NR-1)*0x2BC + 0x1 // ?!?!?!?


///////////////
////////////////
so
EC_start+(U_NR-1)*0x2BC // DOESN't work ?!?!

but

EC_start+(U_NR-1)*0x2BC +1 -1 // WORKS

///////////
/////////////
EDIT:

and this allows for ONE of them (either U_NR or U_IDX) to be 1 BUT NOT BOTH in the same time Sad(

Code:
[strings_start + [24_start + wordptr[106_start + wordptr[F5_start + wordptr[EE_start + wordptr[EC_start + (U_NR-1) * 0x2BC + (U_IDX-1)*0x2 + 0xE] * 0x2D4 + 0xA] * 0x210  + 0x4] * 0x80 + 0] * 0x14 + 0] * 0xC + 0]


So I cannot display the stats of the position 0,0 character in the matrix of characters .. Which is a big deal for the times you only have 1 character ..
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites