XenocodeRCE / neo-ConfuserEx

Updated ConfuserEX, an open-source, free obfuscator for .NET applications
http://yck1509.github.io/ConfuserEx/
Other
746 stars 89 forks source link

Exception: System.UriFormatException: Invalid URI: The format of the URI could not be determined. #22

Closed TetteDev closed 5 years ago

TetteDev commented 5 years ago

Describe the bug Encounter this error when trying to protect an exectuable.

To Reproduce Calling the cli program like this

var psi = new ProcessStartInfo(Path.Combine(Application.StartupPath, "Confuser.CLI.exe")) { Arguments = args, UseShellExecute = false, CreateNoWindow = false }; Process.Start(psi);

the arguments passed are -o <my outputpath> <filename of file I want to protect The exact arguments can be seen at the top of the screenshot

Screenshots image

Encountered the same issue with the non-fork version of confuser too

hollow87 commented 5 years ago

Can confirm.

https://github.com/XenocodeRCE/neo-ConfuserEx/blob/3cd7d234150455a27a966ff528d379fa6d0f2281/Confuser.Core/ConfuserEngine.cs#L92

Causes context.BaseDirectory to become \ which causes that exception as \ is not a valid URI

TetteDev commented 5 years ago

Replacing line 92 with

context.BaseDirectory = Path.Combine(Environment.CurrentDirectory, parameters.Project.BaseDirectory.TrimEnd(Path.DirectorySeparatorChar) + "." + Path.DirectorySeparatorChar); as user @hollow87 recommended fixed this issue!