Crate hlbc

source ·
Expand description

Hashlink bytecode disassembler and analyzer. See Bytecode for an entrypoint to the library.

Note about safety

We don’t deal with self-references, hence we deal with indexes into structures. Be careful when calling functions on Ref* objects, as no bound checking is done and every index is assumed to be valid.

Modules

  • Analysis functions and callgraph generation
  • Formatting code for displaying bytecode. Formatting is handled through the BytecodeFmt trait which permit easy extensibility and re-usability across formatting implementations.
  • Opcodes definitions.
  • Bytecode elements definitions. All the Ref* types in this modules are references to bytecode elements like constants or function. They are required since we cannot use rust references as that would make our structure self-referential. They makes the code look a bit more complicated than it actually is. Every Ref* struct is cheaply copyable.

Structs

  • Bytecode structure containing all the information. Every field is public for flexibility, but you aren’t encouraged to modify them.

Enums

Traits

Type Aliases

  • Cheaply clonable with inline storage