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 to jump near allocated memory when there is long jump?

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

Joined: 06 Dec 2019
Posts: 41

PostPosted: Sat Aug 21, 2021 12:18 am    Post subject: How to jump near allocated memory when there is long jump? Reply with quote

in this 64 bit game, Final Fantasy XV, i'm trying to make infinite health and one hit kills, but when i activate the script it does a long jump (use larger allocated memory) which means my game could likely crash while enabling/disabling the script.

Is there a way to tell the script to jump 'near' or jump 'short' in allocated memory? How can I do it? I will post my script, if you have suggestion to add to my code to fix this large jump issue, please specify where I need to put the code you're telling me to edit. Thanks

Code:

[ENABLE]
aobscanmodule(health1,ffxv_s.exe,89 83 A0 01 00 00 41 D1 C8) // should be unique
alloc(newmem,$1000,"ffxv_s.exe"+1D5A41)
label(code)
label(return)
label(infhealth)
label(infhealth_flag)
label(ohk)
label(ohk_flag)
registersymbol(infhealth_flag)
registersymbol(ohk_flag)
registersymbol(health1)

newmem:
  cmp [rbx+180],#257    //player check
  je infhealth
  cmp byte ptr [ohk_flag],1
  je ohk
  jmp code

infhealth:
  cmp byte ptr [infhealth_flag],0
  je code

  push rcx
  mov rcx,[rbx+1A4]     // health cap
  mov [rbx+1A0],rcx     // current health
  pop rcx
  jmp return

code:
  mov [rbx+000001A0],eax         // original code
  jmp return

ohk:
  mov eax,0
  mov [rbx+000001A0],eax
  jmp return

infhealth_flag:
  db 0
ohk_flag:
  db 0

health1:
  jmp newmem
  nop
return:

[DISABLE]

health1:
  db 89 83 A0 01 00 00 41 D1 C8

unregistersymbol(health1)
unregistersymbol(infhealth_flag)
unregistersymbol(ohk_flag)
dealloc(newmem)
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Sat Aug 21, 2021 2:17 am    Post subject: Reply with quote

is kernelmode query memory regions enabled in settings? if so, disable that


alternatively, adjust your code that it assumes a 14 byte jmp and use jmp far newmem

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

Joined: 06 Dec 2019
Posts: 41

PostPosted: Sat Aug 21, 2021 7:04 pm    Post subject: Reply with quote

Dark Byte wrote:
is kernelmode query memory regions enabled in settings? if so, disable that


alternatively, adjust your code that it assumes a 14 byte jmp and use jmp far newmem


hmm you know kernel mode was on from the previous game I was working on and ever since that I've started having this issue (don't think I was having it before Rolling Eyes ).

Anyway, I did what you said. I put
Code:
health1:
  jmp far newmem
  nop
return:

[DISABLE]


ahh I can't post screenshots, but game is still crashing. The code looks like this now. Did I miss something? anything else I need to change?:


Code:
[ENABLE]
aobscanmodule(health1,ffxv_s.exe,89 83 A0 01 00 00 41 D1 C8) // should be unique
alloc(newmem,$1000,health1)
label(code)
label(return)
label(infhealth)
label(infhealth_flag)
label(ohk)
label(ohk_flag)
registersymbol(infhealth_flag)
registersymbol(ohk_flag)
registersymbol(health1)

newmem:
  cmp [rbx+180],#257    //player check
  je infhealth
  cmp [ohk_flag],1
  je ohk
  jmp code

infhealth:
  cmp [infhealth_flag],0
  je code

  push rcx
  mov rcx,[rbx+1A4]     // health cap
  mov [rbx+1A0],rcx     // current health
  pop rcx
  jmp far return

code:
  mov [rbx+000001A0],eax         // original code
  jmp far return

ohk:
  mov eax,0
  mov [rbx+000001A0],eax
  jmp far return

infhealth_flag:
  dd 0
ohk_flag:
  dd 0

health1:
//  "ffxv_s.exe"+1D5A41:
  jmp far newmem
  nop
return:

[DISABLE]

health1:
  db 89 83 A0 01 00 00 41 D1 C8

unregistersymbol(health1)
unregistersymbol(infhealth_flag)
unregistersymbol(ohk_flag)
dealloc(newmem)
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Sat Aug 21, 2021 7:18 pm    Post subject: Reply with quote

you're not executing all of the original code
_________________
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
themandem
Cheater
Reputation: 0

Joined: 06 Dec 2019
Posts: 41

PostPosted: Sat Aug 21, 2021 8:30 pm    Post subject: Reply with quote

Dark Byte wrote:
you're not executing all of the original code


sorry bear with me, i'm noob o.o
but what do you mean by that? what code do I need to add? Confused
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Sun Aug 22, 2021 12:11 am    Post subject: Reply with quote

your jmp to newmem is now 14 bytes

so all 14 bytes+the leftover need to be saved

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

Joined: 06 Dec 2019
Posts: 41

PostPosted: Sun Aug 22, 2021 8:34 am    Post subject: Reply with quote

Dark Byte wrote:
your jmp to newmem is now 14 bytes

so all 14 bytes+the leftover need to be saved


just to clarify, when I inject the code, something like this appears:
Code:
health1 - FF25 00000000 0000BB0700000000 - jmp 07BB0000
 


how did you even know it's jumping 14 bytes when I haven't showed you o.O you know what nvm.

anyway i just wanna thank you DARK BYTE for the help. and cheat engine is a great program. i hope you can add something to it that can help avoid this whole thing with the long jumps for 64-bit games.

The late replies from me were because i was trying to understand what's going on getting help from 4 different people in the discord. yeah it took 4 ppl to help me understand lool Shocked I learned a lot! Surprised

oh Dark byte, since I have your attention, can I ask you to add a GUI thing to CE where when you Ctrl+S (save) your cheat table it shows a notification of some sort. I Ctrl+S my cheat tables throughout, but like i hit the hotkey probably 10-20 times because of my OCD LOL. just need a little affirmation that shows it indeed has saved and i'll be relieved. The way Microsoft word does...
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