Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions de4dot.cui/CommandLineParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,13 @@ void AddAllOptions() {
filesOptions.AssemblyClientFactory = new NewProcessAssemblyClientFactory();
}));
miscOptions.Add(new NoArgOption(null, "keep-types", "Keep obfuscator types, fields, methods", () => {
if (newFileOptions == null)
ExitError("Please specify --keep-types after the input file name.");
newFileOptions.KeepObfuscatorTypes = true;
}));
miscOptions.Add(new NoArgOption(null, "preserve-tokens", "Preserve important tokens, #US, #Blob, extra sig data", () => {
if (newFileOptions == null)
ExitError("Please specify --preserve-tokens after the input file name.");
newFileOptions.MetadataFlags |= MetadataFlags.PreserveRids |
MetadataFlags.PreserveUSOffsets |
MetadataFlags.PreserveBlobOffsets |
Expand Down
18 changes: 1 addition & 17 deletions de4dot.cui/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,7 @@ public static int Main(string[] args) {
exitCode = 1;
}
catch (Exception ex) {
if (PrintFullStackTrace()) {
PrintStackTrace(ex);
Logger.Instance.LogErrorDontIgnore("\nTry the latest version!");
}
else {
Logger.Instance.LogErrorDontIgnore("\n\n");
Logger.Instance.LogErrorDontIgnore("Hmmmm... something didn't work. Try the latest version.");
}
PrintStackTrace(ex);
exitCode = 1;
}

Expand All @@ -162,15 +155,6 @@ public static int Main(string[] args) {
return exitCode;
}

static bool PrintFullStackTrace() {
if (!Logger.Instance.IgnoresEvent(LoggerEvent.Verbose))
return true;
if (HasEnv("STACKTRACE"))
return true;

return false;
}

static bool HasEnv(string name) {
foreach (var tmp in Environment.GetEnvironmentVariables().Keys) {
var env = tmp as string;
Expand Down
Loading