🔒 Locked
source code
Advertisement
Original Post
If you only have the .exe, there is no way to view the original C++ source. You can view the machine code with a hex editor (I use gvim), or you could search for a disassembler or decompiler.
A disassembler translates machine code into assembly, and a decompiler translates it into a higher level language (usually C). The code you get with these program will *not* look like the original code though. I have never used a decompiler, so I have no suggestions here.
But if you have the source code, then yeah Wordpad or Notepad will work just fine.
A disassembler translates machine code into assembly, and a decompiler translates it into a higher level language (usually C). The code you get with these program will *not* look like the original code though. I have never used a decompiler, so I have no suggestions here.
But if you have the source code, then yeah Wordpad or Notepad will work just fine.
This reply is for all the nice people how answere my question
some of u asked what is it am trying to do.
well it is an idea but I don't know if it is possible without the source code of the game.
What it is I have this EXE file it is for a game. When you run the game and when you hit [ENTER] a dialog box pops up (in the middle of screen) to enter some chat. I would like to know where I can find this dialog box so I can edit its shape or it's location on the screen. I appreciate your respond. Note I used PE explorer but did not extarct dialog boxes only icon stupid and some scripts. I used Winspector and told me information about this dialog box.
such as it's class name, size, coordinates..etc.
some of u asked what is it am trying to do.
well it is an idea but I don't know if it is possible without the source code of the game.
What it is I have this EXE file it is for a game. When you run the game and when you hit [ENTER] a dialog box pops up (in the middle of screen) to enter some chat. I would like to know where I can find this dialog box so I can edit its shape or it's location on the screen. I appreciate your respond. Note I used PE explorer but did not extarct dialog boxes only icon stupid and some scripts. I used Winspector and told me information about this dialog box.
such as it's class name, size, coordinates..etc.
It's possible, although it is very likely that it is going to be so difficult its not worth the trouble. You might be able to locate, if you spend a lot of time, the dialog's resource definition in memory someplace and edit it, but that won't actually "stick" unless the code doesn't ever modify the dialog, and you have to get sizes and offsets correct, and you have to be able to find the dialog in the first place (it may be totally generated on the fly, et cetera).
It's really not a viable operation.
It's really not a viable operation.
If you want to do it with a quick hack, it's not too troublesome to order the window around with another program and some window messages. Use spy++ to figure out the class of the dialog box, then write a program that looks for that dialog box and tells it to set its location. It's an ugly hack, but it's 1000x easier than changing the exe.
The window positioning is probably part of the exe, as part of the resources, compiled with the code. If it is a standard Microsoft Window (not some custon in-game window), Using a window spy could be the solution. I'm not sure if this will allow you to modify the binary itself.
It can also be that the window position is dynamic, and adapts to screen resolution, and the window placement is dynamically computed in the code. That way, you will have no way of changing that.
It can also be that the window position is dynamic, and adapts to screen resolution, and the window placement is dynamically computed in the code. That way, you will have no way of changing that.
Quote:
Original post by Palidine
You're going to need to learn assembly and pick up a program like Soft iCE.
Using SoftICE (or any kernel debugger, for that matter) would be cracking this nut with an asteroid. A user-mode debugger such as OllyDbg would be better-suited.
But before you get into disassembling anything, try to find out what
I'd recommend you get hold of a copy of PeID. It's free, and it has a huge database of PE fingerprints that can tell you what assembler, compiler or other was used to build the executable. From here, you'll be far better-equipped to mess around with the dialog parameters. Report back with your findings and anything else you know about the target, and we can direct you further.
Edit: I just realised we're talking C++.
Admiral
If it was linked using Visual Studio 6, then the dialogs may well use standard ActiveX scripts. Have a look at Resource Hacker. It's a freeware .rsrc viewer and editor, capable of modifying such scripts. Fire it up with the target executable and have a look in the Dialogs branch. If the dialog you're looking for is in there, changing it to your liking should be childsplay.
If Resource Hacker is no help, then it's likely that the dialogs are created dynamically in code. In this case you will have to get your hands dirty with a debugger.
Edit:
First, see my comment regarding SoftICE earlier. It's difficult enough to learn to use a friendly debugger such as OllyDbg, let alone a car-crash of a kernel debugger*.
Second, note that SoftICE isn't free. In fact, it is part of a very expensive driver development suite.
Third, understand that SoftICE is barely compatible with Windows XP, and simply having it installed causes many applications to refuse to run. I regularly have nightmares about installing SoftICE.
Admiral
* Perhaps that's not fair. SoftICE is very good in the light of its competition. It's the best of a bad bunch, I guess.
If Resource Hacker is no help, then it's likely that the dialogs are created dynamically in code. In this case you will have to get your hands dirty with a debugger.
Edit:
Quote:
Original post by sewar711
Any link to download softice for xp?
First, see my comment regarding SoftICE earlier. It's difficult enough to learn to use a friendly debugger such as OllyDbg, let alone a car-crash of a kernel debugger*.
Second, note that SoftICE isn't free. In fact, it is part of a very expensive driver development suite.
Third, understand that SoftICE is barely compatible with Windows XP, and simply having it installed causes many applications to refuse to run. I regularly have nightmares about installing SoftICE.
Admiral
* Perhaps that's not fair. SoftICE is very good in the light of its competition. It's the best of a bad bunch, I guess.
Quote:
Original post by TheAdmiral
If it was linked using Visual Studio 6, then the dialogs may well use standard ActiveX scripts. Have a look at Resource Hacker. It's a freeware .rsrc viewer and editor, capable of modifying such scripts. Fire it up with the target executable and have a look in the Dialogs branch. If the dialog you're looking for is in there, changing it to your liking should be childsplay.
If Resource Hacker is no help, then it's likely that the dialogs are created dynamically in code. In this case you will have to get your hands dirty with a debugger.
The Resource tools of PE Explorer are top notch. That tool also identifies the compiler used to build the exe.
@sewar711, if you weren't able to find the dialog resource using PE Explorer, it could be that window that pops up isn't a dialog window at all but a ordinary window with child windows etc. If that's the case, you'll probably need to hook that window in order to move it. To do that you need to identify the window class using a window spy tool, like WinSpy++. In fact, WinSpy++ will let you move any window, so you won't need to write a hook program at all. That tool won't permanently move the window. It will reappear in the same place the next time you run the program. If it turns out that the window isn't a window at all but simply a message box (ie the results of a call to MessageBox), WinSpy++ will be able to move that too, because message boxes are windows too.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement