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 


Having issues with a teleport script

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

Joined: 06 Apr 2023
Posts: 2

PostPosted: Thu Apr 06, 2023 4:38 pm    Post subject: Having issues with a teleport script Reply with quote

So for full context - I'm trying to create a teleport script for Ratchet and Clank 2: Going Commando running in the RPCS3 emulator. Already got my big endian scans set up, found the player co-ords. Manually editing them moves the player character around accordingly. I wanted to write a script that allows you to teleport to POIs on each planet when you check the box on the associated header. I have already found the base address .for the co-ordinates

However I'm struggling with this a little bit and currently if I check the box I get a "Not all instructions could be injected" error and it freezes my game for around 5 seconds before the emulator crashes. Maybe it's to do with the emulator and what I want to do just can't be done with it, however in case it's my code, here it is:

Code:
[ENABLE]
aobscan(tele1,0F 38 F0 0C 13 48 89 45 38 * * * * * * * * 0F 38 F0 4C 13 08 48) // should be unique
alloc(newmem,$1000,tele1)
label(code)
label(return)
label(hbk_tele)
label(en_hbk)
registersymbol(en_hbk)

hbk_tele:
  mov [rbx+rdx+24], 272.9180298
  mov [rbx+rdx+28], 56
  mov [rbx+rdx+20], 385.1850586
  jmp code


en_hbk:
  dd 0
  jmp code

newmem:
  cmp [en_hbk],1
  jmp code

code:
  movbe ecx,[rbx+rdx]
  jmp return

tele1:
  jmp newmem
return:
registersymbol(tele1)

[DISABLE]

tele1:
  db 0F 38 F0 0C 13

unregistersymbol(tele1)
unregistersymbol(en_hbk)
dealloc(newmem)
Back to top
View user's profile Send private message  
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Thu Apr 06, 2023 5:40 pm    Post subject: Reply with quote

If I am understanding you correctly, I suspect that there are better ways to go about this.

It is better if you use the built-in injection templates (full or AOB) so that we can have a fuller picture of what is going on.

You will want to declare float type in your script, for your values:


Code:
hbk_tele:
  mov [rbx+rdx+24], (float) 272.9180298
  mov [rbx+rdx+28], (float) 56
  mov [rbx+rdx+20], (float) 385.1850586
  jmp code


You will want to check and make sure that the AOB signature is truly unique.

You will also want to make sure that the instruction that you are using for your injection point is not accessing unwanted addresses.
Back to top
View user's profile Send private message  
BabyMephi
How do I cheat?
Reputation: 0

Joined: 06 Apr 2023
Posts: 2

PostPosted: Thu Apr 06, 2023 6:19 pm    Post subject: Reply with quote

++METHOS wrote:
If I am understanding you correctly, I suspect that there are better ways to go about this.

It is better if you use the built-in injection templates (full or AOB) so that we can have a fuller picture of what is going on.

You will want to declare float type in your script, for your values:


Code:
hbk_tele:
  mov [rbx+rdx+24], (float) 272.9180298
  mov [rbx+rdx+28], (float) 56
  mov [rbx+rdx+20], (float) 385.1850586
  jmp code


You will want to check and make sure that the AOB signature is truly unique.

You will also want to make sure that the instruction that you are using for your injection point is not accessing unwanted addresses.


I had to remove the spaces after (float) to clear up a quick syntax error. For reference, I've been using the AOB injection template. I'm now getting an <<Error while scanning AOB's : tele1 Error: Not all results found>> which I wasn't getting before.
Back to top
View user's profile Send private message  
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Thu Apr 06, 2023 6:31 pm    Post subject: Reply with quote

BabyMephi wrote:
I had to remove the spaces after (float) to clear up a quick syntax error.
-Yes. Sorry.

BabyMephi wrote:
For reference, I've been using the AOB injection template.
-You should have more information in your script?

BabyMephi wrote:
I'm now getting an <<Error while scanning AOB's : tele1 Error: Not all results found>> which I wasn't getting before.
-Signatures can be tricky with emulators. I've no experience with this one, so I cannot say what is possible.

I would close everything out and reopen. Perform your scan manually and remove bytes until you have results. You may need to incorporate more wildcard entries and expand on the signature.
Back to top
View user's profile Send private message  
ParkourPenguin
I post too much
Reputation: 150

Joined: 06 Jul 2014
Posts: 4657

PostPosted: Thu Apr 06, 2023 9:16 pm    Post subject: Reply with quote

Are you sure you should be using code injection in the first place? If you want to teleport somewhere and you already have the addresses of your coordinates, it would be easier to just write some values directly from CE. e.g. a Lua script that uses writeFloat

If you want to fix your AA script, start by reading this post:
https://forum.cheatengine.org/viewtopic.php?p=5783825#5783825

_________________
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  
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