danksz/tsukuyomi

Errors with kaitai-struct-compiler and sd-lunii-parser.py

Closed this issue · 1 comments

Hi,
First, thanks for your work !
I hope you can help me, I really need to extract the stories from my old Lunii to put them on my new Lunii (I don't have access to my old lunistore account) but I have two errors :

The first error :

kaitai-struct-compiler --target python kaitai-struct/lunii.ksy
lunii: /meta/imports/1:
error: kaitai-struct/wav.ksy:19:1:
error: found duplicate key doc-ref

And the second error (the lunii.img was made with win32diskimager) :

./sd-lunii-parser.py lunii.img
position of content structure: 51200000
position of number of stories: 51661066
Number of stories: 38422
Traceback (most recent call last):
File "/home/biocef/tsukuyomi/sd-parser/./sd-lunii-parser.py", line 26, in
string += story_sep + 'nbr_nodes: {:03}'.format(story.story_info.nbr_nodes)
File "/home/biocef/tsukuyomi/sd-parser/lunii.py", line 55, in story_info
self._m_story_info = self._root.StoryInfoStruct(self._io, self, self._root)
File "/home/biocef/tsukuyomi/sd-parser/lunii.py", line 80, in init
self._read()
File "/home/biocef/tsukuyomi/sd-parser/lunii.py", line 83, in _read
self.nbr_nodes = self._io.read_u2be()
File "/usr/local/lib/python3.9/dist-packages/kaitaistruct-0.10-py3.9.egg/kaitaistruct.py", line 173, in read_u2be
File "/usr/local/lib/python3.9/dist-packages/kaitaistruct-0.10-py3.9.egg/kaitaistruct.py", line 326, in read_bytes
EOFError: requested 2 bytes, but only 0 bytes available

How can I resolve these issues ?

Regards,
Biocef.

I find another way.