pclntab

package module
v0.0.0-...-58980bf Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2024 License: MIT Imports: 7 Imported by: 0

README

pclntab

Recover symbols from stripped go executables using information from the embedded pclntab.

Intended to be used for executables built with -ldflags="-s -w" or stripped via simple methods. Anything run through a tool that compresses or renames section headers (like upx) will fail. Use a more extreme tool like GoReSym in those cases.

Work In-progress

  • Support Mach-O
  • Support ELF
  • Support ELF with -buildmode=pie
  • Support PE
  • Support scanning executables compressed with upx
  • Documented supported go versions

Install

go install github.com/vanstee/pclntab/cmd/pclntab

Usage

$ pclntab $(which kubelet) | head
0000000000402420 internal/abi.(*RegArgs).Dump
00000000004026a0 internal/abi.(*RegArgs).IntRegArgAddr
0000000000402720 internal/abi.(*IntArgRegBitmap).Set
00000000004027a0 internal/abi.(*IntArgRegBitmap).Get
0000000000402820 internal/abi.Kind.String
0000000000402880 internal/abi.(*Type).Kind
00000000004028a0 internal/abi.(*Type).HasName
00000000004028c0 internal/abi.(*Type).Pointers
00000000004028e0 internal/abi.(*Type).IfaceIndir
0000000000402900 internal/abi.(*Type).IsDirectIface

Documentation

Index

Constants

View Source
const (
	MachOExecutableFileFormat       = "Mach-O"
	ELFExecutableFileFormat         = "ELF"
	PEExecutableFileFormat          = "PE"
	UnsupportedExecutableFileFormat = "Unsupported"

	ELFMagicNumber      uint32 = 0x7f454c46 // 0x7f E L F
	MachO32MacgicNumber uint32 = 0xfeedface
	MachO64MacgicNumber uint32 = 0xfeedfacf
)

Variables

This section is empty.

Functions

func ParseELFPclntab

func ParseELFPclntab(r io.ReaderAt) (*gosym.Table, error)

func ParseMachOPclntab

func ParseMachOPclntab(r io.ReaderAt) (*gosym.Table, error)

func ParsePclntab

func ParsePclntab(r io.ReaderAt) (*gosym.Table, error)

func ParsePclntabPath

func ParsePclntabPath(path string) (*gosym.Table, error)

Types

type ExecutableFileFormat

type ExecutableFileFormat string

func IdentifyExecutableFileFormat

func IdentifyExecutableFileFormat(r io.ReaderAt) ExecutableFileFormat

Directories

Path Synopsis
cmd
pclntab command

Jump to

Keyboard shortcuts

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