Alcaro / Flips

Floating IPS is a patcher for IPS and BPS files.
Other
334 stars 46 forks source link

--apply with no destination file does nothing #42

Closed LunarLambda closed 3 years ago

LunarLambda commented 3 years ago

Expectation: flips -a patch.ips game.exe applies the patch to game.exe without creating an extra file

Reality: It did nothing, it only applied the patch with flips -a patch.ips game.exe game.exe

My computer doesn't have internet right now, and --version doesn't actually print a version number, but pacman tells me this is version 123.1

Alcaro commented 3 years ago

flips -a patch.ips game.exe is supposed to create a file named patch.exe. Some people want to keep the input ROM around, so they can patch something else.

Wanting to overwrite the target file under the same filename is also a legitimate request, but I have to pick one behavior. Personally I'd rather keep both files; if user wants the opposite, it's easier to remove and rename files than recreate whatever Flips just overwrote.

If there already was a patch.exe nearby, I'm afraid it just got clobbered, which I agree it shouldn't; fixed on master, but I'm not the AUR maintainer (nor do I know who is - Flips has more users than I can, or want to, keep track of), so I can't assist with getting it updated that way.

If it does not create nor clobber patch.exe, that is indeed quite mysterious; if it reports successful patching, that's definitely another bug. What does strace -e trace=file flips -a patch.ips game.exe say?

LunarLambda commented 3 years ago

Ah, it did indeed create patch.exe, however, it placed it in the directory containing the patch file, so I did not see it. (I was looking at the directory containing game.exe)

quite unexpected behaviour but thank you for pointing it out.

Alcaro commented 3 years ago

The current behavior is what makes the most sense to Flips' original target audience, the Super Mario World ROM hacking community (they have one rom and create 99999 patches for it), but yes, it is unexpected in other contexts.

I added the default output filename to --help. Not sure how much it helps, but it can't hurt.