decompiler

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2026 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	Type       string   // "if", "while", "sequence"
	Condition  string   // For if/while
	ThenBlock  *Block   // For if/while
	ElseBlock  *Block   // For if (optional)
	Statements []string // For sequence
	Children   []*Block // For nested blocks
}

Block represents a control flow block (if, while, or sequence of statements)

type ControlFlowAnalyzer

type ControlFlowAnalyzer struct {
	// contains filtered or unexported fields
}

ControlFlowAnalyzer recursively processes instructions to build control flow structure

func NewControlFlowAnalyzer

func NewControlFlowAnalyzer(decompiler *Decompiler, instructions []scripting.Instruction, paramNames map[int]string, signalDef map[int]string, globalNames map[int]string) *ControlFlowAnalyzer

NewControlFlowAnalyzer creates a new analyzer

func (*ControlFlowAnalyzer) ProcessRange

func (cfa *ControlFlowAnalyzer) ProcessRange(start, end int, indent int) []string

ProcessRange processes a range of instructions [start, end) and returns blocks

type Decompiler

type Decompiler struct {
	// contains filtered or unexported fields
}

Decompiler converts COB bytecode to BOS source or disassembly

func NewDecompiler

func NewDecompiler(cob *scripting.COB) *Decompiler

NewDecompiler creates a new decompiler

func (*Decompiler) Decompile

func (d *Decompiler) Decompile() (string, error)

Decompile converts COB bytecode to valid BOS source code

func (*Decompiler) Disassemble

func (d *Decompiler) Disassemble(format assembly.Format) (string, error)

Disassemble produces a human-readable bytecode listing. Pass assembly.Plain for a clean listing or assembly.Annotated for the rich view with flow-control arrows and hex opcodes.

func (*Decompiler) DisassembleScript

func (d *Decompiler) DisassembleScript(name string, format assembly.Format) (string, error)

DisassembleScript produces bytecode listing for a specific named script.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL