Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPS32 #89

Open
impeeza opened this issue Oct 16, 2024 · 9 comments
Open

IPS32 #89

impeeza opened this issue Oct 16, 2024 · 9 comments

Comments

@impeeza
Copy link

impeeza commented Oct 16, 2024

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.

@Alcaro
Copy link
Owner

Alcaro commented Oct 16, 2024

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

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

@impeeza
Copy link
Author

impeeza commented Oct 16, 2024

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.

@Europia79
Copy link

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)

@Alcaro
Copy link
Owner

Alcaro commented Oct 22, 2024

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.

@impeeza
Copy link
Author

impeeza commented Oct 24, 2024

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.

@Alcaro
Copy link
Owner

Alcaro commented Oct 24, 2024

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.

@Aerocatia
Copy link

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
Copy link

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.

@Alcaro
Copy link
Owner

Alcaro commented Dec 18, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants