unixpickle / gobfuscate

Obfuscate Go binaries and packages
BSD 2-Clause "Simplified" License
1.45k stars 157 forks source link

gomvpkg does not support move destinations whose base names are not valid go identifiers #22

Open mesameen opened 5 years ago

mesameen commented 5 years ago

GOPATH: E:\go\src\ My Application: E:\go\src\HelloWorld Working Directory: E:\go\src\

E:\go\src\:> go get -u github.com/unixpickle/gobfuscate E:\go\src\:> gobfuscate obfus /ob

2019/08/02 22:07:09 Copying GOPATH... 2019/08/02 22:07:36 Obfuscating package names... Failed to obfuscate package names: package move: invalid move destination: aagdegjpdjopofdlagpg\opfcoehbinlaindbngkp; gomvpkg does not support move destinations whose base names are not valid go identifiers

Couldn't get what's wrong.

kumpfdp commented 5 years ago

I had this same issue on Windows and seems to be due to the os path separators. It appears you're also on Windows but, correct me if I'm wrong in that assumption. I've had no issues running this tool on a mac, fwiw...

I stepped through the code as it was running and after replacing "\" with "/" in the to/from file paths, it works. Note, there is another place where this is required to get it fully working - during the rename symbols section.

In path\path.go (which is being used in this case), the path.Base func doesn't check for os.Separator. It only checks for "/". Thinking this is because of Go's import paths use unix-style path separators? filepath\path.go checks for the os.Separator.

Hope that helps.

discoli-zz commented 3 years ago

hi - did anyone ever resolve this, i'm not fully sure what to do with the information above

Numenorean commented 3 years ago

any solution for this?