0.3.1 • Published 3 months ago

@tact-lang/opcode v0.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 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.1

3 months ago

0.3.0

4 months ago

0.1.0

4 months ago

0.2.0

4 months ago

0.0.19

4 months ago

0.0.18

5 months ago

0.0.17

5 months ago

0.0.15

1 year ago

0.0.16

11 months ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago