Documentation ¶
Index ¶
- type BackupOptions
- type CmdExecution
- type CompressionTuningOptions
- type Options
- type UPX
- func (upx *UPX) Compress(file string, intensity int, options Options) (bool, error)
- func (upx *UPX) Decompress(file string, options Options) (bool, error)
- func (upx *UPX) GetArgs() []string
- func (po *UPX) GetCompressedFileSize() uint64
- func (pe *UPX) GetErrorMessage() error
- func (po *UPX) GetFormat() string
- func (po *UPX) GetName() string
- func (po *UPX) GetOriginalFileSize() uint64
- func (po *UPX) GetRatio() float64
- func (upx *UPX) ListCompressedFile(file string, options Options) (bool, error)
- func (upx *UPX) TestCompressedFile(file string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackupOptions ¶
type BackupOptions struct { // Backup keep backup files Backup bool }
Read description for Options struct.
type CmdExecution ¶ added in v0.2.0
type CmdExecution struct {
// contains filtered or unexported fields
}
CmdExecution describe the command after its execution. It collects info about its stderr/stdout, exit status, etc.
func (*CmdExecution) GetCompressedFileSize ¶ added in v0.2.0
func (po *CmdExecution) GetCompressedFileSize() uint64
GetCompressedFileSize return the compressed file size value from the command execution.
func (*CmdExecution) GetErrorMessage ¶ added in v0.2.0
func (pe *CmdExecution) GetErrorMessage() error
GetErrorMessage return the error value from the command execution.
func (*CmdExecution) GetFormat ¶ added in v0.2.0
func (po *CmdExecution) GetFormat() string
GetFormat return the format value from the command execution.
func (*CmdExecution) GetName ¶ added in v0.2.0
func (po *CmdExecution) GetName() string
GetName return the name value from the command execution.
func (*CmdExecution) GetOriginalFileSize ¶ added in v0.2.0
func (po *CmdExecution) GetOriginalFileSize() uint64
GetOriginalFileSize return the original file size value from the command execution.
type CompressionTuningOptions ¶
type CompressionTuningOptions struct { // Brute try all available compression methods, filters and variants Brute int }
Read description for Options struct.
type Options ¶
type Options struct { // Output write output to 'FILE' Output string // Force force compression of suspicious files Force bool // Verbose enable/disable verbosity Verbose bool // CompressionTuningOpt keep track of CompressionTuningOptions CompressionTuningOpt CompressionTuningOptions // BackupOpt keep track of BackupOptions BackupOpt BackupOptions }
Options describe the command args provided by the upx utility. Here's an example: --- Options:
-q be quiet -v be verbose -oFILE write output to 'FILE' -f force compression of suspicious files --no-color, --mono, --color, --no-progress change look
Compression tuning options:
--brute try all available compression methods & filters [slow] --ultra-brute try even more compression variants [very slow]
Backup options:
-k, --backup keep backup files --no-backup no backup files [default]
type UPX ¶
type UPX struct { // Binary file for upx (it is visible in case you have different binary name) Binary string // UPX command execution results CmdExecution // contains filtered or unexported fields }
UPX describe the execution of upx utility.
func NewUPXWithBinary ¶ added in v0.2.1
NewUPXWithBinary return a new instance of upx object, not in PATH.
func (*UPX) Compress ¶
Compress execute a compression with upx. It return false with an error message in case of fail, true with nil otherwhise.
func (*UPX) Decompress ¶
Decompress execute a decompression with upx. It return false with an error message in case of fail, true with nil otherwhise.
func (*UPX) GetCompressedFileSize ¶ added in v0.2.0
func (po *UPX) GetCompressedFileSize() uint64
GetCompressedFileSize return the compressed file size value from the command execution.
func (*UPX) GetErrorMessage ¶ added in v0.2.0
func (pe *UPX) GetErrorMessage() error
GetErrorMessage return the error value from the command execution.
func (*UPX) GetFormat ¶ added in v0.2.0
func (po *UPX) GetFormat() string
GetFormat return the format value from the command execution.
func (*UPX) GetName ¶ added in v0.2.0
func (po *UPX) GetName() string
GetName return the name value from the command execution.
func (*UPX) GetOriginalFileSize ¶ added in v0.2.0
func (po *UPX) GetOriginalFileSize() uint64
GetOriginalFileSize return the original file size value from the command execution.
func (*UPX) GetRatio ¶ added in v0.2.0
func (po *UPX) GetRatio() float64
GetRatio return the ratio value from the command execution.