-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add brute force search fallback for elf #89
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## develop #89 +/- ##
===========================================
- Coverage 78.87% 76.07% -2.80%
===========================================
Files 15 17 +2
Lines 3474 3983 +509
===========================================
+ Hits 2740 3030 +290
- Misses 518 712 +194
- Partials 216 241 +25 ☔ View full report in Codecov by Sentry. |
After #69 gets merged, tryFromSchedinit can be rewritten to based on symbol or dwarf. |
@TcM1911 This patch adds some logic based on the symbol table. But most of the binary in the I write a script to build different binaries for research at |
We need a solution that works for binaries without symbols. To support stripped binaries, we essentially need to find and process the PCLNTAB and the moduledata structures at the same time. Finding the PCLNTAB first is easiest because it starts with a set of magic bytes. So here is how I suggest going about this:
|
Currently it can work without symtab. But with symtab it works much more faster. |
One major problem is that without symbol tables and debugging information, the extration of golang version can only rely on regular matches. But according to my research on compilers, buildinfo is usually at the very beginning and thus false positives are unlikely. We could merge this now and add a brute force pattern matching pclntab scheme for case when golang version info is not found. |
I would like to know if any progress has been made and I will continue to complete the brute force search fallback on this PR. |
brute force search fallback for no goversion case has been added. Hope someone can review this. |
I think there must be a bug in the code path of the symbol process, but it's hard to find it because the binary provided didn't include the unstrip version. |
@TcM1911 any updates? |
@Zxilly, sorry I've been very busy with other things. I actually got a chance to work on a solution to this myself today. I may have a chance to finish it tomorrow. |
Wait for #90 merged |
Close: #79
Close: #76
I did some test on the binaries. Seems the fallback only need for elf files.
On macho files,
__gopclntab
always exists.