Unable to analyze UPX compressed Go binary
Closed this issue · 2 comments
Describe the bug
A clear and concise description of what the bug is.
When trying to analyze a Go binary that has been compressed with UPX using gsa --web --verbose
, the tool fails with a section not found error.
time=8.718667ms level=ERROR msg="Fatal error: error when getting pclntab: failed to get section: .data.rel.ro: section does not exist"
To Reproduce
Steps to reproduce the behavior:
-
Install UPX
-
Compress the binary using UPX:
upx -9 -v bootstrap
- Analyze with gsa:
gsa --web --verbose bootstrap<<<<<----Use your own binary
Expected behavior
A clear and concise description of what you expected to happen.
UI as go-size-analyzer produces
Screenshots
If applicable, add screenshots to help explain your problem.
N/A
Desktop (please complete the following information):
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
Smartphone (please complete the following information):
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
Additional context
Add any other context about the problem here.
Verbose data:
time=9.090916ms level=DEBUG msg="memory limit: 1.1 GB"
time=9.7395ms level=INFO msg="Parsing binary..."
time=13.760083ms level=INFO msg="Parsed binary done"
time=13.791958ms level=INFO msg="Finding build info..."
time=13.8075ms level=INFO msg="Found build info"
time=14.146666ms level=INFO msg="Loading sections..."
time=14.155333ms level=INFO msg="Loaded sections"
time=14.381458ms level=INFO msg="Loading packages..."
time=14.473708ms level=ERROR msg="Fatal error: error when getting pclntab: failed to get section: .data.rel.ro: section does not exist"
When a binary is packed with UPX, it's compressed, so gsa can’t access the original code. It only see the packed data, making analysis ineffective until the binary is unpacked.