473,387 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to get file header information

HR
I'm looking for a way to programmtically identify if an executable image is
32 or 64 bit. I can do this from a DOS prompt using "dumpbin /headers
filex.exe | find /I machine". I need to what dumpbin does to get the header
of a file. What C call do I make to do that? Alternatively, if I could get
the source to the command dumpbin I could figure it out. But I'll take the
straight C call or any help. Thanks!

HR

--
Jack Of All Trades, Master Of How Many?
Feb 27 '06 #1
2 2965
"HR" <HR@discussions.microsoft.com> wrote in message
news:12**********************************@microsof t.com...
I'm looking for a way to programmtically identify if an executable image
is
32 or 64 bit. I can do this from a DOS prompt using "dumpbin /headers
filex.exe | find /I machine". I need to what dumpbin does to get the
header
of a file. What C call do I make to do that? Alternatively, if I could
get
the source to the command dumpbin I could figure it out. But I'll take
the
straight C call or any help. Thanks!


Check the docs for GetBinaryType()

http://msdn.microsoft.com/library/de...binarytype.asp

Regards,
Will
Feb 27 '06 #2
HR
This works great for executables. Thanks for the pointer. Is there a similar
call to use on .dll files? dumpbin /header works on both .exe and .dll
files, so there must be a way!

Thanks.

HR

"William DePalo [MVP VC++]" wrote:
"HR" <HR@discussions.microsoft.com> wrote in message
news:12**********************************@microsof t.com...
I'm looking for a way to programmtically identify if an executable image
is
32 or 64 bit. I can do this from a DOS prompt using "dumpbin /headers
filex.exe | find /I machine". I need to what dumpbin does to get the
header
of a file. What C call do I make to do that? Alternatively, if I could
get
the source to the command dumpbin I could figure it out. But I'll take
the
straight C call or any help. Thanks!


Check the docs for GetBinaryType()

http://msdn.microsoft.com/library/de...binarytype.asp

Regards,
Will

Mar 10 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: John | last post by:
I have over 5000 thumbnail pictures of size 5kb each. I would like to able to load all 5000 pictures and view 50 per page using mysql_data_seek(). I would like to know what are the advantages and...
7
by: Joseph | last post by:
Hi, I'm having bit of questions on recursive pointer. I have following code that supports upto 8K files but when i do a file like 12K i get a segment fault. I Know it is in this line of code. ...
16
by: Michael | last post by:
I have a data application in a2k that I need to create two fixed width text files and then combine them to a single file The first file is header information and the second is transaction data. ...
0
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
1
by: Roy | last post by:
Hi, I have a problem that I have been working with for a while. I need to be able from server side (asp.net) to detect that the file i'm streaming down to the client is saved...
5
by: Mikael S. H. | last post by:
Header file compilation I'm coding a small irc bot, and I've noticed that compilation takes very long when I add certain header files (compared to compilation time without). I've tried to find...
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
6
by: bobby | last post by:
hi group, Does the header file size or number in include(s) effect the size of executable file? In other world if i chose a large header file and include it with my source file does it increase...
2
by: houghi | last post by:
I am trying to do two things at a time. I want to give the user the opportunity to save a file and at the same time see new information on the screen. I can do it seperately, but not together....
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.