Closed hexpwn closed 1 year ago
Ohh, I miss this. Thank you for your contribution.
Would you please help me? I am trying to check an android application.
C:\Users\Max\appname\co.appname\assets>pip uninstall hbctool
Found existing installation: hbctool 0.1.5
Uninstalling hbctool-0.1.5:
Would remove:
c:\users\max\appdata\local\programs\python\python310\lib\site-packages\hbctool-0.1.5.dist-info\*
c:\users\max\appdata\local\programs\python\python310\lib\site-packages\hbctool\*
c:\users\max\appdata\local\programs\python\python310\scripts\hbctool.exe
Would not remove (might be manually added):
c:\users\max\appdata\local\programs\python\python310\lib\site-packages\hbctool\hbc\hbc84\__init__.py
c:\users\max\appdata\local\programs\python\python310\lib\site-packages\hbctool\hbc\hbc84\data\opcode.json
c:\users\max\appdata\local\programs\python\python310\lib\site-packages\hbctool\hbc\hbc84\data\structure.json
c:\users\max\appdata\local\programs\python\python310\lib\site-packages\hbctool\hbc\hbc84\parser.py
c:\users\max\appdata\local\programs\python\python310\lib\site-packages\hbctool\hbc\hbc84\raw\BytecodeFileFormat.h
c:\users\max\appdata\local\programs\python\python310\lib\site-packages\hbctool\hbc\hbc84\raw\BytecodeList.def
c:\users\max\appdata\local\programs\python\python310\lib\site-packages\hbctool\hbc\hbc84\raw\SerializedLiteralGenerator.h
c:\users\max\appdata\local\programs\python\python310\lib\site-packages\hbctool\hbc\hbc84\tool\opcode_generator.py
c:\users\max\appdata\local\programs\python\python310\lib\site-packages\hbctool\hbc\hbc84\translator.py
c:\users\max\appdata\local\programs\python\python310\lib\site-packages\hbctool\hbc\hbc85\__init__.py
c:\users\max\appdata\local\programs\python\python310\lib\site-packages\hbctool\hbc\hbc85\data\opcode.json
c:\users\max\appdata\local\programs\python\python310\lib\site-packages\hbctool\hbc\hbc85\data\structure.json
c:\users\max\appdata\local\programs\python\python310\lib\site-packages\hbctool\hbc\hbc85\parser.py
c:\users\max\appdata\local\programs\python\python310\lib\site-packages\hbctool\hbc\hbc85\raw\BytecodeFileFormat.h
c:\users\max\appdata\local\programs\python\python310\lib\site-packages\hbctool\hbc\hbc85\raw\BytecodeList.def
c:\users\max\appdata\local\programs\python\python310\lib\site-packages\hbctool\hbc\hbc85\raw\SerializedLiteralGenerator.h
c:\users\max\appdata\local\programs\python\python310\lib\site-packages\hbctool\hbc\hbc85\tool\opcode_generator.py
c:\users\max\appdata\local\programs\python\python310\lib\site-packages\hbctool\hbc\hbc85\translator.py
c:\users\max\appdata\local\programs\python\python310\lib\site-packages\hbctool\index.android.bundle
Proceed (Y/n)? y
Successfully uninstalled hbctool-0.1.5
C:\Users\Max\appname\co.appname\assets>python -m pip install --upgrade hbctool
Collecting hbctool
Using cached hbctool-0.1.5-py3-none-any.whl (9.8 MB)
Requirement already satisfied: docopt<0.7.0,>=0.6.2 in c:\users\max\appdata\local\programs\python\python310\lib\site-packages (from hbctool) (0.6.2)
Installing collected packages: hbctool
Successfully installed hbctool-0.1.5
C:\Users\Max\appname\co.appname\assets>hbctool disasm index.android.bundle test_hasm
[*] Disassemble 'index.android.bundle' to 'test_hasm' path
Traceback (most recent call last):
File "C:\Users\Max\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\Max\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\Max\AppData\Local\Programs\Python\Python310\Scripts\hbctool.exe\__main__.py", line 7, in <module>
File "C:\Users\Max\AppData\Local\Programs\Python\Python310\lib\site-packages\hbctool\__init__.py", line 61, in main
disasm(args['<HBC_FILE>'], args['<HASM_PATH>'])
File "C:\Users\Max\AppData\Local\Programs\Python\Python310\lib\site-packages\hbctool\__init__.py", line 33, in disasm
hbco = hbc.load(f)
File "C:\Users\Max\AppData\Local\Programs\Python\Python310\lib\site-packages\hbctool\hbc\__init__.py", line 29, in load
assert version in HBC, f"The HBC version ({version}) is not supported."
AssertionError: The HBC version (84) is not supported.
Maybe because the Python PIP repository is not up to date. I am trying to manually put the new files of this project in C:\Users\Max\AppData\Local\Programs\Python\Python310\Lib\site-packages\hbctool
.
I deleted all files inside this directory and cloned this project there.
Now I got another new error:
>hbctool disasm index.android.bundle test_hasm
Traceback (most recent call last):
File "C:\Users\Max\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\Max\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\Max\AppData\Local\Programs\Python\Python310\Scripts\hbctool.exe\__main__.py", line 4, in <module>
ImportError: cannot import name 'main' from 'hbctool' (unknown location)
Any kind of suggestions and help would be great. Thanks in advance.
Fixed
hbctool/hbc/hbc84/data/opcode.json
, removing theInc
andDec
opcodes that were added by commitbfa2540
(Merge pull request #22 from hugohabicht01/draft/hbc-v85, 2022-10-25) and not applicable to v84Fixed
hbctool/hbc/hbc84/data/structure.json
to includesegmentID
andfunctionSourceCount
in theheader
structure. Also added theFunctionSourceTable
description.Fixed
hbctool/hbc/hbc84/parser.py
to read the "Function Source Table" data. This data is only read to advance the pointer in the reader... nothing is done with it.