Documentation
¶
Index ¶
- func Sha256Sum(b []byte) (hexsum string)
- type ApisetHeader6
- type ApisetHeader63
- type ApisetNameEntry
- type ApisetNameEntry2
- type ApisetValueEntry
- type CoffHeader
- type DataDirectory
- type DosHeader
- type Export
- type ExportAddressTable
- type ExportDirectory
- type ImportDirectory
- type ImportInfo
- type OptionalHeader32
- type OptionalHeader32P
- type PeFile
- func (pe *PeFile) ApiSetLookup(name string) string
- func (pe *PeFile) EntryPoint() uint32
- func (pe *PeFile) ImageBase() uint64
- func (pe *PeFile) ImportedDlls() []string
- func (pe *PeFile) SetImageBase(imageBase uint64) error
- func (pe *PeFile) SetImportAddress(importInfo *ImportInfo, realAddr uint64) error
- func (pe *PeFile) String() string
- type PeType
- type RelocationBlock
- type Section
- type SectionHeader
- type ValuesArray2
- type ValuesEntry2
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ApisetHeader6 ¶
type ApisetHeader63 ¶
type ApisetNameEntry ¶
type ApisetNameEntry2 ¶
type ApisetValueEntry ¶
type CoffHeader ¶
type DataDirectory ¶
type DosHeader ¶
type DosHeader struct {
Magic uint16
BytesOnLastPage uint16
PagesInFile uint16
Relocations uint16
SizeOfHeader uint16
MinExtra uint16
MaxExtra uint16
InitialSS uint16
InitialSP uint16
Checksum uint16
InitialIP uint16
InitialCS uint16
FileAddressRelocationTable uint16
Overlay uint16
Reserved [4]uint16
OemId uint16
OemInfo uint16
Reserved2 [10]uint16
AddressExeHeader uint32
}
type ExportAddressTable ¶
type ExportDirectory ¶
type ImportDirectory ¶
type ImportInfo ¶
type OptionalHeader32 ¶
type OptionalHeader32 struct {
Magic uint16
MajorLinkerVersion uint8
MinorLinkerVersion uint8
SizeOfCode uint32
SizeOfInitializedData uint32
SizeOfUninitializedData uint32
AddressOfEntryPoint uint32
BaseOfCode uint32
BaseOfData uint32
ImageBase uint32
SectionAlignment uint32
FileAlignment uint32
MajorOSVersion uint16
MinorOSVersion uint16
MajorImageVersion uint16
MinorImageVersion uint16
MajorSubsystemVersion uint16
MinorSubsystemVersion uint16
Win32Version uint32
SizeOfImage uint32
SizeOfHeaders uint32
Checksum uint32
Sybsystem uint16
DllCharacteristics uint16
SizeOfStackReserve uint32
SizeOfStackCommit uint32
SizeOfHeapReserve uint32
SizeOfHeapCommit uint32
LoaderFlags uint32
NumberOfRvaAndSizes uint32
DataDirectories [16]DataDirectory
}
type OptionalHeader32P ¶
type OptionalHeader32P struct {
Magic uint16
MajorLinkerVersion uint8
MinorLinkerVersion uint8
SizeOfCode uint32
SizeOfInitializedData uint32
SizeOfUninitializedData uint32
AddressOfEntryPoint uint32
BaseOfCode uint32
ImageBase uint64
SectionAlignment uint32
FileAlignment uint32
MajorOSVersion uint16
MinorOSVersion uint16
MajorImageVersion uint16
MinorImageVersion uint16
MajorSubsystemVersion uint16
MinorSubsystemVersion uint16
Win32Version uint32
SizeOfImage uint32
SizeOfHeaders uint32
Checksum uint32
Sybsystem uint16
DllCharacteristics uint16
SizeOfStackReserve uint64
SizeOfStackCommit uint64
SizeOfHeapReserve uint64
SizeOfHeapCommit uint64
LoaderFlags uint32
NumberOfRvaAndSizes uint32
DataDirectories [16]DataDirectory
}
type PeFile ¶
type PeFile struct {
Path string
Name string //import name, apiset or on disk
RealName string //on disk short name
Sha256 string
DosHeader *DosHeader
CoffHeader *CoffHeader
OptionalHeader interface{}
PeType PeType
Sections []*Section
HeadersAsSection *Section
Imports []*ImportInfo
Exports []*Export
ExportNameMap map[string]*Export
ExportOrdinalMap map[int]*Export
Apisets map[string][]string
Size int64
RawHeaders []byte
ImageSize int64
// contains filtered or unexported fields
}
func LoadPeBytes ¶
LoadPeBytes will take a PE file in the form of an in memory byte array and parse it
func LoadPeFile ¶
LoadPeFile will parse a file from disk, given a path. The output will be a PeFile object or an error
func (*PeFile) ApiSetLookup ¶
func (*PeFile) EntryPoint ¶
EntryPoint returns the entry point of the PE file
func (*PeFile) ImportedDlls ¶
func (*PeFile) SetImageBase ¶
SetImageBase updates the image base of a PeFile and also updates all rolcations of the file
func (*PeFile) SetImportAddress ¶
func (pe *PeFile) SetImportAddress(importInfo *ImportInfo, realAddr uint64) error
type RelocationBlock ¶
type SectionHeader ¶
type ValuesArray2 ¶
type ValuesArray2 struct {
Count uint32
}
Click to show internal directories.
Click to hide internal directories.