disassemble command reads and disassembles Hermes Bytecode (HBC) files, converting binary bytecode into a human-readable parsed format. This is useful for analyzing React Native app bundles, inspecting function implementations, and understanding bytecode structure.
Usage
Required Flags
Path to the input HBC (Hermes Bytecode) file to disassemble.
Optional Flags
Path to the output file where the disassembled content will be written. If not specified, the command will parse the file without creating output.
Content Selection Flags
Include functions in the disassembled output. Functions contain the parsed bytecode instructions and are typically the most important part of the output.
Include the strings table in the disassembled output. This shows all string literals used in the bytecode.
Include objects extracted from the bytecode. This parses
NewObjectWithBuffer instructions and displays their key-value content.Include function objects in the disassembled output. This provides a higher-level view of function metadata.
Include function objects Intermediate Representation (IR) in the output. This prints structural IR, content IR1, and content IR2 along with their SHA256 hashes. Note:
--function-objects must be true for this flag to work.Normalization Flags
Normalize the output for comparison purposes. Valid values:
0: No normalization (default) - outputs raw bytecode representation1: IR1 normalization - applies first-level normalization2: IR2 normalization - applies second-level normalization
Examples
Basic Disassembly
Disassemble an HBC file and write functions to an output file:Include Strings and Objects
Disassemble with strings table and extracted objects:Generate Function Object IR with Hashes
Extract function object IR representations with SHA256 fingerprints (useful for vulnerability analysis):Full Analysis with All Content
Disassemble with all available content types:Normalized Output for Comparison
Generate IR2-normalized output for fingerprinting:Output Format
The disassembled output file contains:- Header Information: Hermes magic number, bytecode version, and function count
- Strings (if
-s): All string literals with their string kind (identifier, predefined, etc.) - Functions (if
-f, default): Each function with:- Function index, name, parameter count, and bytecode size
- Offset in the original file
- Disassembled bytecode instructions
- Objects (if
-j): Extracted objects fromNewObjectWithBufferinstructions - Function Objects (if
-z): High-level function object representations
Sample Output
Common Use Cases
Analyzing React Native App Bundles
Extract function implementations from a production app:Generating Fingerprints for Vulnerability Detection
Create IR hashes without writing a full output file:Debugging Hermes Compilation
Compare bytecode at different normalization levels:Notes
- The command supports 27 Hermes bytecode versions (v61-v96)
- If the output path is not specified, the file is parsed but no output is written
- Functions are included by default; use
-f=falseto exclude them - The
-rflag is particularly useful for theanalyzecommand’s fingerprinting workflow - Normalization levels affect how instructions and identifiers are represented in the IR