🤬
  • ■ ■ ■ ■ ■ ■
    SearchAvailableExe/Tools.cpp
    skipped 504 lines
    505 505   WORD* pRelocEntry = reinterpret_cast<WORD*>(reinterpret_cast<BYTE*>(pRelocBlock) + sizeof(IMAGE_BASE_RELOCATION));
    506 506   
    507 507   DWORD numRelocs = (pRelocBlock->SizeOfBlock - sizeof(IMAGE_BASE_RELOCATION)) / sizeof(WORD);
     508 + if (numRelocs > 0x1000) //处理有些程序不按约定来导致报错
     509 + break;
     510 + 
    508 511   for (DWORD i = 0; i < numRelocs; i++) {
    509 512   WORD relocType = (pRelocEntry[i] & 0xF000) >> 12;
    510 513   WORD relocOffset = pRelocEntry[i] & 0x0FFF;
    skipped 32 lines
    543 546   int bit;
    544 547   DWORD imageBase = 0;
    545 548   DWORD oep = 0;
     549 + 
     550 + if (*(PWORD)pDH != 0x5a4d)
     551 + return false;
    546 552   
    547 553   if (*(PWORD)((size_t)pDH + pDH->e_lfanew + 0x18) == IMAGE_NT_OPTIONAL_HDR32_MAGIC)
    548 554   {
    skipped 280 lines
Please wait...
Page is in error, reload to recover