Open leighhopcroft opened 1 year ago
This is a TODO; see https://github.com/burrowers/garble/blob/9044b1d31cac35ebdd82e6781605807d38be781f/testdata/script/ldflags.txtar#L21.
It's not trivial because such literals are currently inserted at link time, well after garble's obfuscation at the source level has happened. To support this, we would have to stop passing the -X
flags to the linker, inserting the string values ourselves - and obfuscating the literals in the process. Certainly doable, just not a few lines of code either. cc @lu4p
What version of Garble and Go are you using?
What environment are you running Garble on?
docker container linux/amd64 golang:1.20
go env
OutputWhat did you do?
I expected the resulting binary to contain an obfuscated variable due to the
-literals
flag, but inspecting the binary withstrings
includes the value "THIS SHOULD BE OBFUSCATED".To reproduce:
Then run:
The Docker build fails, showing that the plain string was found in the binary rather than an obfuscated version.
What did you expect to see?
The Docker build should succeed, showing that the plain string was not found in the binary.
What did you see instead?
The Docker build failed, showing that the plain string was found in the binary.