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

(In)compatibility with external PBO programs #9

Open
Cre8or opened this issue Nov 17, 2024 · 6 comments
Open

(In)compatibility with external PBO programs #9

Cre8or opened this issue Nov 17, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@Cre8or
Copy link

Cre8or commented Nov 17, 2024

Describe the bug
PboViewer fails to open some PBO files correctly, specifically ones packed through external programs. I believe this might be related to how the file paths are stored inside the file?

To Reproduce
Steps to reproduce the behavior:

  1. Download the sample PBO below
  2. Start PboViewer
  3. Click on "Open PBO"
  4. Select the downloaded PBO and confirm
  5. Notice folder paths are now part of the file names
  6. Scroll to the bottom and open "version.hpp" in a text editor
  7. Notice the file contains incomplete/broken SQF code, and does not match the original file

Expected behavior
PboViewer should ideally be compatible with other PBO programs. Currently I am unable to extract PBOs from users on Windows computers (who generally use PBO Manager on their end) as I only have access to PboViewer, being on Linux myself.

Screenshots
image

Operating system
Arch Linux 6.11.7-arch1-1

Additional context
Sample PBO mentioned above

From a quick look, it seems as if the file lengths are correct, but the contents are completely mismatched (each file contains data from a completely different file). I'm also noticing that the file paths use backslashes, which is normal (and expected) for Windows but forbidden on Linux, so maybe part of the reason why it's breaking.

@Cre8or Cre8or added the bug Something isn't working label Nov 17, 2024
@SteezCram
Copy link
Owner

SteezCram commented Nov 17, 2024

Hello, thanks for reporting a bug. I think this is due to the internal library misreading the headers. I have forked this project https://github.com/Paton7/PBOSharp and modified it a bit. Furthermore, I can solve this by doing two things:

  • Find and solve the problem in the library
  • Rewriting it completely and use a real OOP pattern

I will do the first things since I do not have much time. But it will be kinda of an ugly fix.
I do not know when the problem will be fixed. I have a busy schedule, but I will do it as soon as possible.

@SteezCram
Copy link
Owner

Hello, sorry for the long time that I have taken to start solving your problem. I have released a pre-release that in my opinion will fix your problem. I do not have any Linux environment where I could test this easily, so I cannot test it. If you can provide me a PBO that you create on Linux, maybe I can reproduce it a bit.

If the problem is not solved, I will deeptest by using a Linux, but it will take some time to create the environment.

The release: https://github.com/SteezCram/PboViewer/releases/tag/v1.4.2c

@Cre8or
Copy link
Author

Cre8or commented Jan 2, 2025

Thank you for the update! Yes, this fixes the folders not being detected correctly - here's a comparison of the original sample file opened with the old version...

Screenshot_20250102_141951

... and the 1.4.2c pre-release:

Screenshot_20250102_141932

However, the other issue with the file contents being incorrect is still present. As an example, the contents of the file "version.hpp" should be:

#define CAFE_VERSION 1.7.0

...but instead ends up as:

if (isNil "f_var_logiVehi

My guess is that there is a bug with how the file offsets are being calculated (either during read or write), as I recognise that snippet of SQF code from another file in the PBO. To follow up on this suspicion, I packed the original contents of the sample PBO using your 1.4.2c pre-release. Opening the resulting file, I now get:

Screenshot_20250102_141911

Notice that in the second picture, the folders and files are sorted alphabetically? In the picture above (using your latest version), they're not. On the flipside, opening "version.hpp" in this new PBO, I finally get:

#define CAFE_VERSION 1.7.0

...which is correct! So using PboViewer 1.4.2c, I can now pack and open my own PBOs fine, but it seems I am still unable to open files packed with external tools (as per the the original issue).

Oh, and as requested, I've attached the repacked PBO from above. The original sample PBO is still in the first post.

Thank you for all the support so far!

@SteezCram
Copy link
Owner

SteezCram commented Jan 2, 2025

Ok, I have also the problem with the base PBO. So I only solve one of your problem. I will try to find why we have this problem. Can you tell me also what kind of software did you use to pack the original PBO?

EDIT: When searching for this: #define CAFE_VERSION 1.7.0 I cannot found any string that match this line. I wonder if the PBO is not corrupt or if it has been mangled or something else.

@Cre8or
Copy link
Author

Cre8or commented Jan 4, 2025

Can you tell me also what kind of software did you use to pack the original PBO

Late reply, but since the sample PBO is a user-generated mission, I don't know for sure what tool was used. I do know that it was packed on a Windows machine, and I'd guess they used PBO Manager.

EDIT: When searching for this: #define CAFE_VERSION 1.7.0 I cannot found any string that match this line. I wonder if the PBO is not corrupt or if it has been mangled or something else.

For what it's worth, I tried opening both PBOs (original sample + repacked one) with PBO Manager on a Windows 10 VM, and in both cases I could open version.hpp and see the intended contents just fine. So that should rule file corruption out.

image

On a related note, I noticed 2 more things from this picture:

  • the file contents of both PBOs are sorted in alphabetical order; this might just be a final step before adding the entries to the tree view, but it's a welcome QoL feature to have
  • the repacked PBO includes a pbo.json file that I had not previously seen. Is this added by PboViewer? It doesn't exist in the original PBO.

@SteezCram
Copy link
Owner

Ok, I will try to investigate further. But I am running out of options now. I do not know anything about this pbo.json file. I think I will try to create a PBO parser from scratch and see if everything is fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants