|
How can I dissect an .exe to view its contents? The IDE of Visual C++.NET does not allow these file types to be opened. I opened one using the edit program from the dos command prompt, but it was just a bunch of symbols and letters. So I guess my question should be what do I do to view an .exe in a legible form?
|
|
|
|
|
What do you want to view specifically?
You can view things like the import and export tables, the resources and other information like that with a PE viewer. You can find one in MSDN by Matt Peitrek.
However, if you want to look at the actual code for the EXE you cant do that. You will need a reverse compiler, and they are not all that great.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Paul Watt wrote:
You will need a reverse compiler, and they are not all that great.
Nor are they all that legal in some areas. However I'm guessing Mr Anonymous doesn't care since he wants to steal someone's code.
|
|
|
|
|
Mark Nischalke wrote:
However I'm guessing Mr Anonymous doesn't care since he wants to steal someone's code.
Yeah, but what would he do with it ? He's obviously dumb enough to expect an exe just to be all the source files joined together.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Why does Mr. Anonymous have to be trying to steal someone's code. Why can't he just be learning through example. Or maybe he wanted to see how wrappers are utilized. There are hundreds of possibilities, but it would take a critic to only see the negative ones.
|
|
|
|
|
The IDE does let you open an EXE to view it's resources, at least.
Software Zen: delete this;
|
|
|
|
|
You can try dumpbin. It will display quite a bit of information, including disassembly.
It's a good tool for learning what is inside an EXE.
Jason Shirk
VC++ Compiler Team
|
|
|
|
|
Hello,
I would like to create a utility that automatically moves MP3 files around and creates directories or deletes them based on my criteria. What is the preferred MFC functions to use for copying, renaming, deleting, and moving both files and directories? ("Directory" is a difficult search word because it results in everything dealing with MFC installation, not directory manipulation).
Thanks!
JennyP
|
|
|
|
|
CopyFile(Ex), MoveFile(Ex), DeleteFile
Search for File Management Functions
|
|
|
|
|
SHFileOperation is also a good choice !
Max.
|
|
|
|
|
I'm trying to print the file using ShellExecuteEx()
but for some of the files need file's associate .exe to set before ShellExecuteEx() get called.
So I want to set the fiel associate .exe ( same as "open with") programmatically.
So I search...
I found out I can set the registry as
[code]
Use the Registry functions to access the registry.
HKEY_CLASSES_ROOT\.ext\(Default) contains the type of file you are looking for. Then accessing
HKEY_CLASSES_ROOT\fileinfo\Shell\Open\Command\(Def
ault) where fileinfo is the value that was specified in the first registry key I mentioned.
[/code]
but I don't know where to get HKEY_CLASSES_ROOT..
I don't know how and where to set HKEY_CLASSES_ROOT
I also used [code]
CString finename = "abc.txt";
CString path = "C:\";
LPTSTR fn = (LPTSTR)(const char*)filename;
LPTSTR p = (LPTSTR)(const char*)path;
LPTSTR r;
::FindExecutable(fn,p,r);[/code]
but I got run time error at FindExecutable()..
Lets say, if FindExecutable is returning r, (in this case r = "c:\program files\notepad.exe", which contains the file name with Rath name... ,, then what should I do... what if r is empty...???
Thanks
|
|
|
|
|
If you are using ShellExecuteEx , then it handles finding the associated application for you. Just specify the name of the document and set the verb to "print". If the document has an associated application, and the application supports the print verb, that should do it.
Software Zen: delete this;
|
|
|
|
|
I know about it.. but what if the documents doesn't have associated applicaiton, print verb??
How can I set the associated application programatically??
|
|
|
|
|
If the document type does not have an associated application, then you need to do one of two things, both of which require the same information.
First, you could create an association for the document type. This requires that you know the path to the application and the command line syntax used for printing. You must also create the association in the registry.
On the other hand, since you know the path to the application and the command line syntax for printing, you could simply use CreateProcess and run the application directly. This is easier than the first approach, since you don't have to mess with the registry and establish the association.
If you don't know the path to the application, or you don't know the application's command line syntax for printing, then neither of these approaches will work.
Software Zen: delete this;
|
|
|
|
|
Thanks for your reply Gary. I was looking for information to do so... and found out that I have to used RegOpenkey()..something like that. but don't really have the idea of using it..
Would you please tell me how to create the asociation in the registry?
|
|
|
|
|
|
I don't use WinAmp, but I have seen screen grabs of some of the skins for it. The thing that catches my eye is the reflective screen does not get lost by drawing the text/controls that are supposed to be beneath it. Is this done by using something like AlphaBlend()? Maybe WinAmp requires DirectX? Any ideas what they are using to implement the drawing? I'm not talking about creating my own skin for WinAmp - I'm talking about the code used to implement the skinning.
|
|
|
|
|
I've never done this, but don't you think that would be easier to make all the controls owner drawn and that all those controls load the images that must show from one/some external and easy configurable resource file?
|
|
|
|
|
Thanks for the reply,
Skinning applications usually ask you to provide a series of image files, and a configuration file (.ini) that helps the program put them all together.
The most interesting part for me is the actual code used to take the static image (somtimes looks like a LCD screen depending on the skin), and draw dynamic text, images to make it look as though they are beneath this static image. There must be some kind of blending happening, but I don't know what they are using to do this.
|
|
|
|
|
Dave_ wrote:
Is this done by using something like AlphaBlend()?
Dunno, but I do know that if it runs on W95 they will have rolled their own, as it is not available there. I did the same, it was my first WDJ article and is still online. As for skinning, search for 'skin mpeg' here on CP and you'll find an mp3 player that is skinnable.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Thanks Christian,
Your article is actually the one that started me on this path. Do you know where I might be able to find some info on how to do a blend? I don't mind doing the research, and attempting to implement this myself but I would really hate to go through all of this if someone (on codeproject) already knows more about it.
The main reason why I think I would need to do this myself (instead of using AlphaBlend()) is due to the fact that NT, and other O/S's don't have the ability without having to redistribute files,...
I guess what I am looking for is someone who has some low-level graphics knowledge, and can tell me a little about the process.
Thanks again - great article - very informative/inspiring.
|
|
|
|
|
Do you mean my WDJ article, or something I wrote here ? My WDJ article impliments a replacement for AlphaBlend, and you should use that, even if you don't have OS worries. Mine don't leak memory......
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Oops, sorry - I read through your reply too fast. I was talking about the mpeg app. I will see if I can find your article.
Thanks again.
|
|
|
|
|
The article is here:
http://www.windevnet.com/documents/s=7628/wdj0109b/0109b.htm[^]
but the code that was published was an early version and leaks memory ( this was my first ever non-MFC Windows code and I took a few tries to figure it all out ). The ammended code is here:
http://www.windevnet.com/documents/s=7255/wdj0111j/0111j_l1.htm[^]
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Is it possible to call a specialized function of a base class ?
I mean:
class A
{
protected:
virtual int f() { return -1; };
public:
void DoFunc() { printf("\nValue: %d",f()); };
};
class B : public A
{
protected:
virtual int f() { return 1; };
};
int main()
{
B Inst;
Inst.DoFunc();
}
pure virtual function does not help because the MFC macro IMPLEMENT_DYNCREATE makes the
compiler think it get instantiated.
Is it possible to get the class A to print 1 instead of -1 ?
|
|
|
|