Have DeobfuscatorBase implement IWriterListener
This commit is contained in:
parent
12c381cdad
commit
d9a776aa3f
|
@ -38,9 +38,10 @@ namespace de4dot {
|
||||||
return module;
|
return module;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void save(string newFilename, bool updateMaxStack) {
|
public void save(string newFilename, bool updateMaxStack, IWriterListener writerListener) {
|
||||||
var writerParams = new WriterParameters() {
|
var writerParams = new WriterParameters() {
|
||||||
UpdateMaxStack = updateMaxStack,
|
UpdateMaxStack = updateMaxStack,
|
||||||
|
WriterListener = writerListener,
|
||||||
};
|
};
|
||||||
module.Write(newFilename, writerParams);
|
module.Write(newFilename, writerParams);
|
||||||
}
|
}
|
||||||
|
|
|
@ -256,7 +256,7 @@ namespace de4dot {
|
||||||
|
|
||||||
public void save() {
|
public void save() {
|
||||||
Log.n("Saving {0}", options.NewFilename);
|
Log.n("Saving {0}", options.NewFilename);
|
||||||
assemblyModule.save(options.NewFilename, options.ControlFlowDeobfuscation);
|
assemblyModule.save(options.NewFilename, options.ControlFlowDeobfuscation, deob as IWriterListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
IList<MethodDefinition> getAllMethods() {
|
IList<MethodDefinition> getAllMethods() {
|
||||||
|
|
|
@ -25,7 +25,7 @@ using Mono.MyStuff;
|
||||||
using de4dot.blocks;
|
using de4dot.blocks;
|
||||||
|
|
||||||
namespace de4dot.deobfuscators {
|
namespace de4dot.deobfuscators {
|
||||||
abstract class DeobfuscatorBase : IDeobfuscator {
|
abstract class DeobfuscatorBase : IDeobfuscator, IWriterListener {
|
||||||
public const string DEFAULT_VALID_NAME_REGEX = @"^[a-zA-Z_<{$][a-zA-Z_0-9<>{}$.`-]*$";
|
public const string DEFAULT_VALID_NAME_REGEX = @"^[a-zA-Z_<{$][a-zA-Z_0-9<>{}$.`-]*$";
|
||||||
|
|
||||||
class RemoveInfo<T> {
|
class RemoveInfo<T> {
|
||||||
|
@ -505,7 +505,7 @@ namespace de4dot.deobfuscators {
|
||||||
|
|
||||||
protected bool hasMetadataStream(string name) {
|
protected bool hasMetadataStream(string name) {
|
||||||
foreach (var stream in module.MetadataStreams) {
|
foreach (var stream in module.MetadataStreams) {
|
||||||
if (stream.name == name)
|
if (stream.Name == name)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -548,5 +548,8 @@ namespace de4dot.deobfuscators {
|
||||||
public virtual bool isValidMethodArgName(string name) {
|
public virtual bool isValidMethodArgName(string name) {
|
||||||
return name != null && checkValidName(name);
|
return name != null && checkValidName(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual void OnBeforeAddingResources(MetadataBuilder builder) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user