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 


Script on DAI

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

Joined: 16 Sep 2020
Posts: 1

PostPosted: Wed Sep 16, 2020 1:56 pm    Post subject: Script on DAI Reply with quote

Hello, new here.

Been using Cheat Engine for quite some time but never extensively with lua scripts. After exploring some C# for some college courses thought I'd try my hand. Keep in mind I am under a novice in both lua and C# regards.

So to the topic at hand: Trying to create a script to make a 1 hit kill on dmg to only enemies for DA:I (Dragon Age: Inquisition) been through a few different variations including AOB but I think if I want this same script to work even after closing the game and reopening I need this format instead. So, this is what I have now:

ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat

alloc(newmem,2048,"DragonAgeInquisition.exe"+36BF102)
label(returnhere)
label(originalcode)
label(exit)

newmem: //this is allocated memory, you have read,write,execute access
cmp [rbx+00c0],0
je kill

kill:
mov [rbx+30],0
jmp exit

originalcode:
movss [rbx+30],xmm6


exit:
jmp returnhere

"DragonAgeInquisition.exe"+36BF102:
jmp newmem
returnhere:



[DISABLE]
//code from here till the end of the code will be used to disable the cheat


I am missing something big. This script causes several things to happen. One I am unable to dmg enemies and them me, everyone gets full shield and guard, and I am unable to move except for attacking.

Any help is appreciated, thanks in advance.

Gravity.
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 156

Joined: 25 Jan 2006
Posts: 8046
Location: 127.0.0.1

PostPosted: Wed Sep 16, 2020 4:17 pm    Post subject: Reply with quote

This is not Lua related, moved to General Gamehacking. (This is CE's auto-assembler, not Lua just a heads up.)
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
ParkourPenguin
I post too much
Reputation: 81

Joined: 06 Jul 2014
Posts: 2722

PostPosted: Wed Sep 16, 2020 4:21 pm    Post subject: Reply with quote

Perhaps an obvious point, but this is neither C# nor Lua.

Try walking through this the same way the game would.
It's running along as normal, and then it comes to the code you changed at the injection point:
Code:
"DragonAgeInquisition.exe"+36BF102:
  jmp newmem
The cpu does as it's told and jumps to newmem.
In newmem:
Code:

newmem:
  cmp [rbx+00c0],0
  je kill
kill:
  mov [rbx+30],0
  jmp exit
...

If the comparison [rbx+c0] == 0 is true, then it will jump to the label kill. If it's not true, then it won't jump and will instead execute the next instruction... which is where the label kill is, so the entire comparison is pointless.

Better:
Code:
newmem:
  cmp [rbx+00c0],0
jne originalcode
  mov [rbx+30],0
  jmp exit
originalcode:
  movss [rbx+30],xmm6
exit:
  jmp returnhere

_________________
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
Gravity
How do I cheat?
Reputation: 0

Joined: 16 Sep 2020
Posts: 1

PostPosted: Thu Sep 17, 2020 10:55 pm    Post subject: Reply with quote

Oh, thanks for your reply.

I see what your saying I was telling it to jump to something it was going to do anyways.

This is why regardless if it was enemy or not everything was dying including myself. And your revised code jumps over the kill instruction if my cmp is true.

Thanks for the clear instructions.

Furthermore, now I have max shields, guard, health, can't move, and everything dies once it comes into the screen. Progress though! Any idea where I should go from here?

Gravity.

Edit: Update.

I found I was injecting this at the wrong address and that is why a lot of the random things were happening. I have fixed that now, but enemies are still dying as they come into the screen as opposed to when I hit them. I attempted to use

sub [rbx+30],900000

instead of the mov command, but this didn't seem to help.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking 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