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
Log location is not reversible #762
Labels
bug
Something isn't working
Comments
One more weird thing is that when I modified the program as below and repeated the same process, I received the expected output. main.go package main
import (
"context"
"fmt"
"log"
)
func doSomething(ctx context.Context) {
lg := &Logger{}
lg.Fields(ctx).Info(ctx, "first") // <- Only this line is modified
lg.Info(ctx, "second")
}
type Logger struct{}
func (l *Logger) Info(ctx context.Context, args ...interface{}) {
s := fmt.Sprintln(args...)
log.Output(2, s)
}
func (l *Logger) Fields(ctx context.Context, args ...interface{}) *Logger {
return l
}
func main() {
log.SetFlags(log.LstdFlags | log.Lshortfile)
ctx := context.Background()
doSomething(ctx)
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What version of Garble and Go are you using?
What environment are you running Garble on?
go env
OutputWhat did you do?
I have a simple program that mainly deals with logging.
main.go
When I ran without obfuscation, the output was:
Next, I ran with obfuscation, the output was as below.
There was a weird log location:
fNaaZg_6.go:2
, which ends with.go:2
. AFAIK, every obfuscated log locations should end with.go:1
.Next, I tried to reverse the output by copying/pasting the whole output above to a
log.txt
file and rangarble reverse
:As you can see,
Aev09U6PaKmX.go:1
is reversible butfNaaZg_6.go:2
is irreversible!What did you expect to see?
The output of
$ garble -literals -seed=HIWdLC75Auohff+IPbtLUA== reverse main.go log.txt
should be:What did you see instead?
The output of
$ garble -literals -seed=HIWdLC75Auohff+IPbtLUA== reverse main.go log.txt
was:The text was updated successfully, but these errors were encountered: