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 


On using instruction:find() to search for 'break and track'

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
kuukuuu
How do I cheat?
Reputation: 0

Joined: 19 Sep 2025
Posts: 7

PostPosted: Fri Sep 19, 2025 7:22 am    Post subject: On using instruction:find() to search for 'break and track' Reply with quote

I found a strange problem, I can't use instruction:find() to search for instructions that use [] addressing as source operands, such as:

mov eax,[esp+14]
call dword ptr[eax*8+005DD374]
jmp dword ptr[ebx*4+4CEE6C]

Even if I use:

instruction:find('.')~=nil

I can't make this kind of instruction highlight.
other instructions like:

mov [esp+20],eax

and others are fine.
But using a register value as a search criterion, like EBX == 0x0, can highlight all instructions.
emmm...Is this a bug?
Smile
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25785
Location: The netherlands

PostPosted: Sat Sep 20, 2025 12:42 am    Post subject: Reply with quote

as you mentioned in your previous post: you should have spend the time looking into lua

[ is a special in lua. You need to add a % in front of them so %[

_________________
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
View user's profile Send private message MSN Messenger
kuukuuu
How do I cheat?
Reputation: 0

Joined: 19 Sep 2025
Posts: 7

PostPosted: Sat Sep 20, 2025 3:10 am    Post subject: Reply with quote

I did catch up on a little LUA,So I also tried instruction:find('%[')~=nil
However, it can only highlight instructions like mov [esi+00d27714],edi , while mov edi,[esi+00d27714] cannot be highlighted.
Is there a bug with the Cheat Engine version I downloaded?(Not the official version,I won't compile from source) Embarassed
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25785
Location: The netherlands

PostPosted: Sat Sep 20, 2025 5:54 am    Post subject: Reply with quote

try
Code:

instruction:find('[',true)~=nil

_________________
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
View user's profile Send private message MSN Messenger
kuukuuu
How do I cheat?
Reputation: 0

Joined: 19 Sep 2025
Posts: 7

PostPosted: Sat Sep 20, 2025 6:47 am    Post subject: Reply with quote

It still doesn't work, it will pop up the lua engine window with a lot of 【error:[string ".."]:4: bad argument #2 to 'find" (number expected, got boolean)】output

I downloaded an English version of CE 7.4, but this is still the case


Maybe the Cheat Engine version I'm using is too old... I tried to replace true with 1, but the lua engine still outputs the error messages
Error:[string "..."]:4: malformed pattern (missing ']').

I also tried the condition
instruction:find('%[',1)~=nil
so that the lua engine would not give an error, but i'm back to the old situation , where I can only highlight mov [esi+00d27714],edi and not highlight mov edi,[esi+00d27714] . Confused



PixPin_2025-09-20_20-40-21.png
 Description:
 Filesize:  310.01 KB
 Viewed:  141 Time(s)

PixPin_2025-09-20_20-40-21.png


Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4696

PostPosted: Sat Sep 20, 2025 10:09 am    Post subject: Reply with quote

`plain` is the fourth parameter to string.find. Third if you use `:`
Code:
instruction:find('[', nil, true)


In the picture, is there a space in the pattern? I can't tell because of the font.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
kuukuuu
How do I cheat?
Reputation: 0

Joined: 19 Sep 2025
Posts: 7

PostPosted: Sat Sep 20, 2025 2:38 pm    Post subject: Reply with quote

ParkourPenguin wrote:
`plain` is the fourth parameter to string.find. Third if you use `:`
Code:
instruction:find('[', nil, true)


In the picture, is there a space in the pattern? I can't tell because of the font.


If I use search condition
Code:
instruction:find('[', nil, true)~=nil

The search works, but the previous problem remains unsolved and is still not useful for instructions like
Code:
mov ecx,[00EE59A0]

that have [] as their source operand.

Is there no such trouble in your Cheat Engine? Maybe it's just my personal computer environment problem. Embarassed
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25785
Location: The netherlands

PostPosted: Sat Sep 20, 2025 3:31 pm    Post subject: Reply with quote

no problem in mine, and technically there should be no reason at all for that

open lua engine : ctrl+alt+L anywhere in CE, and paste in
Code:

s='mov ecx,[00EE59A0]'
return s:find('[',nil,true)~=nil

it should return true

_________________
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
View user's profile Send private message MSN Messenger
kuukuuu
How do I cheat?
Reputation: 0

Joined: 19 Sep 2025
Posts: 7

PostPosted: Sat Sep 20, 2025 4:56 pm    Post subject: Reply with quote

Dark Byte wrote:
no problem in mine, and technically there should be no reason at all for that

open lua engine : ctrl+alt+L anywhere in CE, and paste in
Code:

s='mov ecx,[00EE59A0]'
return s:find('[',nil,true)~=nil

it should return true


Yes, when I run this code in the lua engine, the output is:
Code:
s='mov ecx,[00EE59A0]'
return s:find('[',nil,true)~=nil

1:true


Oh! No more problems! After some try I managed to install the latest version and now I can normally highlight instructions like mov ecx,[00EE59A0]!

Thank you for your help! Very Happy
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 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