Add better check for invalid entries

This commit is contained in:
de4dot 2011-12-02 18:48:01 +01:00
parent 0db4222c10
commit 973e958ff1

View File

@ -172,7 +172,7 @@ namespace de4dot.deobfuscators.CliSecure {
offset = methodDefTable.fileOffset - methodDefTable.totalSize;
foreach (var methodInfo in methodInfos) {
offset += methodDefTable.totalSize;
if (methodInfo.flags == 0 && methodInfo.localVarSigTok == 0)
if (methodInfo.flags == 0 || methodInfo.codeOffs == 0)
continue;
uint rva = peImage.offsetReadUInt32(offset);
peImage.writeUint16(rva, (ushort)methodInfo.flags);