yck1509 / ConfuserEx

An open-source, free protector for .NET applications
http://yck1509.github.io/ConfuserEx/
Other
3.56k stars 1.61k forks source link

User Config file corrupted #178

Closed questore closed 9 years ago

questore commented 9 years ago

I have used confuserEX for a time now and I discovered the following problem. (No matter what kind of confuser option I user on my project files but here is the Project file text) image

  1. I put some user settings to my VB.NET (3.5) project and then ask new values from the user for them
  2. Call "My.Settings.Save" Result: The user file will contain unacceptable characters and therefore setting cannot be read (instead the default values will be loaded to the setting next time the program starts). This is a serious problem. here is what i got after My.Setting.Save: image
yck1509 commented 9 years ago

Hi, I just tested and it works here. Although the result user settings file contains some random characters like your second screenshot, the program could still read and save the settings without any problem. If you would like to keep the settings readable by user, you could exclude the settings class(e.g. Test.My.MySettings) from renaming. If you want to keep the settings readable across protections, you could set a random seed.

questore commented 9 years ago

Sorry my mistake, its not the user config file that is not loaded, but the config file in the application directory. If Rename option is added in ConfuserEx then config file wont be read.

for reproducing the problem:

  1. make a vs app named "Program"
  2. add a setting named: "oneSetting" its parameters: "string" and "User" and give the value "One"
  3. Make a Line in the project: Console.WriteLine("The value is: " + My.Settings.oneSetting)
  4. Save and Build the project,
  5. Use ConfuserEx on "Program.exe"
  6. Go to project Release dir and open the "Program.exe.config" file.
  7. change the value "One" to value "Two" and save the file
  8. Run application and see that the console show the value "One" instead of "Two"

I have solved the problem by removing the renaming option from the Confuser Project. Ty