Skip to content

Tool for extracting and analyzing Golang DWARF type information to generate statistics on Golang types.

License

Notifications You must be signed in to change notification settings

smadi0x86/DWARF-Go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DWARF-Golang

A small c tool to analyze custom DWARF attributes in golang binaries.

Introduction

Go emits custom DWARF attributes (like DW_AT_go_kind, DW_AT_go_elem, etc...) to describe internal type information such as whether something is a map, func, chan, etc... These are not standard DWARF fields and are often marked as "Unknown AT value" by tools like readelf.

This project helps reverse engineers make sense of those attributes by summarizing how often each golang kind appears and in what DWARF tags.

dwarf.go gives information on how go types are represented in DWARF, knowing these attributes enabled me to do this tool to get stats of go types from DWARF debug information.

Compile

gcc dwarf-go-stats.cc -o dwarf-go -Wall

Usage

readelf --debug-dump=info your-go-binary > output.txt
./dwarf-go output.txt

Alternatively, you can use the hello go binary found in examples/ folder or just compile and run it against examples/output.txt directly.

Reference

LICENSE

This project is licensed under GNU v3 (General Public License), see LICENSE file for more information.

About

Tool for extracting and analyzing Golang DWARF type information to generate statistics on Golang types.

Topics

Resources

License

Stars

Watchers

Forks