在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:unixpickle/gobfuscate开源软件地址:https://github.com/unixpickle/gobfuscate开源编程语言:Go 100.0%开源软件介绍:gobfuscateWhen you compile a Go binary, it contains a lot of information about your source code: field names, strings, package paths, etc. If you want to ship a binary without leaking this kind of information, what are you to do? With gobfuscate, you can compile a Go binary from obfuscated source code. This makes a lot of information difficult or impossible to decipher from the binary. How to use
Flags
What it doesCurrently, gobfuscate manipulates package names, global variable and function names, type names, method names, and strings. Package name obfuscationWhen gobfuscate builds your program, it constructs a copy of a subset of your GOPATH. It then refactors this GOPATH by hashing package names and paths. As a result, a package like "github.com/unixpickle/deleteme" becomes something like "jiikegpkifenppiphdhi/igijfdokiaecdkihheha/jhiofoppieegdaif". This helps get rid of things like Github usernames from the executable. Limitation: currently, packages which use CGO cannot be renamed. I suspect this is due to a bug in Go's refactoring API. Global namesGobfuscate hashes the names of global vars, consts, and funcs. It also hashes the names of any newly-defined types. Due to restrictions in the refactoring API, this does not work for packages which contain assembly files or use CGO. It also does not work for names which appear multiple times because of build constraints. Struct methodsGobfuscate hashes the names of most struct methods. However, it does not rename methods whose names match methods of any imported interfaces. This is mostly due to internal constraints from the refactoring engine. Theoretically, most interfaces could be obfuscated as well (except for those in the standard library). Due to restrictions in the refactoring API, this does not work for packages which contain assembly files or use CGO. It also does not work for names which appear multiple times because of build constraints. StringsStrings are obfuscated by replacing them with functions. A string will be turned into an expression like the following: (func() string {
mask := []byte{33, 15, 199}
maskedStr := []byte{73, 106, 190}
res := make([]byte, 3)
for i, m := range mask {
res[i] = m ^ maskedStr[i]
}
return string(res)
}()) Since
However, it does not work for mixed const/int blocks:
LicenseThis is under a BSD 2-clause license. See LICENSE. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论