|
-
Sep 8th, 2005, 06:10 AM
#1
Thread Starter
Lively Member
Reading EXE Problems
I'm looking for a way to read an exe file on the hard disk, scan through it for a reference to a particular dll and then determine which version of this dll the exe needs to run. Any suggestions would be useful.
-
Sep 8th, 2005, 07:39 AM
#2
Re: Reading EXE Problems
Welcome to the forums. 
Do you have Visual Studio 6.0 Enterprise edition?
If so, that ships with a file called Depends.Exe - feeding this file a VB exe, it will tell you what dependency files this exe needs in order to run.
-
Sep 8th, 2005, 03:11 PM
#3
Junior Member
Re: Reading EXE Problems
Hi Hack,
First off, thanks for your welcome it was very polite . I'm currently looking for a way to open any named exe file and read it to determine the version of a named activeX dll that it needs. Basically we have over 200 programs in our system but some versions of the programs are using a different versions of our main dll. It'd be handy if I could write a program that knew which dll an exe needed. Part of the problem seems to be that the only named dll compiled into our exes is the msvbvm60.dll (vb run-time dll) which the program needs to run. Any other dlls references aren't listed as straight text within the exe which is why I can't find them. Any ideas on how to look for it? I can determine the version of the dll by reading it alright (I'm not looking for the version number as this is unreliable but a particular piece of code that is used by the later version of the dll). Like, if the program crashes when we have the wrong dll, it should be possible to perform the check without running the exe.
I've already checked the MSDN (it's always a pain finding stuff in there) but exe format is not Microsoft's. Exes are formatted in a type called Portable Executable (PE) format and are used by Os2, Unix, Linux, Macintosh, Windows and several other OS's. Believe it or not, the layout of all these exe files are the same.
I've tried opening the exe in notepad, hex editors and I've also used the Depends.exe utility by microsoft - they all only see the msvbvm60.dll. I know the info is in there but I can't figure out where. It might have something to do with howreferences to COM objects are stored within the exe but I'm not sure.
Do you have any ideas now lol? This is just to clarify what i'm actually doing
-
Sep 10th, 2005, 04:36 PM
#4
Re: Reading EXE Problems
Interesting. Apparenltly, an EXE only contains information about non-COM DLLs that it depends on. I would then have to guess that the EXE contains some kind of compiled instruction like CreateObject(Project.Class) and then the OS takes care of finding out what DLL is needed and where it is during run-time (or load-time). Is it possible the GUID is stored in the EXE?
Nobody knows what software they want until after you've delivered what they originally asked for.
Don't solve problems which don't exist.
"If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)
2 idiots don't make a genius.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|