How to convert .ips or .pchtxt into cheat

[This automates the process, use this now instead, https://github.com/ChanseyIsTheBest/NX-60FPS-RES-GFX-Cheats/blob/main/ips2cheat.py by @AnimatedSwine37]

Thank you for @Hazerou for telling me about this method.
Notice: this will not work with every .ips or .pchtxt file (failed to convert Persona 5 R resolution .ips to cheat)
If you have a .pchtxt skip to step 4.

1. Obtain the .ips file, we are going to use the Sonic Frontiers 1.1 .ips patch to convert by @systemdev as an example.
https://gbatemp.net/threads/sonic-frontiers-1-1-1-60fps-exefs-patch.625595/

2. Download ips2pchtxt.py
https://github.com/3096/ipswitch/blob/master/scripts/ips2pchtxt.py

3. Drag and drop the .ips file into the ips2pchtxt.py
1676387118698.png

4. Open up the .pchtxt it makes, we are going to reverse the second column of the text under @disabled
1676387201599.png

5. Use this hexreverser.py script created also by @systemdev to reverse the second column as pictured (attached to post)
1676390010389.png

etc,
1676390074821.png

5. Time to make the cheat - use the first 16 digits of the BID for the filename. Add the reversed hex strings for the third column. For the first column add '04000000' Keep the second column identical to the first column of step 4. The title of the cheat is in [].
1676387516847.png

1676390134431.png

6. Copy the cheat to atmosphere/contents/{TID OF GAME}/cheats/{BID OF GAME}.txt, for our example this would be atmosphere/contents/01004AD014BF0000/cheats/DD7FF70188B281D9.txt
(Check BID and TID of game using Tinfoil, https://tinfoil.io/Title/01004AD014BF0000)

7. Make sure you have Tesla Menu, Edizon and nx-ovlloader, open up Tesla menu in game and active cheat to see if it works. Congraluations hopefully it converted successfully, remember not all .pchtxt's can be converted over into cheats.
2023021502112300-85F8C21DFB6C68234E4132C1BEC3368D.jpg

8. If you make a cheat out of an .ips send it to me or submit a pull request so I can add it to my public database (make sure you credit the original author).
https://github.com/ChanseyIsTheBest/NX-60FPS-RES-GFX-Cheats
 

Attachments

  • 1676387350564.png
    1676387350564.png
    46 KB · Views: 74
  • 1676387687980.png
    1676387687980.png
    12.2 KB · Views: 71
  • hexreverser.zip
    399 bytes · Views: 100
  • 2023021502105800-85F8C21DFB6C68234E4132C1BEC3368D.jpg
    2023021502105800-85F8C21DFB6C68234E4132C1BEC3368D.jpg
    136.5 KB · Views: 72
Last edited by ChanseyIsTheBest,

ChanseyIsTheBest

Well-Known Member
OP
Member
Joined
Aug 26, 2022
Messages
390
Trophies
0
Location
Australia
XP
1,062
Country
Australia
And converting a cheat to ips?
yes how convert cheat to ips? cus boring opening cheat each time
You can only convert cheat to IPS if the entirety of the cheat is located within the main. You can check this with Edizon-SE, if the value is located in the MAIN when you go into the memory editor the screen should look light blue. Most cheats you cannot convert back because the variables are located in the HEAP.

You'd also reverse back the hex strings back. Basically do the guide in reverse to get the cheat into an IPS patch.
You'll also need https://github.com/3096/ipswitch to convert the .pchtxt you make into a .ips.
Post automatically merged:

@AnimatedSwine37 just made a program that will directly convert .ips to cheats. Just drag and drop the .ips in and a cheat will pop out!

https://github.com/ChanseyIsTheBest/NX-60FPS-RES-GFX-Cheats/blob/main/ips2cheat.py
 
Last edited by ChanseyIsTheBest,
  • Like
Reactions: swutch

AnimatedSwine37

New Member
Newbie
Joined
Jun 7, 2020
Messages
4
Trophies
0
Age
22
XP
208
Country
Australia
You can only convert cheat to IPS if the entirety of the cheat is located within the main. You can check this with Edizon-SE, if the value is located in the MAIN when you go into the memory editor the screen should look light blue. Most cheats you cannot convert back because the variables are located in the HEAP.
You should also be able to determine whether it's located in MAIN based on the cheat file. The Atmosphere cheat code documentation (I can't link but it's in docs/features/cheats.md in Atmosphere's repo) explains how the memory region is determined for the different code types. For example, for the one you'll most likely see, type 0, the third number determines the region, where a 0 is for Main and 1 is for Heap (and 2 and 3 for Alias and ASLR although idk exactly how those work, I don't see any documentation on them).
The cheat type is the first column in a cheat so as an example if you had a cheat with the line 04000000 01664E58 52800021 then because the third digit in the first column is a 0 it would be in MAIN and you should be able to convert it to an ips patch. On the other hand, if you had a cheat with 04100000 001F0154 1E200C00 then it would be changing a value on the heap because the third digit is a 1 so you wouldn't be able to (directly) make an ips patch.

As for being unable to convert a cheat that does changes values in the heap I don't think that's necessarily true, although you wouldn't be able to directly convert them like you can with ones changing main. Take this with a grain of salt since I haven't ever actually done this but I think you would be able to change values on the heap by making a patch that sets the value using assembly, either at the first point that accesses the value or just anywhere before it's accessed. This would of course be much more involved and would likely require at least a little bit of reverse engineering using something like Ghidra.
 
  • Like
Reactions: ChanseyIsTheBest

masagrator

The patches guy
Developer
Joined
Oct 14, 2018
Messages
6,297
Trophies
3
XP
12,073
Country
Poland
As for being unable to convert a cheat that does changes values in the heap I don't think that's necessarily true, although you wouldn't be able to directly convert them like you can with ones changing main. Take this with a grain of salt since I haven't ever actually done this but I think you would be able to change values on the heap by making a patch that sets the value using assembly, either at the first point that accesses the value or just anywhere before it's accessed. This would of course be much more involved and would likely require at least a little bit of reverse engineering using something like Ghidra.
tl;dr it cannot be done via simple converting. :lol:

with IPS only you can do is patching executable code (aka MAIN) that is unitialized (so for example you cannot patch anything in .bss). If you don't see what you want to patch in uncompressed NSO via hactool, it cannot be patched.

No heap, no logic blocks, no loops, etc. So most cheats won't be able to convert nicely to IPS.

Only advantage of IPS is that it's applied before game even runs, which can be helpful with stuff that is ran only once per whole game session (with cheat you don't have such warranty, activating cheat converted from IPS too late may not work at all)
 
Last edited by masagrator,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: Sigh