aianlinb / VisualGGPK2

Library for Content.ggpk of PathOfExile (Rewrite of libggpk)
GNU Affero General Public License v3.0
157 stars 32 forks source link

Replacing bundle.bin has no effect. #28

Closed chenijih2017 closed 2 years ago

chenijih2017 commented 2 years ago

Step to reproduce:

  1. edit any files in _Tiny_1.bundle.bin using normal mode of this program.
  2. Save with build-in function of the program. (Save button on the right-top of files edit block)
  3. Reopen the program using bundle mode.
  4. Export _Tiny_1.bundle.bin to any folder.
  5. Restore _Tiny_1.bundle.bin using build-in function of the program. (Recovery option in right-click menu)
  6. Reopen the program using normal mode Or open the game, you would notice that the restore has no effect.

The problem exist when you use Replace function with _Tiny_1.bundle.bin, too.

Update: Here is what I found, if I edit any file inside a bundle using the program (let's say monster.oc in tiny1 bundle), and export the bundle. if I edit the file again (monster.oc), then replacing the tiny1 bundle with previous exported bundle will cause the monster.oc has invalid offset, I think maybe the offset info is not restore though?

Update again(with workaround): It might be my issue. When you edit the file's in a bundle, the program append or relocate the edited files to suitable positions of the ggpk, and the original position of these file's will be mark as Free, then the program update the index.bin file to match the current offset of each file. As the result, only replacing current bundle with exported bundle backup is not enough, you need to replace the "_.index.bin" to the index file that match your exported bundle to make the "bundle restoration" work. Please kindly correct me if there is any misunderstanding or danger operation, thanks. Great work by the way.

aianlinb commented 2 years ago

@chenijih2017 When you save a file, that file may not always be written to the original bundle, and the new location will be recorded in .index.bin As you said, in addition to replacing its bundle, replacing .index.bin is also necessary But the general mode of VisualGGPK2 will take care of everything for you. So unless you know what you are doing, don’t use BundleMode, but use the recovery function in the general mode