package coff
import "github.com/akavel/rsrc/coff"
Index ¶
- Constants
- Variables
- type Auxiliary
- type Coff
- func NewRSRC() *Coff
- func (coff *Coff) AddResource(kind uint32, id uint16, data Sizer)
- func (coff *Coff) Arch(arch string) error
- func (coff *Coff) Freeze()
- type DataEntry
- type Dir
- type DirEntries
- type DirEntry
- type Dirs
- type PaddedData
- type RelocationEntry
- type Sizer
- type StringsHeader
- type Symbol
Constants ¶
const ( MASK_SUBDIRECTORY = 1 << 31 RT_ICON = 3 RT_GROUP_ICON = 3 + 11 RT_MANIFEST = 24 )
const ( DT_PTR = 1 T_UCHAR = 12 )
http://www.delorie.com/djgpp/doc/coff/symtab.html
Variables ¶
var ( STRING_RSRC = [8]byte{'.', 'r', 's', 'r', 'c', 0, 0, 0} LANG_ENTRY = DirEntry{NameOrId: 0x0409} //FIXME: language; what value should be here? )
Types ¶
type Auxiliary ¶
type Auxiliary [18]byte
type Coff ¶
type Coff struct { pe.FileHeader pe.SectionHeader32 *Dir DataEntries []DataEntry Data []PaddedData Relocations []RelocationEntry Symbols []Symbol StringsHeader Strings []Sizer }
func NewRSRC ¶
func NewRSRC() *Coff
func (*Coff) AddResource ¶
NOTE: function assumes that 'id' is increasing on each entry NOTE: only usable for Coff created using NewRSRC
func (*Coff) Arch ¶
NOTE: must be called immediately after NewRSRC, before any other functions.
func (*Coff) Freeze ¶
func (coff *Coff) Freeze()
Freeze fills in some important offsets in resulting file.
type DataEntry ¶
type DataEntry struct { OffsetToData uint32 Size1 uint32 CodePage uint32 //FIXME: what value here? for now just using 0 Reserved uint32 }
type Dir ¶
type Dir struct { Characteristics uint32 TimeDateStamp uint32 MajorVersion uint16 MinorVersion uint16 NumberOfNamedEntries uint16 NumberOfIdEntries uint16 DirEntries Dirs }
type DirEntries ¶
type DirEntries []DirEntry
type DirEntry ¶
type Dirs ¶
type Dirs []Dir
type PaddedData ¶
type RelocationEntry ¶
type RelocationEntry struct { RVA uint32 // "offset within the Section's raw data where the address starts." SymbolIndex uint32 // "(zero based) index in the Symbol table to which the reference refers." Type uint16 }
type Sizer ¶
type Sizer interface { Size() int64 //NOTE: must not exceed limits of uint32, or behavior is undefined }
type StringsHeader ¶
type StringsHeader struct { Length uint32 }
type Symbol ¶
type Symbol struct { Name [8]byte Value uint32 SectionNumber uint16 Type uint16 StorageClass uint8 AuxiliaryCount uint8 Auxiliaries []Auxiliary }
Source Files ¶
- Version
- v0.10.2 (latest)
- Published
- Mar 12, 2021
- Platform
- linux/amd64
- Imports
- 10 packages
- Last checked
- 4 hours ago –
Tools for package owners.