python-dotnet-binaryformat icon indicating copy to clipboard operation
python-dotnet-binaryformat copied to clipboard

Can I add [RecordTypeEnumerator.BinaryLibrary] type resolution | 请问是否可以增加 【RecordTypeEnumerator.BinaryLibrary】 类型的解析

Open bai1996 opened this issue 2 years ago • 4 comments


en: Hello! Excuse me! I want to change the archive of [Cat Quest II], After executing [python scripts show_structure. py tests data save_file2. dat], the following error occurs

Traceback (most recent call last):
  File "scripts\show_structure.py", line 53, in <module>
    sys.exit(main())
  File "scripts\show_structure.py", line 47, in main
    print(dnbinaryformat.deserialize(buf).tree())
  File "D:\Program Files\Python\Python38\lib\site-packages\python_dotnet_binaryformat-0.1-py3.8.egg\dnbinaryformat\__init__.py", line 384, in deserialize
  File "D:\Program Files\Python\Python38\lib\site-packages\python_dotnet_binaryformat-0.1-py3.8.egg\dnbinaryformat\__init__.py", line 369, in vsParse
NotImplementedError

I did not succeed in trying to add a resolution, or there is a way to skip this section to resolve other implemented resolutions thank


cn:

你好!打扰了! 我想要更改【Cat Quest II】的存档, 在执行【python scripts\show_structure.py tests\data\save_file2.dat】后出现了如下错误

Traceback (most recent call last):
  File "scripts\show_structure.py", line 53, in <module>
    sys.exit(main())
  File "scripts\show_structure.py", line 47, in main
    print(dnbinaryformat.deserialize(buf).tree())
  File "D:\Program Files\Python\Python38\lib\site-packages\python_dotnet_binaryformat-0.1-py3.8.egg\dnbinaryformat\__init__.py", line 384, in deserialize
  File "D:\Program Files\Python\Python38\lib\site-packages\python_dotnet_binaryformat-0.1-py3.8.egg\dnbinaryformat\__init__.py", line 369, in vsParse
NotImplementedError

我尝试添加解析并没有成功,或者说有什么办法可以跳过这一段解析其他已实现的解析 感谢

save_file2.zip

bai1996 avatar Sep 21 '22 09:09 bai1996


en: Or is there any other way to deserialize an unknown serialized object? Thank you

cn: 或者有什么其他的办法能够做到在未知序列化对象的情况下反序列化的工具或方法,谢谢啦

bai1996 avatar Sep 21 '22 09:09 bai1996

Unfortunately, I don't think there's an easy way to just skip the data. The structures have implicit sizes, so its not easy to guess how far forward to skip.

If you can share some sample data, I can maybe take a look if I have time, but no promises.

williballenthin avatar Sep 27 '22 18:09 williballenthin

If you can figure out what record type is referenced, by logging record_type here: https://github.com/williballenthin/python-dotnet-binaryformat/blob/master/dnbinaryformat/init.py#L356

then we can try to add the type to the parser. There are documented structures that I just hadn't ever seen so I didn't try to write code for them yet.

williballenthin avatar Sep 27 '22 18:09 williballenthin

en: Thank you. I'm going to use other methods to modify the archive file, It's too hard o(╥﹏╥)o

cn: 谢谢,我准备用别的办法修改,不改存档文件了,太费劲了o(╥﹏╥)o

bai1996 avatar Sep 28 '22 02:09 bai1996