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 


Shared Instruction / Script conflict?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
ZeiD.
Newbie cheater
Reputation: 0

Joined: 20 Jan 2019
Posts: 14
Location: Earth

PostPosted: Sun Jan 20, 2019 2:24 pm    Post subject: Shared Instruction / Script conflict? Reply with quote

Hello people . First of all this is my first post on the forums and I am not sure if this is the correct place to post this. Please let me know if I did something wrong here. I will make the necessary changes in future posts. With that being said let's get right into the question.

I am new to assembly scripts and I am probably doing something wrong here. I am watching a lot of videos to understand how things work.

The game that I am talking about is battlefield V single player. I have no interest in multiplayer cheating.

I wanted to make my character have unlimited health. I managed to do that by finding the correct health value and nopping the instruction (is that even the correct term?). It worked perfectly until i found out that the same ,nopped, instruction affected the enemy health aswell.

With a little bit of research I figured out how to make a script that compares values found in data structures and finds out if it's a player or an enemy that is being damaged. Everything is working just fine. Here is the code:


Code:

[ENABLE]
alloc(newmem,2048,"bfv.exe"+9F57DE6)
label(returnhere)
label(playerHealth)
label(originalcode)
label(exit)

newmem:
cmp [rbx+68],000D006D
je playerHealth
jmp originalcode

playerHealth:
nop
nop
nop
nop
nop
jmp exit

originalcode:
movss [rbx+20],xmm6
jmp exit

exit:
jmp returnhere

"bfv.exe"+9F57DE6:
jmp newmem
returnhere:

[DISABLE]
"bfv.exe"+9F57DE6:
movss [rbx+20],xmm6



The next thing i wanted to do was a "One Hit Kill" script. Luckily the same video i watched talked about that too. Here is the code:

Code:


[ENABLE]
alloc(newmem,2048,"bfv.exe"+9F57DE6)
label(returnhere)
label(originalcode)
label(oneHit)
label(exit)

newmem:
cmp [rbx+68],000D00A0
je oneHit
jmp originalcode

oneHit:
mov [rbx+20],0
jmp exit

originalcode:
movss [rbx+20],xmm6
jmp exit

exit:
jmp returnhere

"bfv.exe"+9F57DE6:
jmp newmem
returnhere:

[DISABLE]
"bfv.exe"+9F57DE6:
movss [rbx+20],xmm6



The problem that i have is that I can't enable both scripts at the same time. They don't work together. There must be a conflict whenever I activate one or another. (Both of them work fine on their own)

My question is: Is there any way to create two different scripts that can handle the above behaviours and work without conflicts? Should I look somewhere else besides that instruction?

_________________
I find pleasure in cheating Wink
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Sun Jan 20, 2019 3:10 pm    Post subject: Reply with quote

create some bytes/flags with registersymbol

then in the acript check if those bytes are set, and if so do the appropriate action

in ce you can then change the byte to 1 or 0 to activate/deactivate it

_________________
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
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4290

PostPosted: Sun Jan 20, 2019 3:23 pm    Post subject: Reply with quote

Those videos you're looking at seem to be doing more harm than good, but whatever works.

One way I've seen other people solve this is to make a master script and put child memory records under it that change flags, as DB said above.
Code:
define(address,"bfv.exe"+9F57DE6)
define(bytes,F3 0F 11 73 20)

[ENABLE]
assert(address,bytes)

alloc(newmem,2048,address)

label(checkPlayer)
label(originalcode)
label(exit)

label(invincible_f)
label(onehit_f)

label(returnhere)

registersymbol(invincible_f)
registersymbol(onehit_f)


newmem:
  cmp [rbx+68],000D00A0
  jne short checkPlayer
  cmp byte ptr[onehit_f],0
  je short checkPlayer
  mov [rbx+20],0
  jmp short exit
checkPlayer:
  cmp [rbx+68],000D006D
  jne short originalcode
  cmp byte ptr[invincible_f],0
  jne short exit
originalcode:
  movss [rbx+20],xmm6
exit:
  jmp returnhere

newmem+400:
invincible_f:
  db 0
onehit_f:
  db 0

address:
  jmp newmem
returnhere:

[DISABLE]
address:
  db bytes


dealloc(newmem)

unregistersymbol(invincible_f)
unregistersymbol(onehit_f)
Add the addresses "invincible_f" and "onehit_f" to the address list as byte values, drag them under this script, and do whatever else you want (e.g. hide them when script is deactivated, set dropdown selection options, etc.).
_________________
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
salumor
Advanced Cheater
Reputation: 0

Joined: 14 Jan 2019
Posts: 87

PostPosted: Sun Jan 20, 2019 3:33 pm    Post subject: Reply with quote

The problem: 2 scripts try to write to same address.

The answer to that is quite simple - use symbols that work globally. At best create 1 "Enable" script defining all entry points.

But I 'd rather suggest to use make use of https://wiki.cheatengine.org/index.php?title=Auto_Assembler:aobScanModule, as static offsets will likely change on game updates. Though then you'd need to reassamble code/offsets too. Thus take a look at https://forum.cheatengine.org/viewtopic.php?t=609288. So the endresult will be something like:

aobScanModule(PlayerHealth, bfv.exe, ** your array of bytes **)

From there ... several strategies are possible (f.e.):

- use just one script for everything
- alloc + registersymbol some space and from there create several scripts injecting like "playerhealth" "playerhealth+200" "playerhealth+400" ....
- make use of binary flags (the following code).
... (see below, after code, just basic instructions as you'd need to know what ur doing)

Code:
label(Health_Flag) // sorry had alloc(x,1) before XD
label(OHK_Flag)
registersymbol(Health_Flag)
registersymbol(OHK_Flag)

newmem:
  cmp byte ptr [Health_Flag], 0
  je short @f
//your code
@@:
  cmp byte ptr [OHK_Flag], 0
  je short @f
//your code
//you can define as many flags you want - if it's 1 it's executed, if 0, go on to next flag, anyway all flags are checked!
@@: //added as it would else may be unclear, but you could skip it too.

Health_Flag:
  db 0
OHK_Flag:
  db 0


personally I do like best to create 1 enable script that checks all entry points (incl. registersymbol) + readmems + disable points, then creating indiv. scripts to activate the scripts referincing above symbols. If there is just 1 instuction that references two scripts, I do inject sooner or later (depends on code), so I make sure all my aobscans have unique entry points, but everything can be enabled with the least ammount of clicks.


Last edited by salumor on Wed Jan 30, 2019 3:57 pm; edited 2 times in total
Back to top
View user's profile Send private message
ZeiD.
Newbie cheater
Reputation: 0

Joined: 20 Jan 2019
Posts: 14
Location: Earth

PostPosted: Mon Jan 21, 2019 5:34 am    Post subject: Reply with quote

Thank you all for the help. I believe that you all said pretty much the same thing but I tried the script from "ParkourPenguin" because it was the easiest for a newbie , like me, to understand and implement. It worked like a charm. See you in future posts Very Happy
_________________
I find pleasure in cheating Wink
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