plan9obj
3 分钟阅读
Package plan9obj implements access to Plan 9 a.out object files.
plan9obj
包实现对 Plan 9 a.out 对象文件的访问。
Security
This package is not designed to be hardened against adversarial inputs, and is outside the scope of https://go.dev/security/policy. In particular, only basic validation is done when parsing object files. As such, care should be taken when parsing untrusted inputs, as parsing malformed files may consume significant resources, or cause panics.
该包没有设计用于抵御对抗性输入,并且超出了 https://go.dev/security/policy 的范围。特别是,在解析对象文件时只进行了基本验证。因此,在解析不受信任的输入时应该小心,因为解析格式错误的文件可能会消耗大量资源或导致崩溃。
常量
|
|
变量
|
|
ErrNoSymbols is returned by File.Symbols if there is no such section in the File.
如果文件中没有该节(section),则 File.Symbols 返回 ErrNoSymbols。
函数
This section is empty.
类型
type File
|
|
A File represents an open Plan 9 a.out file.
File
表示一个打开的 Plan 9 a.out 文件。
func NewFile
|
|
NewFile creates a new File for accessing a Plan 9 binary in an underlying reader. The Plan 9 binary is expected to start at position 0 in the ReaderAt.
NewFile
创建一个新的 File,用于访问底层 reader 中的 Plan 9 二进制文件。Plan 9 二进制文件预期从 ReaderAt 的位置 0 开始。
func Open
|
|
Open opens the named file using os.Open and prepares it for use as a Plan 9 a.out binary.
Open
使用 os.Open 打开指定的文件,并准备将其用作 Plan 9 a.out 二进制文件。
(*File) Close
|
|
Close closes the File. If the File was created using NewFile directly instead of Open, Close has no effect.
Close
关闭文件。如果 File 是通过 NewFile 直接创建而不是通过 Open 创建的,则 Close 不起作用。
(*File) Section
|
|
Section returns a section with the given name, or nil if no such section exists.
Section
返回具有给定名称的节(section),如果不存在则返回 nil。
(*File) Symbols
|
|
Symbols returns the symbol table for f.
Symbols
返回 f 的符号表。
type FileHeader
|
|
A FileHeader represents a Plan 9 a.out file header.
FileHeader
表示 Plan 9 a.out 文件头。
type Section
|
|
A Section represents a single section in a Plan 9 a.out file.
Section
表示 Plan 9 a.out 文件中的单个节(section)。
(*Section) Data
|
|
Data reads and returns the contents of the Plan 9 a.out section.
Data
读取并返回 Plan 9 a.out 节的内容。
(*Section) Open
|
|
Open returns a new ReadSeeker reading the Plan 9 a.out section.
Open
返回一个新的 ReadSeeker,用于读取 Plan 9 a.out 节。
type SectionHeader
|
|
A SectionHeader represents a single Plan 9 a.out section header. This structure doesn’t exist on-disk, but eases navigation through the object file.
SectionHeader
表示 Plan 9 a.out 单个节的头。该结构在磁盘上不存在,但可以方便地导航对象文件。
type Sym
|
|
A Symbol represents an entry in a Plan 9 a.out symbol table section.
Sym
表示 Plan 9 a.out 符号表节中的条目。