Ignore:
Timestamp:
Feb 2, 2001, 9:45:42 AM (25 years ago)
Author:
bird
Message:

Corrected kFileLX and kFilePE constructors.
Made kDump.exe work again.
Added import module dump to kFilePE.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/common/kDump.cpp

    r4360 r5053  
    1 /* $Id: kDump.cpp,v 1.1 2000-10-02 04:07:44 bird Exp $
     1/* $Id: kDump.cpp,v 1.2 2001-02-02 08:45:41 bird Exp $
    22 *
    33 * Generic dumper...
     
    3939    for (argi = 1; argi < argc; argi++)
    4040    {
    41         FILE *phFile = fopen(argv[argi], "rb");
    42         if (phFile)
     41        try
    4342        {
    44             kFileFormatBase *pFile = NULL;
    45             try {pFile = new kFilePE(phFile);}
     43            kFile               file(argv[argi]);
     44            kFileFormatBase *   pFile = NULL;
     45            try {pFile = new kFilePE(&file);}
    4646            catch (int err)
    4747            {
    48                 //try {pFile = new kFileLX(phFile);}
    49                 //catch (int err)
     48                try {pFile = new kFileLX(&file);}
     49                catch (int err)
    5050                {
    51                     try {pFile = new kFileDef(phFile);}
     51                    try {pFile = new kFileDef(&file);}
    5252                    catch (int err)
    5353                    {
     
    6666                delete pFile;
    6767            }
    68             fclose(phFile);
    6968        }
    70         else
     69        catch (int err)
    7170        {
    72             fprintf(stderr, "Fatal: Failed to open file %s.\n", argv[argi]);
     71            fprintf(stderr, "Fatal: Failed to open file %s err=%d.\n", argv[argi], err);
    7372            return -1;
    7473        }
Note: See TracChangeset for help on using the changeset viewer.