burrowers / garble

Obfuscate Go builds
BSD 3-Clause "New" or "Revised" License
3.93k stars 248 forks source link

-literals not working with -ldflags #861

Closed evenluo closed 3 months ago

evenluo commented 3 months ago

What version of Garble and Go are you using?

$ garble version
mvdan.cc/garble v0.12.1

$ go version
go version go1.22.5 darwin/arm64

What did you do?

I want to do a literal obfuscation with -ldflags as following: ❯ garble -literals build -ldflags=-X=main.ID=qazwsxedcrfvtgbyhn -o main ❯ strings main | grep gbyhn qazwsxedcrfvtgbyhn

What did you expect to see?

The value qazwsxedcrfvtgbyhn should be obfuscated and not in grep result

What did you see instead?

-literals seems not working with -ldflags

lu4p commented 3 months ago

Duplicate of #717