0.3.2 • Published 7 months ago

@tact-lang/opcode v0.3.2

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

TON Opcodes

A decompiler for The Open Network Virtual Machine (TVM) bytecode to Fift assembly.

Installation

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.

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:

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:

import {disassemble} from "@tact-lang/opcode"

const opcodes = disassemble({source: cell})

Thanks to

License

MIT

0.3.2

7 months ago

0.3.1

10 months ago

0.3.0

10 months ago

0.1.0

10 months ago

0.2.0

10 months ago

0.0.19

10 months ago

0.0.18

12 months ago

0.0.17

12 months ago

0.0.15

2 years ago

0.0.16

1 year ago

0.0.14

2 years ago

0.0.13

3 years ago

0.0.12

3 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago