VirtualBox

Ignore:
Timestamp:
Dec 27, 2017 5:00:46 PM (7 years ago)
Author:
vboxsync
Message:

RTLdrCheckImports: Added --list-oridnals option for getting both names and ordinals. Needed for some winsock and ole dlls.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/tools/RTLdrCheckImports.cpp

    r70319 r70363  
    6161    /** Verbosity level. */
    6262    unsigned    cVerbosity;
     63    /** Whether to also list orinals in the export listing. */
     64    bool        fListOrdinals;
    6365} RTCHECKIMPORTSOPTS;
    6466/** Pointer to the checker options. */
     
    496498    if (pszSymbol)
    497499        RTPrintf("%s\n", pszSymbol);
    498     else
     500    if (uSymbol != ~(unsigned)0 && (!pszSymbol || ((PCRTCHECKIMPORTSOPTS)pvUser)->fListOrdinals))
    499501        RTPrintf("#%u\n", uSymbol);
    500502    RT_NOREF(hLdrMod, Value, pvUser);
     
    507509 *
    508510 * @returns IPRT status code.
     511 * @param   pOpts               The check program options.
    509512 * @param   pszImage            Path to the image.
    510513 */
    511 static int ProduceExportList(const char *pszImage)
     514static int ProduceExportList(PCRTCHECKIMPORTSOPTS pOpts, const char *pszImage)
    512515{
    513516    /*
     
    575578         * The list of exports.
    576579         */
    577         rc = RTLdrEnumSymbols(hLdrMod, 0 /*fFlags*/, NULL, _4M, PrintSymbolForExportList, NULL);
     580        rc = RTLdrEnumSymbols(hLdrMod, 0 /*fFlags*/, NULL, _4M, PrintSymbolForExportList, (void *)pOpts);
    578581        if (RT_FAILURE(rc))
    579582            RTMsgError("%s: RTLdrEnumSymbols failed: %Rrc", pszImage, rc);
     
    606609        { "--path", 'p', RTGETOPT_REQ_STRING },
    607610        { "--export", 'e', RTGETOPT_REQ_STRING },
     611        { "--list-ordinals", 'O', RTGETOPT_REQ_NOTHING },
    608612        { "--quiet", 'q', RTGETOPT_REQ_NOTHING },
    609613        { "--verbose", 'v', RTGETOPT_REQ_NOTHING },
     
    632636
    633637            case 'e':
    634                 rc = ProduceExportList(ValueUnion.psz);
     638                rc = ProduceExportList(&Opts, ValueUnion.psz);
    635639                if (RT_FAILURE(rc))
    636640                    rcExit = RTEXITCODE_FAILURE;
     641                break;
     642
     643            case 'O':
     644                Opts.fListOrdinals = true;
    637645                break;
    638646
     
    663671                         "  -e, --export <image>\n"
    664672                         "    Write export list for the file to stdout.  (Redirect to a .export file.)\n"
     673                         "  -O, --list-ordinals\n"
     674                         "    Whether to list ordinals as well as names in the export list.\n"
    665675                         "  -q, --quiet\n"
    666676                         "    Quiet execution.\n"
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette