nineteendo / pyvz2

PyVZ2 is a command line utility to modify PvZ2
GNU General Public License v3.0
47 stars 7 forks source link

struct.error: unpack requires a buffer of 4 bytes #17

Open dekiel123 opened 2 years ago

dekiel123 commented 2 years ago
error while extracting C:\Users\User\Desktop\dddd\PVZ2tools-beta\OBBEdit\main.483.com.ea.game.pvz2_roE.obb:Packages: unpack requires a buffer of 4 bytes
Traceback (most recent call last):
  File "C:\Users\User\Desktop\dddd\PVZ2tools-beta\OBBEdit\unpack.py", line 247, in rsg_extract
    IMAGE_DATA_OFFSET = unpack("<I", file.read(4))[0]
struct.error: unpack requires a buffer of 4 bytes

Any idea what to do?

nineteendo commented 2 years ago

Can you send that obb, it appears that something is wrong with it. It tries to read from an empty subfile...

dekiel123 commented 2 years ago

https://drive.google.com/file/d/116_ie7IY_b1weguPvfXX1egJ5ATU-PYK/view?usp=sharing

I need all files from "PACKAGES" in this obb, can you help me get this?

nineteendo commented 2 years ago

I'll try when you've given me access to the file. I can't promise anything, some mods just don't want to be messed with.

nineteendo commented 2 years ago
Screenshot 2022-07-28 at 14 44 02
dekiel123 commented 2 years ago

Done, try now.

nineteendo commented 2 years ago

See, the size in column 5 is set to 0. I'm going to check if I'm using a work-around already.

Screenshot 2022-07-28 at 14 55 59
nineteendo commented 2 years ago

OK, they've just bypassed my work-around: RSG_SIZE = RSG_IMAGE_DATA_OFFSET + RSG_COMPRESSED_IMAGE_DATA_SIZE Both are set to zero in their file (column 12 and 13 respectively) So it becomes this: RSG_SIZE = max(RSG_DATA_OFFSET + RSG_COMPRESSED_DATA_SIZE, RSG_IMAGE_DATA_OFFSET + RSG_COMPRESSED_IMAGE_DATA_SIZE) Which version are you currently using?

nineteendo commented 2 years ago

This is what I currently have extracted: main.483.com.ea.game.pvz2_roE.obb.zip

nineteendo commented 2 years ago

This is another problem, they use rtid encoded keys & one encrypted RTON. Screenshot 2022-07-28 at 15 06 00

nineteendo commented 2 years ago

OK, that's also tackled, that just leaves this one file: Screenshot 2022-07-28 at 15 10 21 I have no idea what \x83\x84 is supposed to mean.

dekiel123 commented 2 years ago

This is what I currently have extracted: main.483.com.ea.game.pvz2_roE.obb.zip

Thank you so much! That will help me a lot :)

nineteendo commented 2 years ago

Here's the almost complete archive (Just missing pirate33.rton): main.483.com.ea.game.pvz2_roE.obb.zip In the next beta the problem will be resolved.

nineteendo commented 2 years ago

What even is this? (Rough translation from Google Translate) Screenshot 2022-07-28 at 15 18 31

dekiel123 commented 2 years ago

OK, they've just bypassed my work-around: RSG_SIZE = RSG_IMAGE_DATA_OFFSET + RSG_COMPRESSED_IMAGE_DATA_SIZE Both are set to zero in their file (column 12 and 13 respectively) So it becomes this: RSG_SIZE = max(RSG_DATA_OFFSET + RSG_COMPRESSED_DATA_SIZE, RSG_IMAGE_DATA_OFFSET + RSG_COMPRESSED_IMAGE_DATA_SIZE) Which version are you currently using?

Beta version.

..... May i ask you once again for help with other OBB? There is exacly the same problem "unpack requires a buffer of 4 bytes". https://drive.google.com/file/d/1-uDaPaaOUOgyQrhGz_8jARkKS98F_uxL/view?usp=sharing

nineteendo commented 2 years ago

main.18.com.ea.game.pvz2_shu.obb.zip

nineteendo commented 2 years ago

You can use the latest version of the beta, but be quick before I break the script again: https://github.com/Nineteendo/PVZ2tools/tree/beta

dekiel123 commented 2 years ago

Thank you :)

dekiel123 commented 2 years ago

After the latest update, problem returned:

error while extracting G:\PVZ2tools-beta\Shuttle 1\main.18.com.ea.game.pvz2_shu.obb:__BuildOn971ByCz__: unpack requires a buffer of 4 bytes
Traceback (most recent call last):
  File "G:\PVZ2tools-beta\unpack.py", line 246, in rsg_extract
    IMAGE_DATA_OFFSET = unpack("<I", file.read(4))[0]
struct.error: unpack requires a buffer of 4 bytes
nineteendo commented 2 years ago

After the latest update, problem returned:

error while extracting G:\PVZ2tools-beta\Shuttle 1\main.18.com.ea.game.pvz2_shu.obb:__BuildOn971ByCz__: unpack requires a buffer of 4 bytes
Traceback (most recent call last):
  File "G:\PVZ2tools-beta\unpack.py", line 246, in rsg_extract
    IMAGE_DATA_OFFSET = unpack("<I", file.read(4))[0]
struct.error: unpack requires a buffer of 4 bytes

I'll check & compare with the previous version. Did the obb update?

nineteendo commented 2 years ago
Screenshot 2022-09-08 at 14 03 46

Can you share me the latest version? It works fine for the previous version I downloaded.

dekiel123 commented 2 years ago

Yes there was a new update. https://drive.google.com/file/d/1v42Yl0nxb42z2ok24jno-q35olc45iHY/view?usp=sharing

nineteendo commented 2 years ago

Are you using the latest version of PyVZ2? https://github.com/Nineteendo/PVZ2tools If that still fails you can use the beta: https://github.com/Nineteendo/PVZ2tools/tree/beta