ctrlflow

package
v0.0.0-...-3696fba Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2024 License: BSD-3-Clause Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Obfuscate

func Obfuscate(fset *token.FileSet, ssaPkg *ssa.Package, files []*ast.File, obfRand *mathrand.Rand) (newFileName string, newFile *ast.File, affectedFiles []*ast.File, err error)

Obfuscate obfuscates control flow of all functions with directive using control flattening. All obfuscated functions are removed from the original file and moved to the new one. Obfuscation can be customized by passing parameters from the directive, example:

//garble:controlflow flatten_passes=1 junk_jumps=0 block_splits=0 func someMethod() {}

flatten_passes - controls number of passes of control flow flattening. Have exponential complexity and more than 3 passes are not recommended in most cases. junk_jumps - controls how many junk jumps are added. It does not affect final binary by itself, but together with flattening linearly increases complexity. block_splits - controls number of times largest block must be splitted. Together with flattening improves obfuscation of long blocks without branches.

Types

This section is empty.

Jump to

Keyboard shortcuts

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