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

Invalid Checksum when used as library, CLI works fine #17

Open
coatlessali opened this issue Jan 23, 2025 · 0 comments
Open

Invalid Checksum when used as library, CLI works fine #17

coatlessali opened this issue Jan 23, 2025 · 0 comments

Comments

@coatlessali
Copy link

Describe the bug
When used as a library in another C# application, attempting to apply some patches results in an invalid checksum error. Compiling without the checksum validation results in an invalid output file.

To Reproduce
Steps to reproduce the behavior:

  1. Compile the main branch and use the resulting PleOps.XdeltaSharp.dll in a project.
  2. Add the decoder as shown in the example on the README.
  3. Create a vcdiff patch using the latest xdelta3 on any platform, with the flags -f -e -S -s.
  4. Run the program.
  5. View checksum error.

Expected behavior
Patch applies properly.

Exceptions

Image

Screenshots
Using xdelta3 to create a patch. More context provided at the bottom for the strange naming convention.

Image

Using the CLI tool to apply the patch. Works flawlessly.

Image

The snippet of code that is failing. Note that this is run in a for loop that iterates over a list of patch files. It also overwrites the original file.

Image

Desktop:

  • OS: Windows, macOS, and Linux (Arch)
  • Version: Main branch

Additional context

  • I am trying to implement support for VCDIFF patches in HoneyPatcher - a mod installer and file patcher for the PlayStation3 game Sonic the Fighters. It was made in the Godot game engine and uses C# as its primary language.
  • The game is an internally emulated SEGA Model 2 game - as such the easiest way to do any small code edits is to use patches.
  • The reason the VCDIFF patches are named oddly is so that HoneyPatcher can use the file extension to identify what file to patch.
  • Of note, I have been successful in creating and applying several patches. Some could only be created successfully using the Linux version of Xdelta3, and then applied everywhere. Others fail on all platforms. The problem is wildly inconsistent, but I have made sure that my original file(s) is/are clean numerous times.
  • I have tried multiple versions of Xdelta3, as well as DeltaPatcher with secondary compression disabled.
  • In DeltaPatcher, removing the checksum from the file results in no error, but also no changes when the patch is applied. This once again works fine with the CLI tool.
  • If helpful, the source is available here.
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

1 participant