Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'vlq_base128_le' #132

Closed
ehrenb opened this issue Nov 2, 2021 · 2 comments
Closed

ModuleNotFoundError: No module named 'vlq_base128_le' #132

ehrenb opened this issue Nov 2, 2021 · 2 comments

Comments

@ehrenb
Copy link

ehrenb commented Nov 2, 2021

When running the hobbits GUI and opening a classes.dex file and applying the Kaitai Struct Dex parser, I get the following error popup:

Analyzer Plugin Error: Plugin 'Kaitai Struct' reported an error with its processing: Failure Running parser in Python:
Python stderr:
Traceback (most recent call last):
  File "/tmp/HobbitsPythonJXpUia/thescript.py", line 162, in parse_data
    struct_module = importlib.__import__(package_name, fromlist=[class_name])
  File "<frozen importlib._bootstrap>", line 1109, in __import__
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/tmp/hobbits-nggZfm/dex.py", line 13, in <module>
    import vlq_base128_le
ModuleNotFoundError: No module named 'vlq_base128_le'

I believe this is because the Dex parser yaml has an import 'vlq_base128_le':

https://formats.kaitai.io/dex/index.html :

meta:
  id: dex
  title: Android Dalvik VM executable (dex)
  file-extension: dex
  xref:
    pronom: fmt/694
    wikidata: Q29000585
  tags:
    - android
    - executable
  license: Apache-2.0
  imports:
    - /common/vlq_base128_le
...

My guess is that this occurs because 'vlq_base128_le.py' does not get pulled into the tmp directory. When listing files in one of the temp directories after attempting to use the Dex parser, I see the following structure:

cd /tmp
tree hobbits-BEeLZN
├── dex.py
├── input_bit_container.bits
├── parsed_ranges.json
├── __pycache__
│   └── dex.cpython-39.pyc
└── pydeps
    └── kaitaistruct.py

I have tested on both v0.51.1 and v0.52.0 and get the same results. I am able to use other Kaitai parsers, such as ELF which has no import (http://formats.kaitai.io/elf/) just fine without error.

@hello-adam
Copy link
Member

Yeah, I think there's issues with the parsers importing each other. I need to revamp that a little bit. I should be able to sit down with this within a few weeks.

hello-adam pushed a commit that referenced this issue Mar 6, 2022
## [0.53.1](v0.53.0...v0.53.1) (2022-03-06)

### Bug Fixes

* rework some kaitai plugin stuff that was broken [#132](#132) ([5bc7dd2](5bc7dd2))
@hello-adam
Copy link
Member

This might be fixed in 0.53.1 - I was able to get wav (which imports riff) to work

goldest-star added a commit to goldest-star/binary-analysis-tool that referenced this issue Jun 4, 2023
## [0.53.1](Mahlet-Inc/hobbits@v0.53.0...v0.53.1) (2022-03-06)

### Bug Fixes

* rework some kaitai plugin stuff that was broken [#132](Mahlet-Inc/hobbits#132) ([5bc7dd2](Mahlet-Inc/hobbits@5bc7dd2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants