Analyse .rodata/go:embed content
A tool for analyzing the size of compiled Go binaries, offering cross-platform support, detailed breakdowns, and multiple output formats.
Brought to you by:
zxilly
Originally posted by: Zxilly
This is certainly possible, and in fact existing methods based on decompilation already recognise some of them.
But I discarded the results that could not be recognised as strings when I processed the results obtained from decompilation. Because false positives can be very disturbing.
There is an additional difficulty, gsa currently supports three platforms, pe/macho/elf, and writing a parser for each platform or even each go version might be too much work.
I would expect a parser based on dwarf to handle this, after all, at runtime the embedded content is just a string of bytes. golang uses dwarf on all platforms including pe, so the workload is relatively acceptable.
Originally posted by: Zxilly
The dwarf doesn't contain information about embed, maybe we still need some reverse engineering work.
Therefore, it may be a long wait to implement this feature.
Originally posted by: Zxilly
Please try v1.3.0. It has an initial support for embed parse.

You must compile with the debug symbol to enable this feature.
Originally posted by: Zxilly
Keeping this issue open for now, as the new implementation is based on inversion and some assumptions, and it's not certain that the code will handle all real-world situations correctly. Expect feedback to fix it further.
Originally posted by: gudvinr
I see that my test binary now reduced unknown .rodata size from ~9MB to ~3MB. Good work, thanks.