const COFFSymbolSize … type COFFSymbol … // readCOFFSymbols reads in the symbol table for a PE file, returning // a slice of COFFSymbol objects. The PE format includes both primary // symbols (whose fields are described by COFFSymbol above) and // auxiliary symbols; all symbols are 18 bytes in size. The auxiliary // symbols for a given primary symbol are placed following it in the // array, e.g. // // ... // k+0: regular sym k // k+1: 1st aux symbol for k // k+2: 2nd aux symbol for k // k+3: regular sym k+3 // k+4: 1st aux symbol for k+3 // k+5: regular sym k+5 // k+6: regular sym k+6 // // The PE format allows for several possible aux symbol formats. For // more info see: // // https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#auxiliary-symbol-records // // At the moment this package only provides APIs for looking at // aux symbols of format 5 (associated with section definition symbols). func readCOFFSymbols(fh *FileHeader, r io.ReadSeeker) ([]COFFSymbol, error) { … } // isSymNameOffset checks symbol name if it is encoded as offset into string table. func isSymNameOffset(name [8]byte) (bool, uint32) { … } // FullName finds real name of symbol sym. Normally name is stored // in sym.Name, but if it is longer then 8 characters, it is stored // in COFF string table st instead. func (sym *COFFSymbol) FullName(st StringTable) (string, error) { … } func removeAuxSymbols(allsyms []COFFSymbol, st StringTable) ([]*Symbol, error) { … } type Symbol … type COFFSymbolAuxFormat5 … const IMAGE_COMDAT_SELECT_NODUPLICATES … const IMAGE_COMDAT_SELECT_ANY … const IMAGE_COMDAT_SELECT_SAME_SIZE … const IMAGE_COMDAT_SELECT_EXACT_MATCH … const IMAGE_COMDAT_SELECT_ASSOCIATIVE … const IMAGE_COMDAT_SELECT_LARGEST … // COFFSymbolReadSectionDefAux returns a blob of auxiliary information // (including COMDAT info) for a section definition symbol. Here 'idx' // is the index of a section symbol in the main [COFFSymbol] array for // the File. Return value is a pointer to the appropriate aux symbol // struct. For more info, see: // // auxiliary symbols: https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#auxiliary-symbol-records // COMDAT sections: https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#comdat-sections-object-only // auxiliary info for section definitions: https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#auxiliary-format-5-section-definitions func (f *File) COFFSymbolReadSectionDefAux(idx int) (*COFFSymbolAuxFormat5, error) { … }