Add verify methods
This commit is contained in:
parent
d9b3a81ba9
commit
1eaa9f8c51
|
@ -48,6 +48,25 @@ namespace de4dot.code.deobfuscators {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static bool verify(byte[] data) {
|
||||||
|
return verify(new BinaryReader(new MemoryStream(data)));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool verify(Stream data) {
|
||||||
|
return verify(new BinaryReader(data));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool verify(BinaryReader reader) {
|
||||||
|
try {
|
||||||
|
byte[] code, extraSections;
|
||||||
|
parseMethodBody(reader, out code, out extraSections);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch (InvalidMethodBody) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static MethodBodyHeader parseMethodBody2(BinaryReader reader, out byte[] code, out byte[] extraSections) {
|
static MethodBodyHeader parseMethodBody2(BinaryReader reader, out byte[] code, out byte[] extraSections) {
|
||||||
var mbHeader = new MethodBodyHeader();
|
var mbHeader = new MethodBodyHeader();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user