-
Notifications
You must be signed in to change notification settings - Fork 158
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
expects import "golang.org/x/sys/unix" #10
Comments
I have removed the relevant code, but still got issues
|
Try the latest |
New errors:
Source code:
|
Interesting. I'm guessing some other stage of the obfuscation pipeline corrupted the |
I've deleted all previous comments and merged the bug report into one: Problem 1Unable to process multiple
became
Problem 2Unable to process
became
Problem 3Did not process comments after
This will throw an error if package name is unexpected:
|
I've patched removeDoNotEdit and append only comments that contains the keyword |
By the way, removeDoNotEdit had a bug for a brief while (a few hours) before I fixed it. Is the comment problem still happening on the latest master branch? The latest master should also respect build tags (added yesterday) |
Yes, it is the master branch. The last commit is 18 hours ago. |
Problem 3 is an interesting one, as it seems to reveal deeper problems with some Go build tools. For example, my IDE complains about the comment example you provided, and it simply relies on existing Go source code analysis tools. I think we should create a separate issue for problem 3. To check the other two problems, I created a directory in my GOPATH with the package name package main
import (
"errors"
"fmt"
)
// ErrUnsupported is returned if a function is not
// available on the current platform.
var ErrUnsupported = errors.New("unsupported")
// Foo is a cool structure
// with a doc comment.
type Foo struct {
}
/* Ignored checks something
that it shouldn't? */
func (f *Foo) Ignored() {
}
func main() {
fmt.Println("hi")
} Gobfuscate correctly obfuscates it with this output: package main
import (
"errors"
"fmt"
)
// Mkcdnleioandomamdfam is returned if a function is not
// available on the current platform.
var Mkcdnleioandomamdfam = errors.New((func() string {
mask := []byte("\x21\x0f\xc7\xbb\x81\x86\x39\xac\x48\xa4\xc6")
maskedStr := []byte("\x54\x61\xb4\xce\xf1\xf6\x56\xde\x3c\xc1\xa2")
res := make([]byte, 11)
for i, m := range mask {
res[i] = m ^ maskedStr[i]
}
return string(res)
}()))
// Ogfkflibbhjhjmmgjajd is a cool structure
// with a doc comment.
type Ogfkflibbhjhjmmgjajd struct {
}
/* Ignored checks something
that it shouldn't? */
func (f *Ogfkflibbhjhjmmgjajd) Cdlckjmaedannakkmjko() {
}
func main() {
fmt.Println((func() string {
mask := []byte("\xaf\xa2")
maskedStr := []byte("\xc7\xcb")
res := make([]byte, 2)
for i, m := range mask {
res[i] = m ^ maskedStr[i]
}
return string(res)
}()))
} On commit a109102, I see problems 1 and 2 as you described. But not on master. |
I got the following error with gobfuscate:
How can I debug this?
The text was updated successfully, but these errors were encountered: