Flips icon indicating copy to clipboard operation
Flips copied to clipboard

IPS32

Open impeeza opened this issue 1 year ago • 9 comments

Hello there, Thanks a lot for you great effort

I am wondering if IPS32 will be supported by Flips?

It's a format starting to be wide used.

impeeza avatar Oct 16 '24 03:10 impeeza

That's the ... fourth IPS32 I've seen proposed?

I'm not a huge fan of IPS variants. Better use BPS.

Alcaro avatar Oct 16 '24 13:10 Alcaro

It's no my choice, the Nintendo switch scene is starting to use IPS32 for the new set of console patches, by example for themes and bootlogos.

So testing new set of patches on my pc is becoming an hassle.

impeeza avatar Oct 16 '24 13:10 impeeza

Can you guys provide links & more info: Like, what is the difference between IPS & the various IPS32 proposals ?

@Alcaro Also, you never responded to my idea for "auto-hashing": https://github.com/Alcaro/Flips/discussions/88#discussion-7280380

Europia79 avatar Oct 22 '24 19:10 Europia79

I'm more willing to teach Flips to apply new patch formats than create them. There's already one apply-only format that nobody ever uses, UPS.

But I need a clear specification, a reasonable expectation that it would be used in Flips, and either a pull request or motivation enough to do it myself. And that last one is an endangered species.

Alcaro avatar Oct 22 '24 20:10 Alcaro

Can you guys provide links & more info: Like, what is the difference between IPS & the various IPS32 proposals ?

@Alcaro Also, you never responded to my idea for "auto-hashing": #88 (comment)

Hello there,

I just cross in to a set of patches for Switch Theme support: https://github.com/exelix11/theme-patches#if-you-dont-want-to-connect-your-console-to-the-internet

SciresM added support to IPS and IPS32 Patches on Atmosphère (Switch CFW) on version https://github.com/Atmosphere-NX/Atmosphere/releases/tag/0.8.9 https://twitter.com/SciresM/status/1023422112772440064

Also the FS sigpatches for CFW on switch are IPS32.

Most of the new set of patches for Switch are IPS32 I think because the big size of files and modules.

the only tool I fond to apply IPS32 patches was an Android one https://github.com/btimofeev/UniPatcher/ and is a pain be transferring files from my windows machine to my tablet going and back.

There are some libraries like https://github.com/leoetlino/sips or https://pypi.org/project/ips.py/ which support IPS and IPS32 but they are no end user friendly.

The only «documentation» I found was a question about the format: https://www.reddit.com/r/romhacking/comments/vd8qyq/questions_regarding_the_ips32_format_structure/

seems IPS32 also support RLE but That is beyond my knowledge.

impeeza avatar Oct 24 '24 01:10 impeeza

That source code is clear enough, I'll accept it as a specification. I'll also accept the above posts as sufficient evidence that it will be used. I still don't like IPS-based formats, but clearly reality doesn't conform to my whims.

That just leaves someone implementing it.

While the formats are similar, I'd prefer copypasting the IPS handler file, to allow easy separation of different parts of Flips, and to allow the compiler to optimize better.

Alcaro avatar Oct 24 '24 02:10 Alcaro

wtf, kill it with fire.

I see the reason this abomination took off is because IPS is "stackable". It's not, it's just a lack of verification. You can blow your feet off just as easily.

Maybe there needs to be a real best effort stackable format, like one that verifies bytes being overwritten are what they are expected to be, and expanding the file is banned.

I would much rather this than bringing back the "just write the changes and hope it works" footguns. As a user applying patches, it is also nice to know you are patching the right file.

Aerocatia avatar Dec 18 '24 05:12 Aerocatia

Proposal: bastardize extend BPS to have a "stackable" mode. In this mode you take the bytes that will be written by the patch and hash that instead of the whole input. File expansion is banned.

This should meet the use-case if people who abuse IPS. File expansion would have never worked anyway, and neither would have clobbering modified data.

The downside is that this is not context aware, it could never promise another patch did not invalidate a pointer you just changed. The upside is IPS(32) coming back as the format is objectively worse. I'd take verifying some of the input over none of the input.

Aerocatia avatar Dec 18 '24 06:12 Aerocatia

Counter-proposal: Add a mode to Flips where it applies multiple patches to the same ROM, checks which bytes changed, and screams if any byte was changed multiple times.

That way, you can stack all patches you want, of any format, but only simultaneously.

I believe that's tracked in #49.

Alcaro avatar Dec 18 '24 09:12 Alcaro