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

Access denied #19

Closed
fenymak opened this issue Oct 18, 2022 · 9 comments
Closed

Access denied #19

fenymak opened this issue Oct 18, 2022 · 9 comments
Labels

Comments

@fenymak
Copy link

fenymak commented Oct 18, 2022

Hello. I've decided to localize the new game Stranded: Alien Dawn.
But I ran into a problem (maybe I'm too dumb).
Unpacking proceeds normally, everything is decoded correctly.
However, I can't pack it back.
An access denied error pops up. What am I doing wrong?

d:\Works\Tools\hpk-v0.3.9-x86_64-pc-windows-msvc>hpk print "E:\SteamLibrary\steamapps\common\Stranded Alien Dawn\Local\English.hpk"
reading file: E:\SteamLibrary\steamapps\common\Stranded Alien Dawn\Local\English.hpk
header:
  data_offset: 0x24
  fragments_residual_offset: 0x0
  fragments_residual_count: 0
  fragments_per_file: 1
  fragments_filesystem_offset: 0x5E138
  fragments_filesystem_length: 24
filesystem entries: 3
filesystem fragments:
  0x5E11F  len: 25
  0x5E10D  len: 18
  0x24     len: 385257
dir:  index=1 depth=0 ""
 fragment: 0x5E11F len: 25
dir:  index=2 depth=1 "CurrentLanguage"
 fragment: 0x5E10D len: 18
file: index=3 depth=2 "CurrentLanguage\\Game.csv"
 fragment: 0x24 len: 385257
 compressed: ZSTD inflated_length=1989815 chunk_size=131072 chunks=16
  chunks: 0x4C     len: 29351
          0x72F3   len: 27035
          0xDC8E   len: 26581
          0x14463  len: 25720
          0x1A8DB  len: 26760
          0x21163  len: 23628
          0x26DAF  len: 20872
          0x2BF37  len: 28986
          0x33071  len: 29952
          0x3A571  len: 26444
          0x40CBD  len: 17184
          0x44FDD  len: 21604
          0x4A441  len: 25649
          0x50872  len: 25496
          0x56C0A  len: 25503
          0x5CFA9  len: 4416

Error message

d:\Works\Tools\hpk-v0.3.9-x86_64-pc-windows-msvc>hpk create D:\Works\Tools\hpk-v0.3.9-x86_64-pc-windows-msvc\pack D:\Works\Tools\hpk-v0.3.9-x86_64-pc-windows-msvc\extracted
Error: Hpk(Io(Os { code: 5, kind: PermissionDenied, message: "Access denied." }))

Here is the archive with localization English.zip

@nickelc
Copy link
Owner

nickelc commented Oct 18, 2022

Is the second parameter [1] a directory?

[1] D:\Works\Tools\hpk-v0.3.9-x86_64-pc-windows-msvc\extracted

The hpk create command expects a filename as last parameter for the new archive.

USAGE:
    hpk create [FLAGS] [OPTIONS] <dir> <file>

@fenymak
Copy link
Author

fenymak commented Oct 18, 2022

Yes, this is the folder where the archive was extracted
2022-10-18_20-37-14

@nickelc
Copy link
Owner

nickelc commented Oct 18, 2022

You have to use it like this: hpk create packed Language.hpk
where packed contains the content for the new archive.

@fenymak
Copy link
Author

fenymak commented Oct 18, 2022

Ooh, I'm a fool. Thanks for the help. But now the problem is that the game seems to see the file, but cannot read it and takes data from the original.

@fenymak
Copy link
Author

fenymak commented Oct 18, 2022

And I think I figured out what the problem is.
Does it depend on the order of the indexes?
Also the encoder is different.
2022-10-18_21-45-19

@nickelc
Copy link
Owner

nickelc commented Oct 18, 2022

So that I understand it correct, you copied the Russian.hpk into the games folder [1], the game loads fine but you don't see any effect?

[1] steamapps/common/Stranded Alien Dawn/Local/Russian.hpk

Do you see an effect when you keep the localization files extracted in Local/Russian/CurrentLanguage/..?

Or what happens when you replace the English.hpk with your Russian.hpk?

Does it depend on the order of the indexes?
Also the encoder is different.

The different index shouldn't matter.

I didn't implement other encoders except zlib because Victor Vran and Surviving Mars would crash with lz4 compressed chunks. I don't know the difference between the lz4 library the games are using and the one I'm using.
The zlib compressed chunks worked for previous games.

You could try the --dont-compress-files parameter to pack the files uncompressed.

Usage hpk create --dont-compress-files <dir> <file>

@fenymak
Copy link
Author

fenymak commented Oct 18, 2022

So that I understand it correct, you copied the Russian.hpk into the games folder [1], the game loads fine but you don't see any effect?

yes, the game sees the file, but nothing happens when applying settings in the game

Or what happens when you replace the English.hpk with your Russian.hpk?

nothing

Do you see an effect when you keep the localization files extracted in Local/Russian/CurrentLanguage/..?

nothing, it just doesn't work

You could try the --dont-compress-files parameter to pack the files uncompressed.

Usage hpk create --dont-compress-files <dir> <file>

d:\Works\Tools\hpk-v0.3.9-x86_64-pc-windows-msvc>hpk create --dont-compress-files --chunk-size 131072 D:\Works\Tools\hpk-v0.3.9-x86_64-pc-windows-msvc\extracted Russian.hpk
error: Found argument '--dont-compress-files' which wasn't expected, or isn't valid in this context

@fenymak
Copy link
Author

fenymak commented Oct 18, 2022

HURRAH!
I downloaded the latest version of the archiver and it all worked!
And packed without compression. Maybe this was the problem.
In any case, thanks!
2022-10-19_00-40-39

@nickelc
Copy link
Owner

nickelc commented Oct 18, 2022

HURRAH! I downloaded the latest version of the archiver and it all worked!

Nice. 👍

Maybe I can find some time to look into zstd compression and get it working with the newer games.

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

No branches or pull requests

2 participants