P1sec / hermes-dec

A reverse engineering tool for decompiling and disassembling the React Native Hermes bytecode
GNU Affero General Public License v3.0
512 stars 52 forks source link

TypeError on Hermes version 94 #10

Closed randshell closed 7 months ago

randshell commented 7 months ago

Logs:

[...]
Address 256941: Line 17179891934 - Column 38654917786 - Statement 445715
  Address 256946: Line 17179891934 - Column 38654917784 - Statement 445715
  Address 256946: Line 19327375581 - Column 38654917789 - Statement 445715
  Address 256926: Line 19327375581 - Column 42949885084 - Statement 445715
  Address 256940: Line 19327375581 - Column 42949885115 - Statement 445715
Traceback (most recent call last):
  File "/home/kali/.local/bin/hbc-file-parser", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/kali/.local/share/pipx/venvs/hermes-dec/lib/python3.11/site-packages/hermes_dec/parsers/hbc_file_parser.py", line 915, in main
    print_debug_info(hbc_reader.sources_data_storage)
  File "/home/kali/.local/share/pipx/venvs/hermes-dec/lib/python3.11/site-packages/hermes_dec/parsers/debug_info_parser.py", line 64, in print_debug_info
    current_statement += statement_delta
TypeError: unsupported operand type(s) for +=: 'int' and 'NoneType'
p1-mmr commented 7 months ago

Hello,

I pushed something in commit 7379e9e, should be better this way?

randshell commented 7 months ago

Thank you for the quick update!

It seems to perform the same way, still stops at Address 256940 with TypeError.

marin-m commented 7 months ago

With the latest version from Git? If yes, can you please share your sample at labs at p1sec dot com?

randshell commented 7 months ago

Hi, I've rechecked again and noticed that the https://github.com/P1sec/hermes-dec/commit/7379e9ee1a0bc835657b68c09801cd0d6bb570b2 commit was on the origin/feature/web-ui-with-graph-view--index-socket-comm branch. I've tested this version now and it fixes the issue for me.

Thank you!

p1-mmr commented 7 months ago

Ah I pushed this commit to the main, sorry. Thanks for noticing.