Jump to content
  • 0

Arm Patching


KabutHitam
 Share

Question

12 answers to this question

Recommended Posts

  • 0
2 hours ago, XEKEX said:

what do u mean fast also is it 64 or 32 

 

for 64, i using fmov for float 

1 hour ago, MAARS said:

I guess he want it like this, dom might help xD
5yhvlt.jpg

😄 dom can't help me ahhahaha

Link to comment
Share on other sites

  • 0
23 hours ago, MAARS said:

Nice, but your request still lack context, what are you trying to do ?

i just want opcode high value for speed

14 hours ago, AMIYA said:

Have you tried it?

 

Like this ?

 

X1, x2

 

 X0, x1
 

you get stuck when you use that, only fmov

Link to comment
Share on other sites

  • 0

[ @KabutHitam ]
---

Quote

i just want opcode high value for speed

From what I understand, you're trying to set a large possible value. You can use this template:
---
[ Float 0-65535 ]

MOVW R0, #(1-65535)
VMOV SO, R0
VCVT.F32.S32 S0, S0
VMOV R0, S0
BX LR

---
[ Float 65535 - 131072 ]: R0 = R0 + R1

MOVW R0, #(0-65535)
MOVW R1, #(0-65535)
ADD R0, R0, R1
VMOV SO, R0
VCVT.F32.S32 SO, S0
VMOV RO, SO
BX LR

---
[ Float 131072 - 429503284]: R0 = (R0 x R1) + R1

MOVW R0, #(0-65535)
MOVW R1, #(0-65535) --multiply here
MUL R0, R0, R1
MOVW R1, #(0-65535) --addition here
ADD R0, R0, R1
VMOV S0, R0
VCVT.F32.S32 S0, S0
VMOV R0, S0
BX LR

---
*Above mnemonic are replicable for getting a really high value.
*Do note that most function has it's own Max Limit, so you need to change them first (example: MaxHP & MinHP)
*( credit: @BadCase )

Link to comment
Share on other sites

  • 0
21 hours ago, Xaviesz said:

[ @KabutHitam ]
---

From what I understand, you're trying to set a large possible value. You can use this template:
---
[ Float 0-65535 ]

MOVW R0, #(1-65535)
VMOV SO, R0
VCVT.F32.S32 S0, S0
VMOV R0, S0
BX LR

---
[ Float 65535 - 131072 ]: R0 = R0 + R1

MOVW R0, #(0-65535)
MOVW R1, #(0-65535)
ADD R0, R0, R1
VMOV SO, R0
VCVT.F32.S32 SO, S0
VMOV RO, SO
BX LR

---
[ Float 131072 - 429503284]: R0 = (R0 x R1) + R1

MOVW R0, #(0-65535)
MOVW R1, #(0-65535) --multiply here
MUL R0, R0, R1
MOVW R1, #(0-65535) --addition here
ADD R0, R0, R1
VMOV S0, R0
VCVT.F32.S32 S0, S0
VMOV R0, S0
BX LR

---
*Above mnemonic are replicable for getting a really high value.
*Do note that most function has it's own Max Limit, so you need to change them first (example: MaxHP & MinHP)
*( credit: @BadCase )

How to use GameGuardian to modify so many assembly codes?

Link to comment
Share on other sites

  • 0

[ @huanggua ]
---

Quote

How to use GameGuardian to modify so many assembly codes?

Make sure that you're know the difference between Arm and Thumb. The difference between both is that: Arm uses 4 hexes / 8 bytes, meaningwhile, Thumb usually uses only 2 hexes / 4 bytes. For example:

Quote

Assembly: NOP
Arm: 00 F0 20 E3
Thumb: 00 BF

---
It is important because you can only change one instruction with another one WITH the same hex length. You can replace the next instruction to fit your long-patches, but make sure that: if it's a function, you need to ends it with:

Arm32: BX LR
Arm64: RET

---

Edited by Xaviesz
Link to comment
Share on other sites

  • 0
On 2023/8/18 at 2:05 AM, Xaviesz said:

[ @huanggua ]
---

Make sure that you're know the difference between Arm and Thumb. The difference between both is that: Arm uses 4 hexes / 8 bytes, meaningwhile, Thumb usually uses only 2 hexes / 4 bytes. For example:

---
It is important because you can only change one instruction with another one WITH the same hex length. You can replace the next instruction to fit your long-patches, but make sure that: if it's a function, you need to ends it with:

Arm32: BX LR
Arm64: RET

---

Do you mean that, for example, after I find the address of the MAXHP function, I can use GameGuardian to modify this value and some subsequent values to MOVW R0, #(1-65535)

VMOV SO, R0

VCVT.F32.S32 S0, S0

VMOV R0, S0

BX LR ?

Maybe I didn't express myself clearly, see if you can understand now.

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.