Make sure lastOffset <= fileData.Length (could be a bad dump)
This commit is contained in:
parent
bf7c0d58d2
commit
7bcf5b4710
|
@ -199,7 +199,7 @@ namespace de4dot.code.deobfuscators.CodeVeil {
|
||||||
|
|
||||||
const int RVA_EXECUTIVE_OFFSET = 1 * 4;
|
const int RVA_EXECUTIVE_OFFSET = 1 * 4;
|
||||||
const int ENC_CODE_OFFSET = 6 * 4;
|
const int ENC_CODE_OFFSET = 6 * 4;
|
||||||
int lastOffset = (int)(section.PointerToRawData + section.SizeOfRawData);
|
int lastOffset = Math.Min(fileData.Length, (int)(section.PointerToRawData + section.SizeOfRawData));
|
||||||
for (int offset = getStartOffset(peImage); offset < lastOffset; ) {
|
for (int offset = getStartOffset(peImage); offset < lastOffset; ) {
|
||||||
offset = findSig(fileData, offset, lastOffset, initializeMethodEnd);
|
offset = findSig(fileData, offset, lastOffset, initializeMethodEnd);
|
||||||
if (offset < 0)
|
if (offset < 0)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user