bongtrop / hbctool

Hermes Bytecode Reverse Engineering Tool (Assemble/Disassemble Hermes Bytecode)
MIT License
444 stars 71 forks source link

Requesting support for HBC version 59 #2

Closed euzada closed 3 years ago

euzada commented 3 years ago

Thank you for this great tool. I wonder if a support for HBC version 59 can be added. I will try it myself but i am not sure I will succeeded.

bongtrop commented 3 years ago

Hi, Euzada. Do you know what react-native version is using the HBC version 59? Or you can just give me the example APK.

Karim0x1 commented 3 years ago

Hi, thanks for making this tool, I thought I wouldn't be able to analyze react native apps anymore ! Anyway, I don't know if I should create another issue, but could you also add support for version 62 please ? Used by: com.canaltp.ametis

Thank you

euzada commented 3 years ago

Hi, Euzada. Do you know what react-native version is using the HBC version 59? Or you can just give me the example APK.

It uses Hermes version 0.1.0

I found the version using BytecodeFileFormat.h

at this place in the zip file: hermes-0.1.0.zip\hermes-0.1.0\include\hermes\BCGen\HBC\BytecodeFileFormat.h

https://github.com/facebook/hermes/archive/refs/tags/v0.1.0.zip

Thank you. I hope this is helpful.

Euzada

euzada commented 3 years ago

I compared the opcode.json file from version 74 in this repository and version 59.

This is what I found different:

"AsysncBreakCheck":[] should be replace in version 59 by: "DebuggerCheckBreak":[]

all other inputs are similar in both versions.

PS: I used BytecodeList.def file to verify the opcode.

Hope this is helpful

bongtrop commented 3 years ago

@euzada I have to build an Android application. And the react-native version is required not Hermes version 0.1.0. I need it for testing with a real application. However, if, you have the testing APK, please provide it to me. Thank you for your help.

euzada commented 3 years ago

@euzada I have to build an Android application. And the react-native version is required not Hermes version 0.1.0. I need it for testing with a real application. However, if, you have the testing APK, please provide it to me. Thank you for your help.

Sent you the APK.

bongtrop commented 3 years ago

Hi, thanks for making this tool, I thought I wouldn't be able to analyze react native apps anymore ! Anyway, I don't know if I should create another issue, but could you also add support for version 62 please ? Used by: com.canaltp.ametis

Thank you

Could you please create new issue for this?

@Karim0x1

bongtrop commented 3 years ago

Sorry for my late. my work has been very tiring. I'm working on it at branch add-hbc-v59. Just finish creating unit tests, building the example applications, and add raw material.

euzada commented 3 years ago

Sorry for my late. my work has been very tiring. I'm working on it at branch add-hbc-v59. Just finish creating unit tests, building the example applications, and add raw material.

Thank you for your help. I tried to build the project with poetry on Windows 10 64 bit, the build works but when I tried to run the test.py I got the following error: No module named 'docopt'. docopt has been installed when I run poetry install as it is in the requirement. Also, I need to copy test.py to the main folder of hbctool to not have the following error : No module named 'hbctool'.

So I tried to compile the project again from scratch.

I run the following command to install the V59 branch: pip install git+https://github.com/bongtrop/hbctool.git@add-hbc-v59

It compiled correctly on windows. I was able to run to hbctool command but if I used hbc version 59 file, I got the following error: AssertionError: The HBC version (59) is not supported.

I don't understand what I am doing wrong?

bongtrop commented 3 years ago

My work has not to finish yet! Wait a bit.

bongtrop commented 3 years ago

@euzada I have just finish my work. Please test with your app.

euzada commented 3 years ago

@euzada I have just finish my work. Please test with your app.

Test it and works well, thank you for your support.