build

package
v0.0.0-...-c65d5b7 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RandomGoFile

func RandomGoFile() string

RandomGoFile 随机命名 Go 代码文件

func RenameGoTrimSuffix

func RenameGoTrimSuffix(name string) string

RenameGoTrimSuffix 删除文件名 .go 后缀,重命名为 .exe

func RenameSignedPEName

func RenameSignedPEName(name string) string

RenameSignedPEName 命名签名后的PE文件

func WriteStrings

func WriteStrings(content, fileName string) error

Types

type CertThief

type CertThief struct {
	SignDir  string // 签名目录
	SrcFile  string // 未签名的源文件
	DstFile  string // 已签名的目标文件
	SignedPE string // 签名后的输出文件
	CertFile string // 证书文件
}

CertThief 结构体,用于签名操作

func (*CertThief) ReadCertTable

func (ct *CertThief) ReadCertTable(filePath string) ([]byte, error)

ReadCertTable 从PE文件中读取证书表

func (*CertThief) SaveCertificate

func (ct *CertThief) SaveCertificate() error

SaveCertificate 将证书表保存到指定文件

func (*CertThief) SaveSignedPE

func (ct *CertThief) SaveSignedPE(certTable []byte, outputFileName string) error

SaveSignedPE 保存带有证书表的PE文件

func (*CertThief) SignExecutable

func (ct *CertThief) SignExecutable() error

SignExecutable 使用目标文件的证书对源文件进行签名

func (*CertThief) SignWithStolenCert

func (ct *CertThief) SignWithStolenCert() error

SignWithStolenCert 使用窃取的证书对源文件进行签名

type CompileOpts

type CompileOpts struct {
	GoFileName  string // Go 文件名称
	ExeFileName string // Exe 文件名称
	CompilePath string // 编译路径
	HideConsole bool   // 编译隐藏控制台
	BuildMode   string // 构建模式, 推荐值:pie

	// Garble 专用参数
	GDebug    bool // 开启Debug日志
	GSeed     bool // 随机 Base64 编码的种子
	GLiterals bool // 对字符串和数字字面量进行混淆
	GTiny     bool // 最小化构建
}

func (CompileOpts) Compile

func (c CompileOpts) Compile() error

func (CompileOpts) Strip

func (c CompileOpts) Strip()

type Compiler

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

func NewCompiler

func NewCompiler(opts CompileOpts) *Compiler

func (*Compiler) BuildArgs

func (c *Compiler) BuildArgs() []string

type SignOpts

type SignOpts struct {
	SignPath string // 签名路径
	UnSign   string // 未签名的原始文件
	Signed   string // 签名后的文件命名
	Thief    string // 窃取签名对象
	DstCert  string // 证书输出命名
	Cert     string // 指定证书
}

type UpxOpts

type UpxOpts struct {
	Level   string // 压缩等级
	SrcExe  string // 目标文件
	SrcPath string // 压缩目录
	UpxPath string // upx.exe 文件目录
	Keep    bool   // 保留原始文件
	Force   bool   // 强制压缩
}

func (UpxOpts) Pack

func (upx UpxOpts) Pack() error

Jump to

Keyboard shortcuts

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