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 


How can I mod binary values (bitflags) with assembly?

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

Joined: 17 Feb 2021
Posts: 30

PostPosted: Tue Feb 22, 2022 3:45 pm    Post subject: How can I mod binary values (bitflags) with assembly? Reply with quote

I want to inject a code using the assembly but I need only to change a bit flag on the address linked to it. The main problem is that I can only change bytes and not bit flags. Is there a way to change only the bitflags?
I want to change bit 7 only and not the entire byte.

Code:
define(address,"EEtc.exe"+1FE3B)
define(bytes,8B 86 AC 00 00 00)

[ENABLE]

assert(address,bytes)
alloc(newmem,$100)

label(code)
label(return)

newmem:

code:
  mov eax,[esi+000000AC]  //Something like mov binary ptr 7 [esi+000000AC],1
  jmp return

address:
  jmp newmem
  nop
return:

[DISABLE]

address:
  db bytes
dealloc(newmem)
[/code]
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 155

Joined: 06 Jul 2014
Posts: 4775

PostPosted: Tue Feb 22, 2022 5:14 pm    Post subject: Reply with quote

Memory can only be accessed up to a byte granularity

Use the instructions and, or, xor to unset, set, and flip bits respectively:
Code:
or byte ptr[esi+AC],80

_________________
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
Dark Byte
Site Admin
Reputation: 475

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

PostPosted: Tue Feb 22, 2022 5:29 pm    Post subject: Reply with quote

or:
Code:

bts [esi+ac],7

_________________
Tools give you results. Knowledge gives you control.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Fatamorgen
Cheater
Reputation: 0

Joined: 17 Feb 2021
Posts: 30

PostPosted: Wed Feb 23, 2022 8:39 am    Post subject: Reply with quote

Worked like a charm. Thanks Peng and Dark
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