getsentry / sentry-native

Sentry SDK for C, C++ and native applications.
MIT License
391 stars 165 forks source link

`Promon` encrypted libraries not symbolicated #849

Open Swatinem opened 1 year ago

Swatinem commented 1 year ago

A customer reports that using Promon to obfuscate / encrypt their executables on Android leads to broken symbolication.

After investigation, it looks like when loading the executable in memory, Promon will overwrite the encrypted binary in memory, including its ELF headers that contain its debug-id.

It is unclear if the unencrypted binary has a different or no debug-id at all, however it does not match the debug-id of the encrypted binary, which I assume is the same debug-id that is used when uploading to Sentry.

Ideally, Promon would not mess with the debug-id at all, and use the same for the original, and for the encrypted binary.

In the meanwhile, the customer suggested to load/read the encrypted binary from disk, as that does have a matching debug-id.

markushi commented 1 year ago

After talking to some Promon folks at droidcon berlin they mentioned that there's likely a Promon configuration option to keep the elf-headers untouched. Unfortunately the docs are not public, so I can't link anything relevant here.