gostrip

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cli.Command{
	Category:    "Ext",
	Name:        "gostrip",
	Aliases:     []string{"strip"},
	Usage:       "Strip golang binary file",
	Description: `Modify from [Go-strip @w8ay] https://github.com/boy-hack/go-strip`,
	Flags: []cli.Flag{
		&cli.BoolFlag{
			Name:    "force",
			Aliases: []string{"f"},
			Usage:   "Force to strip 'Go Struct Name' (未完全测试,请谨慎使用)",
			Value:   false,
		},
	},
	Action: func(c *cli.Context) error {
		opts := &Opts{}
		if c.Bool("force") {
			opts.IsForce = true
		}
		return Strip(c.Args().First(), opts)
	},
}

Functions

func Strip

func Strip(filename string, opts *Opts) error

Types

type GoFile

type GoFile struct {
	*gore.GoFile
	Origin       []byte
	InitPackages sync.Once
}

func (*GoFile) GetBytes

func (f *GoFile) GetBytes(offset uint64, length uint64) []byte

func (*GoFile) Init

func (f *GoFile) Init() error

func (*GoFile) Replace

func (f *GoFile) Replace(origin []byte, new []byte, n int)

func (*GoFile) Save

func (f *GoFile) Save(filename string) error

func (*GoFile) SetBytes

func (f *GoFile) SetBytes(offset uint64, length uint64, value []byte) error

type Opts

type Opts struct {
	IsForce bool
}

type TypeData

type TypeData struct {
	Offset uint64
	Length uint64
}

type TypeStringOffset

type TypeStringOffset struct {
	Func     []TypeData
	FileName []TypeData
	Types    []TypeData
}
var TypeStringOffsets *TypeStringOffset = new(TypeStringOffset)

Jump to

Keyboard shortcuts

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