https://github.com/tact-lang/ton-opcode
Decompiler of BOC files
https://github.com/tact-lang/ton-opcode
disassembler ton tvm
Last synced: 6 months ago
JSON representation
Decompiler of BOC files
- Host: GitHub
- URL: https://github.com/tact-lang/ton-opcode
- Owner: tact-lang
- License: mit
- Created: 2023-03-23T21:02:55.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-19T18:50:31.000Z (7 months ago)
- Last Synced: 2025-03-30T21:09:55.439Z (6 months ago)
- Topics: disassembler, ton, tvm
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/@tact-lang/opcode
- Size: 9.71 MB
- Stars: 21
- Watchers: 6
- Forks: 9
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# TON Opcodes
A decompiler for The Open Network Virtual Machine (TVM) bytecode to Fift assembly.
## Installation
```bash
yarn add @tact-lang/opcode
```## Usage
For most cases you will want to disassemble a BoC file generated by the Tact/FunC/Tolk compiler. In this case decompiler will unpack the dictionary to procedures and methods.
```typescript
import {AssemblyWriter, disassembleRoot} from "@tact-lang/opcode"// Disassemble a source file into a program AST
const program = disassembleRoot(source, {
computeRefs: false,
})// Write the program AST into a Fift assembly string
const res = AssemblyWriter.write(program, {})
console.log(res)
```If you want to decompile BoC file without unpacking of the dictionary, you can do the following:
```typescript
import {AssemblyWriter, disassembleRawRoot} from "@tact-lang/opcode"const program = disassembleRawRoot(source)
const res = AssemblyWriter.write(program, {})
console.log(res)
```If you want to disassemble a single Cell into an array of opcodes, you can do the following:
```typescript
import {disassemble} from "@tact-lang/opcode"const opcodes = disassemble({source: cell})
```## Thanks to
- [Steve Korshakov](https://github.com/ex3ndr)
- [Nick Nekilov](https://github.com/NickNekilov)
- [Vladimir Lebedev](https://github.com/hacker-volodya)## License
MIT