binlib

package
v0.0.0-...-619a8dd Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const CoffHdrLen = 20
View Source
const CoffLongNameLen = 32
View Source
const CoffNameLen = 8
View Source
const CoffRelocItemLen = 16
View Source
const CoffSectBSS = uint32(0x0080)
View Source
const CoffSectDATA = uint32(0x0040)
View Source
const CoffSectHdrLen = 40
View Source
const CoffSectTEXT = uint32(0x0020)
View Source
const CoffSymbClassAuto = byte(0x01)
View Source
const CoffSymbClassExternal = byte(0x05)
View Source
const CoffSymbClassFile = byte(0x67)
View Source
const CoffSymbClassGlobal = byte(0x02)
View Source
const CoffSymbClassLabel = byte(0x06)
View Source
const CoffSymbClassStatic = byte(0x03)
View Source
const CoffSymbEntryLen = 18
View Source
const CoffSymbSCNAbs = int16(-1)
View Source
const CoffSymbSCNExt = int16(0)
View Source
const XoutHdrLen = 16 /* header length */
View Source
const XoutMagicNonSeg = 0xee02 /* non segmented, non executable */
View Source
const XoutMagicNonSegShared = 0x0006 /* non segmented, non executable, shared */
View Source
const XoutMagicNonSegSplit = 0xee0a /* non segmented, non executable, split ID */
View Source
const XoutMagicNonSegX = 0xee03 /* non segmented, executable not, shared*/
View Source
const XoutMagicNonSegXShared = 0xee07 /* non segmented, executable, shared */
View Source
const XoutMagicNonSegXSplit = 0xee0b /* non segmented, executable, split ID */
View Source
const XoutMagicSeg = 0xee00 /* segmented, non executable */
View Source
const XoutMagicSegX = 0xee01 /* segmented, executable */
View Source
const XoutNameLen = 8 /* symbol name length */
View Source
const XoutRelocItemLen = 6 /* reloc item length */
View Source
const XoutRelocLSG = byte(3) /* 32bit long segmented  */
View Source
const XoutRelocOFF = byte(1) /* 16bit non segmented   */
View Source
const XoutRelocSSG = byte(2) /* 16bit short segmented */
View Source
const XoutRelocXLSG = byte(7) /* long segmented referenced by external      */
View Source
const XoutRelocXOFF = byte(5) /* 16bit non segmented referenced by external */
View Source
const XoutRelocXSSG = byte(6) /* short segmented referenced by external     */
View Source
const XoutSegBSS = byte(1) /* bss segment */
View Source
const XoutSegCDMIX = byte(6) /* mixed code and data, not protectable */
View Source
const XoutSegCDMIX_P = byte(7) /* mixed code and data, protectable */
View Source
const XoutSegCODE = byte(3) /* code segment */
View Source
const XoutSegCONST = byte(4) /* constant pool */
View Source
const XoutSegDATA = byte(5) /* initialized data */
View Source
const XoutSegEntryLen = 4 /* segment entry length */
View Source
const XoutSegSTACK = byte(2) /* stack segment */
View Source
const XoutSegUNDEF = byte(0) /* linker assign the address */
View Source
const XoutSymbEntryLen = 12 /* symbol entry length */
View Source
const XoutSymbGlobal = byte(3) /* global definition */
View Source
const XoutSymbLocal = byte(1) /* local symbol */
View Source
const XoutSymbSeg = byte(4) /* segment name */
View Source
const XoutSymbUndefEX = byte(2) /* undefined external */

Variables

This section is empty.

Functions

func ConvertName

func ConvertName(bname [8]byte) string

Types

type CoffFile

type CoffFile struct {
	Filep    *os.File
	Header   CoffHdr
	SectTbl  []CoffSectHdr
	RelocTbl []CoffRelocItem
	SymbTbl  []interface{}
	CodePart *[]byte
}

func (*CoffFile) Open

func (cf *CoffFile) Open(file *os.File)

func (*CoffFile) WriteCodePart

func (cf *CoffFile) WriteCodePart() error

func (*CoffFile) WriteHdr

func (cf *CoffFile) WriteHdr() error

func (*CoffFile) WriteRelocTbl

func (cf *CoffFile) WriteRelocTbl() error

func (*CoffFile) WriteSectTbl

func (cf *CoffFile) WriteSectTbl() error

func (*CoffFile) WriteSymbTbl

func (cf *CoffFile) WriteSymbTbl() error

type CoffHdr

type CoffHdr struct {
	Magic       uint16
	NumSects    uint16
	Date        uint32
	SymbTblFpos int32
	NumSymbs    uint32
	OptHdrLen   uint16
	Flags       uint16
}

type CoffRelocItem

type CoffRelocItem struct {
	Vaddr   uint32
	SymbIdx uint32
	Offset  uint32
	Type    uint16
	Stuff   uint16
}

type CoffSectHdr

type CoffSectHdr struct {
	Name         [CoffNameLen]byte
	Paddr        uint32
	Vaddr        uint32
	Length       uint32
	Fpos         int32
	RelocTblFpos int32
	LineNumsFpos int32
	NumRelocs    uint16
	NumLines     uint16
	Flags        uint32
}

type CoffSymbAuxFile

type CoffSymbAuxFile struct {
	Name [18]byte
}

type CoffSymbAuxSect

type CoffSymbAuxSect struct {
	Length    uint32
	NumRelocs uint16
	NumLines  uint16
	Dummy     [10]byte
}

type CoffSymbEntry

type CoffSymbEntry struct {
	Name      [CoffNameLen]byte
	Value     uint32
	SectNo    int16
	Type      uint16
	StrgClass byte
	NumAux    byte
}

type XoutFile

type XoutFile struct {
	Filep       *os.File
	Length      int64
	CodePos     int64
	RelocTblPos int64
	SymbTblPos  int64
	NumRelocs   int
	NumSymbs    int

	Header   XoutHeader
	SegTbl   []XoutSeg
	CodePart []byte
	RelocTbl []XoutRelocItem
	SymbTbl  []XoutSymbEntry
}

func (*XoutFile) Read

func (xf *XoutFile) Read(file *os.File) error

func (*XoutFile) ReadCodePart

func (xf *XoutFile) ReadCodePart() error

func (*XoutFile) ReadHdr

func (xf *XoutFile) ReadHdr() error

func (*XoutFile) ReadRelocTbl

func (xf *XoutFile) ReadRelocTbl() error

func (*XoutFile) ReadSegTbl

func (xf *XoutFile) ReadSegTbl() error

func (*XoutFile) ReadSymbTbl

func (xf *XoutFile) ReadSymbTbl() error

type XoutHeader

type XoutHeader struct {
	Magic       uint16
	NumSegs     int16
	CodePartLen int32
	RelocsLen   int32
	SymbsLen    int32
}

type XoutRelocItem

type XoutRelocItem struct {
	SegIdx   byte
	Type     byte
	Location uint16
	SymbIdx  uint16
}

type XoutSeg

type XoutSeg struct {
	Number byte
	Type   byte
	Length uint16
}

type XoutSymbEntry

type XoutSymbEntry struct {
	SegIdx byte
	Type   byte
	Value  uint16
	Name   [8]byte
}

Jump to

Keyboard shortcuts

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