Ignore:
Timestamp:
Oct 25, 2004, 12:02:36 AM (21 years ago)
Author:
pr
Message:

XWP bug 583

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/branch-1-0/src/helpers/exeh.c

    r229 r262  
    292292            else
    293293            {
     294                // V1.0.3 (2004-10-24) [pr]: Some non-DOS EXEs have a relocation table
     295                // offset which is 0 - these were previously identified as DOS EXEs.
    294296                // we have a DOS header:
    295                 if (pExec->pDosExeHeader->usRelocTableOfs < 0x40)
    296                 {
    297                     // neither LX nor PE nor NE:
    298                     pExec->ulOS = EXEOS_DOS3;
    299                     pExec->ulExeFormat = EXEFORMAT_OLDDOS;
    300                 }
    301                 else
     297                if (   (   (pExec->pDosExeHeader->usRelocTableOfs == 0)
     298                        || (pExec->pDosExeHeader->usRelocTableOfs >= sizeof(DOSEXEHEADER))
     299                       )
     300                    && (pExec->pDosExeHeader->ulNewHeaderOfs != 0)
     301                   )
    302302                {
    303303                    // we have a new header offset:
    304304                    fLoadNewHeader = TRUE;
    305305                    ulNewHeaderOfs = pExec->pDosExeHeader->ulNewHeaderOfs;
     306                }
     307                else
     308                {
     309                    // else DOS:
     310                    pExec->ulOS = EXEOS_DOS3;
     311                    pExec->ulExeFormat = EXEFORMAT_OLDDOS;
    306312                }
    307313            }
Note: See TracChangeset for help on using the changeset viewer.