-
Notifications
You must be signed in to change notification settings - Fork 24
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
Rename Binary meta data variant to Elf #222
Conversation
2f6a5b0
to
d8d806c
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #222 +/- ##
=========================================
+ Coverage 0 84.38% +84.38%
=========================================
Files 0 26 +26
Lines 0 3754 +3754
=========================================
+ Hits 0 3168 +3168
- Misses 0 586 +586
☔ View full report in Codecov by Sentry. |
This change adds a test for the APK address normalization logic. Signed-off-by: Daniel Müller <deso@posteo.net>
ac10db4
to
85f45b5
Compare
Adding a bunch more stuff here that we will need for APK address normalization but which hinges on the original change this PR was created for. |
Now that we use the zip module as part of normalization and symbolization, let's remove the #[allow(unused)] annotation. Signed-off-by: Daniel Müller <deso@posteo.net>
This change renames the Binary meta data variant to Elf. For the time being we decided to err on the side of having more specific variants, which may be easier to extend in a sensible way in the future (e.g., if future supported binary formats don't have a build ID it's more natural to have a new variant as opposed to fudging everything as a "binary" and then having optional fields). Signed-off-by: Daniel Müller <deso@posteo.net>
This change renames the read_build_id() function to read_build_id_from_elf, as we will need to introduce a few more variants accepting different arguments in the future. Signed-off-by: Daniel Müller <deso@posteo.net>
This change reintroduced the read_build_id() function that we renamed earlier and which now accepts an ElfParser instance. Having this variant available will be necessary in the future, but it's a reasonable separation of concerns even now. Signed-off-by: Daniel Müller <deso@posteo.net>
This change introduces an internal trait, BuildIdReader, that replaces the current usage of the get_build_id BuildIdFn member in NormalizationHandler objects. Basically, with upcoming changes we need to keep around more than one variant of a build-id-reader function and the trait clubs those together for easier handling. Signed-off-by: Daniel Müller <deso@posteo.net>
This change factors out a small helper function, make_elf_meta(), that takes care of creating a UserAddrMeta for an ELF file. Signed-off-by: Daniel Müller <deso@posteo.net>
With upcoming changes we will add support for normalizing addresses belonging to ELF binaries that reside in APKs to the crate. Such addresses require additional meta data as output of the address normalization process, which includes the APK path. This change introduces a new meta data variant, ApkElf, that we will use for representing such addresses. Signed-off-by: Daniel Müller <deso@posteo.net>
This patch prepares the code base (the normalizer and symbolizer logic specifically) for the addition of APK support. Most importantly, we introduce and hook up stubs that will later be used for dealing with APKs, in addition to the existing logic that works solely on ELF files. Signed-off-by: Daniel Müller <deso@posteo.net>
This change adds support for normalizing addresses in APKs, which has relevance particularly for usage on Android. In a nutshell, we: - detect whether an address lies inside an APK by checking the respective maps entry for the .apk/.zip extension - we then calculate the file offset for the address and look up the corresponding member inside the APK - we then perform ELF normalization on said address using the discovered APK entry - lastly we convey the result to the user via the ApkElf meta data, which was introduced earlier Signed-off-by: Daniel Müller <deso@posteo.net>
dd4136a
to
0c62d13
Compare
Added the remaining APK normalization stuff now as well, as it all builds on top of each other. |
0c62d13
to
b8c45f4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This change renames the Binary meta data variant to Elf. For the time being we decided to err on the side of having more specific variants, which may be easier to extend in a sensible way in the future (e.g., if future supported binary formats don't have a build ID it's more natural to have a new variant as opposed to fudging everything as a "binary" and then having optional fields).