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 


Write binary values through code injection

 
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: 29

PostPosted: Tue Mar 23, 2021 7:34 pm    Post subject: Write binary values through code injection Reply with quote

Hello everyone.

Is there a way to compare binary values using code injection?

I know I can use:

Code:
CMP Byte ptr [00000001],0F
CMP Word ptr [00000001],0FFF
CMP Dword ptr [00000001],0FFFFF0F
CMP Qword ptr [00000001],0FFFFFFFFFFFFFFF


But I can't use something like "Bit ptr".

If it's not possible through code injection I would like to know if is there a way to use a code available on the address list.

I tried this, but it didn't work

e.g

Code:
[ENABLE]
assert(address,bytes)
alloc(newmem,$500)

label(addresslistcode)
registersymbol(addresslistcode)

label(code)
label(return)
label(falt)


newmen:
code:
cmp [addresslistcode],1   //A pointer set as binary on the addresslist (Length = 10 and Startbit = 0)
jne activateweapon
jmp return

activateweapon:
MOV byte ptr [00140255],127

address:
  jmp newmem
return:

[DISABLE]
unregistersymbol(addresslistcode)

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

Joined: 06 Jul 2014
Posts: 4718

PostPosted: Tue Mar 23, 2021 8:00 pm    Post subject: Reply with quote

Processors access memory on a byte granularity. If you want bit granularity, you'll have to do that yourself with bitwise operators.

e.g. to compare bits 4..6 of edi with bits 2..3 of esi:
Code:
shr edi,4
shr esi,2
and edi,7
and esi,3
cmp edi,esi
...

_________________
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
Fatamorgen
Cheater
Reputation: 0

Joined: 17 Feb 2021
Posts: 29

PostPosted: Wed Mar 24, 2021 6:59 pm    Post subject: Reply with quote

ParkourPenguin wrote:
Processors access memory on a byte granularity. If you want bit granularity, you'll have to do that yourself with bitwise operators.

e.g. to compare bits 4..6 of edi with bits 2..3 of esi:
Code:
shr edi,4
shr esi,2
and edi,7
and esi,3
cmp edi,esi
...


I'll try that. Thanks Mr. Penguin
Watch out for batman.
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