mime

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PeMime             = "application/vnd.microsoft.portable-executable"
	ElfMime            = "application/x-elf"
	ElfRelocatableMime = "application/x-relocatable"
	ElfExecutableMime  = "application/x-executable"
	ElfSharedLibMime   = "application/x-sharedlib"
	ElfCoreDumpMime    = "application/x-coredump"
	MachoMime          = "application/x-mach-binary"
)

Mime

Variables

This section is empty.

Functions

func Class

func Class(in []byte) bool

Class matches a java class file.

func Elf

func Elf(in []byte) bool

Elf matches an Executable and Linkable Format file.

func ElfDump

func ElfDump(in []byte) bool

ElfDump matches a core dump file.

func ElfExe

func ElfExe(in []byte) bool

ElfExe matches an executable file.

func ElfLib

func ElfLib(in []byte) bool

ElfLib matches a shared library file.

func ElfObj

func ElfObj(in []byte) bool

ElfObj matches an object file.

func Exe

func Exe(in []byte) bool

Exe matches a Windows/DOS executable file.

func MachO

func MachO(in []byte) bool

MachO matches Mach-O binaries format.

Types

type BinType

type BinType int

BinType bintype

const (
	PE          BinType = 0x1
	ELF         BinType = 0x2
	MACHO       BinType = 0x4
	Shared      BinType = 0x10000 //shared object
	Executable  BinType = 0x20000
	Relocatable BinType = 0x40000
	CoreDump    BinType = 0x80000
)

defined

func Detect

func Detect(b []byte) (string, BinType, error)

Detect detect header

func (BinType) IsElf

func (b BinType) IsElf() bool

IsElf is elf file

func (BinType) IsMachO

func (b BinType) IsMachO() bool

IsMachO is macho file

func (BinType) IsPE

func (b BinType) IsPE() bool

IsPE is pe file

Jump to

Keyboard shortcuts

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