Merge pull request #103 from snemes/master

Fixed a problem when one of the parent directories contain a dot.
This commit is contained in:
0xd4d 2015-04-26 14:23:21 +02:00
commit 2eb27bfc54

View File

@ -151,17 +151,8 @@ namespace de4dot.code {
} }
string GetDefaultNewFilename() { string GetDefaultNewFilename() {
int dotIndex = options.Filename.LastIndexOf('.'); string newFilename = Path.GetFileNameWithoutExtension(options.Filename) + "-cleaned" + Path.GetExtension(options.Filename);
string noExt, ext; return Path.Combine(Path.GetDirectoryName(options.Filename), newFilename);
if (dotIndex != -1) {
noExt = options.Filename.Substring(0, dotIndex);
ext = options.Filename.Substring(dotIndex);
}
else {
noExt = options.Filename;
ext = "";
}
return noExt + "-cleaned" + ext;
} }
public void Load(IList<IDeobfuscator> deobfuscators) { public void Load(IList<IDeobfuscator> deobfuscators) {