Click here to Skip to main content
15,896,489 members
Articles / Programming Languages / C++

XPEInfo - a non-MFC class to get info from PE file

Rate me:
Please Sign up or sign in to vote.
4.95/5 (21 votes)
11 Dec 2008CPOL4 min read 44.4K   988   53  
The XPEInfo APIs allow you to extract information from a PE file. Included in the download is a Windows demo app, and a console app that tests whether a PE file is valid, whether it is 64-bit, contains debug info, is a .Net executable, or is signed. Sample cmd files are provided.
@rem hdsample.cmd

@echo off
hdpeinfo %1 %2
echo hdpeinfo %1 %2:  exit code = %ERRORLEVEL%

if %ERRORLEVEL% == -1 goto badargs
if %ERRORLEVEL% == 0 goto false
if %ERRORLEVEL% == 1 goto true
if %ERRORLEVEL% == 2 goto end
goto unknown

:badargs
echo bad args
goto end

:false
echo exit code 0
goto end

:true
echo exit code 1
goto end

:unknown
echo unknown exit code %ERRORLEVEL%
goto end

:end

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Hans Dietrich Software
United States United States
I attended St. Michael's College of the University of Toronto, with the intention of becoming a priest. A friend in the University's Computer Science Department got me interested in programming, and I have been hooked ever since.

Recently, I have moved to Los Angeles where I am doing consulting and development work.

For consulting and custom software development, please see www.hdsoft.org.






Comments and Discussions