garble icon indicating copy to clipboard operation
garble copied to clipboard

Support for -toolexec in garble

Open we11adam opened this issue 9 months ago • 5 comments

Hi,

It appears that garble and OpenTelemetry (or otel) are experiencing compatibility issues due to their interaction with the Go toolchain. I've had a brief discussion with @123liuziming, and it seems the resolution may primarily lie within garble.

We would appreciate any thoughts on how to improve this compatibility.

we11adam avatar Mar 31 '25 02:03 we11adam

garble now does not support to use -toolexec manually, can we support this to make two Agent compatible?

123liuziming avatar Mar 31 '25 02:03 123liuziming

Out of curiosity, why would you want to add telemetry instrumentation to an obfuscated binary? Telemetry instrumentation by design will expose more information about what a binary is doing, so it goes directly against the goals of obfuscation in general.

mvdan avatar Mar 31 '25 08:03 mvdan

Hi Daniel,

Adding telemetry instrumentation is about automating the bootstrapping of application metrics at a high level, while obfuscating the binary helps prevent reverse engineering of the binary file itself (kind of — I know! :-P).

Best,

we11adam avatar Mar 31 '25 09:03 we11adam

@mvdan

Out of curiosity, why would you want to add telemetry instrumentation to an obfuscated binary? Telemetry instrumentation by design will expose more information about what a binary is doing, so it goes directly against the goals of obfuscation in general.

Yes, I would agree with you, but if the stack traces are obfuscated to be sent to Sentry or OpenTelemetry, the line of code and the obfuscated “file.go” will be displayed. With Android and ProGuard, you can also obfuscate your Android app, and when you get the stack traces, you can use a “mapping.txt” to see exactly where the crash happened. This would be worth implementing here. so a “mapping.txt”.

example:

XyZqRt github.com/burrowers/garble/reverse.go

zandercodes avatar Jun 09 '25 08:06 zandercodes

@we11adam @123liuziming is this something you want to implement yourself?

lu4p avatar Jun 11 '25 21:06 lu4p

This is outside the scope of the project for now, given our existing goals and available time. If someone wants to look into this, you're welcome to have a go. For the time being, I'll close the issue as not planned.

mvdan avatar Jul 26 '25 15:07 mvdan