PDA

View Full Version : Finding text within exe files



chacanger
03-04-2011, 05:00 PM
Hello

I was wondering if anyone knew how to do a kind of InStr or Mid function to search and obtain text within exe files without actually having to use references. The reason I say without references i because the program I need to obtain text from has no valid references or DLL files that can be physically viewed and the target of the program is stored in an unviewable place like SYSTEM or RECYCLED are. So for example if I wanted to open Character Map and search for the text Characters to Copy.

Here is a test of what I've done so far but it dosen't give me any results...
Sub WMP()
Dim RetVal, FText, MText
RetVal = Shell("D:\WINDOWS\system32\charmap.EXE", 1)
FText = InStr(1, RetVal, "Characters to Copy")
MText = Mid(RetVal, 1424)
MsgBox FText & " & " & MText
End Sub

Many Thanks

Chacanger

mdmackillop
03-04-2011, 06:22 PM
If you were to open such a file in Notepad, you would see that it is not in a readable format and a search is likely to fail.

Kenneth Hobs
03-04-2011, 08:39 PM
EXE files are binary files as explained. What you see in CharMap.exe is a dialog. As such, you can sometimes use various API methods to find certain things in some dialogs. There are spy programs that you buy or download to find out some information about Window controls and some even generate code to make it easy to tweak.

You might approach solving your problem by asking for specific help by stating a goal and outcome rather than stating the method that you would like to use to solve. That is unless some method would solve the problem and you want to be taught that method.

chacanger
03-05-2011, 01:27 PM
EXE files are binary files as explained. What you see in CharMap.exe is a dialog. As such, you can sometimes use various API methods to find certain things in some dialogs. There are spy programs that you buy or download to find out some information about Window controls and some even generate code to make it easy to tweak.

You might approach solving your problem by asking for specific help by stating a goal and outcome rather than stating the method that you would like to use to solve. That is unless some method would solve the problem and you want to be taught that method.

I was looking into a bit more and I realised there were RunTime Erros and Input Boxes identical to VBA, So it would seem likely that it is a VB Program, I have a mock up of what it looks like below, it seems there is some sort of text box that takes up the whole screen and and a list box.

The only issue is, how can I find out what the names of the controls if the only way to the file is a file shortcut?

http://i860.photobucket.com/albums/ab168/chacanger/Misc/XMPLE.png

Zack Barresse
03-06-2011, 10:50 AM
It appears you're talking about hacking a program. We do not condone that here and will not allow you to post information regarding hacking or exploiting intellectual property.

chacanger
03-06-2011, 11:30 AM
It appears you're talking about hacking a program. We do not condone that here and will not allow you to post information regarding hacking or exploiting intellectual property.

It wasn't intended to be hacking at any cost, the main reason I was going to use it was to automate the task of obtainting info to put into a spreasheet to analyse, I can take the info other ways, but it just means it will take longer and be less efficient, If it infringes the rules then I will not ask any more on this.

Sorry for any inconvinence guys.

Zack Barresse
03-06-2011, 11:57 AM
Just make sure you read this...

http://www.vbaexpress.com/forum/faq.php?faq=psting_faq_item#faq_hack_faq_item

As long as you adhere to our simple rules, all is well. :)