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 


Is there an opposite built-in function for 'assert()'

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
skynet888
!BEWARE! Deletes post on answer
Reputation: 1

Joined: 12 Apr 2021
Posts: 97

PostPosted: Thu Oct 01, 2026 5:27 am    Post subject: Is there an opposite built-in function for 'assert()' Reply with quote

assertnot(Address, ArrayOfBytes)

Will check the memory address for the given bytes. If the address's memory is not what is defined by the array of bytes given, the auto assemble script will execute.
Back to top
View user's profile Send private message
Csimbi
I post too much
Reputation: 99

Joined: 14 Jul 2007
Posts: 3432

PostPosted: Thu Oct 01, 2026 11:30 am    Post subject: Reply with quote

Why bother then? The AA script would execute whether the bytes are good or bad.

Technically, what you wrote is not the opposite though.
The opposite would be:
Quote:
If the address's memory is what is defined by the array of bytes given, the auto assemble script will execute.

Not that it matters because the result is the same - script executes either way.
Back to top
View user's profile Send private message
skynet888
!BEWARE! Deletes post on answer
Reputation: 1

Joined: 12 Apr 2021
Posts: 97

PostPosted: Thu Oct 01, 2026 5:44 pm    Post subject: Reply with quote

Csimbi wrote:
Why bother then? The AA script would execute whether the bytes are good or bad.

Technically, what you wrote is not the opposite though.
The opposite would be:
Quote:
If the address's memory is what is defined by the array of bytes given, the auto assemble script will execute.

Not that it matters because the result is the same - script executes either way.


assertnot(Address, FF)
assertnot(Address, ArrayOfBytes)

Will check the memory address for the given bytes. If the address's memory is what is defined by the array of bytes given, the auto assemble script will not execute.
[ENABLE]
assert(address, FF)
[DISABLE]
assertnot(address, FF)
Back to top
View user's profile Send private message
Csimbi
I post too much
Reputation: 99

Joined: 14 Jul 2007
Posts: 3432

PostPosted: Fri Oct 02, 2026 2:42 pm    Post subject: Reply with quote

Ah, I see. That makes sense. How'd you restore the wrong bytes though?
Back to top
View user's profile Send private message
skynet888
!BEWARE! Deletes post on answer
Reputation: 1

Joined: 12 Apr 2021
Posts: 97

PostPosted: Fri Oct 02, 2026 10:34 pm    Post subject: Reply with quote

Csimbi wrote:
Ah, I see. That makes sense. How'd you restore the wrong bytes though?

The "address" in the sample code above does not necessarily refer to the injected address. It may also be the address of a toggle variable or a user-defined state variable. Even if `address` does represent the injected address, `assertnot()` still has value: it improves the robustness of the script, as shown below:

[ENABLE]
assert(address, 8B FF 55 8B EC)
[DISABLE]
assertnot(address, 8B FF 55 8B EC)
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