Jump to content
  • 0

How to edit LDR arm64 opcodes?


Pivo58
 Share

Question

So i have an arm64 opcode like

LDR S0, [X0,#0x230]

RET

How do i edit it to return my value like MOV W0, #123 or FMOV S0, #0x40400000

Videos would be very appreciated because i'm very bad at english and it's hard for me to understand complicated texts 🙂

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 1
8 hours ago, Pivo58 said:

So yeah, LDR R1, [R0] Will load r0 into r1

but how do i turn r0 into my value and especially how do i make this in gameguardian. Could you please send any screenshots of some already edited LDRs in gameguardian, i want to know how does the structure looks like (or sequence idk how do i call it correctly)

R0 is the caller address (CA region) + 0x230 will give you the value of the float being loaded into R1 
• you can manually pointer search for that method applying the offset then edit the value of it
• you can allocate new memory in XA region and write you custom code ( using mov ) then replace the method pointer to your allocated memory
• overwrite the actual instructions with MOV etc

Link to comment
Share on other sites

  • 0
5 hours ago, Pivo58 said:

Your guide is really helpful, i know how to patch float and double offsets now
but i still don't understand how to edit LDR

Could you please make a video editing a LDR opcode or an edited result of the LDR opcode in my question?

Change use mov and see what happen

Link to comment
Share on other sites

  • 0

@Pivo58  here is what LDR and STR do : 

 


in your case it load the value of the pointer X0 + 0x230 into FPU 

S0 = (the value of the pointer) X0 + 0x230 <-- this value is a float

Edited by XEKEX
Link to comment
Share on other sites

  • 0
11 hours ago, XEKEX said:

@Pivo58  here is what LDR and STR do : 

 


in your case it load the value of the pointer X0 + 0x230 into FPU 

S0 = (the value of the pointer) X0 + 0x230 <-- this value is a float

So yeah, LDR R1, [R0] Will load r0 into r1

but how do i turn r0 into my value and especially how do i make this in gameguardian. Could you please send any screenshots of some already edited LDRs in gameguardian, i want to know how does the structure looks like (or sequence idk how do i call it correctly)

Link to comment
Share on other sites

  • 0
On 6/14/2023 at 5:25 PM, Pivo58 said:

like how?

If i will replace ldr with mov then absolutely nothing happens and even the game doesn't crash

if nothing change that mean the method doesn't get called

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.