nineteendo / pyvz2

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

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe7 in position 48: invalid continuation byte #18

Closed dekiel123 closed 1 year ago

dekiel123 commented 1 year ago

This time i have that kind of problem:

Failed OBBUnpack: UnicodeDecodeError in G:\PVZ2tools-beta\OBBEdit\Shuttle 1\main.30.com.ea.game.pvz2_shu.obb: 'utf-8' codec can't decode byte 0xe7 in position 48: invalid continuation byte
Traceback (most recent call last):
  File "G:\PVZ2tools-beta\OBBEdit\unpack.py", line 576, in file_to_folder
    archive_extract(file, out, unpack_level, False)
  File "G:\PVZ2tools-beta\OBBEdit\unpack.py", line 503, in archive_extract
    rsb_extract(file, pathout_data, out, unpack_level)
  File "G:\PVZ2tools-beta\OBBEdit\unpack.py", line 435, in rsb_extract
    RSG_NAME = file.read(128).strip(b"\0").decode()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe7 in position 48: invalid continuation byte

OBB: https://drive.google.com/file/d/16SZHPy6Xh4OcbltWDZXdqNsz6KvOinGH/view?usp=sharing

nineteendo commented 1 year ago

I currently only catch errors when extracting the rsg, not when getting info for it. When you have an invalid name, that means the program can crash. I'll do my best to fix it.

dekiel123 commented 1 year ago

I have this error on templates 1-6. OBBUnpacker v1.2.2c

nineteendo commented 1 year ago

I know, I already suggest Sarah Lydia this exploit. It's kind of fun to break your own tool. I'll try to fix it in the next version.

dekiel123 commented 1 year ago

Hi. Any news about the new version?

nineteendo commented 1 year ago

No, nothing new yet. I haven't had time lately because of university.

nineteendo commented 1 year ago

There's an alpha available on the discord server.

dekiel123 commented 1 year ago

When I try 5 or 6 there is no error however the folder "main.36.com.ea.game.pvz2_shu" is empty. When I try 1 or 2 everything is fine, all files are extracted but there is an error fail.txt Obb https://drive.google.com/file/d/18cDscottPx9-fHFaSRBEO2r3pMWO-go6/view?usp=share_link

Overall, thank you for your help and for taking your time to solve my problems :-)

nineteendo commented 1 year ago

It crashes on mobile, so I'll have to try on a device with more RAM.

nineteendo commented 1 year ago

I now made the program raise an error for this, I might bring it back later with an option.

dekiel123 commented 1 year ago

The new version has a new bug. fail.txt https://drive.google.com/file/d/116GydovqP1_pd4bhGS4VAgR5csoFM5GT/view?usp=sharing

nineteendo commented 1 year ago

Well, it's currently working as intended: the tool will not try to fix obbs that were corrupted by modders, instead an error will be raised. Because I received significant backlash from modders, I've decided that the tool shouldn't repair the obb by default. (It's not their fault for not mentioning this sooner as this tool is not very widespread) I might add an option for it in the future, but I can't promise anything right now. I'm currently working on making the tool at least somewhat useful for these modders in the form of advanced JSON patching.

nineteendo commented 1 year ago

This feature is planned for release 1.4.0. I'm currently on v1.2.2c so that's still far away. Release 1.3.0 remains the priority.

nineteendo commented 1 year ago

OK, moving it back to v1.3.0

nineteendo commented 1 year ago

Working again.