Extract String from EXE
Question
Friday, September 4, 2009 4:07 PM
Hi,
I need to extract strings from a EXE file . What are the ways to do that??
All replies (7)
Saturday, September 5, 2009 8:12 PM âś…Answered
Quote>I have to remove and display the strings.
Quote>the file to be searched is a compiled CPP file.
Well, some obvious unanswered questions:
Why?
If you don't want the strings in the compiled exe, why have them in the source file in
the first place?
Quote>I should be able to extract(remove) all the strings present in this file
If you forcibly remove the strings from the compiled exe, what do think will happen when
you run the exe and the program tries to access the now non-existent strings?
If you compact the exe by removing a string and shifting the remaining file data up to
where the string used to be, you will corrupt the exe by invalidating internal addresses.
You need to clarify your actual objectives - what are you trying to achieve by removing
these strings from the exe?
- Wayne
Friday, September 4, 2009 5:42 PM
Do you mean extract using a programmer's tool, or extract with code? Are the strings in the exe resource section or in its code? Is the exe native or managed? Explain your problem in detail.
Friday, September 4, 2009 8:06 PM
If these are resource strings just open the .exe in Visual Studio with File + Open File. If these are arbitrary strings, use any hex viewer or Sysinternals' Strings.exe utility. Please make a minimal effort documenting your needs the next time.
Hans Passant.
Saturday, September 5, 2009 9:24 AM
Hi,
Thanks for the reply
I have to extract using a code. The strings are in the code.
Basically i have to extract all the strings present in an .exe file i.e. Complied CPP file and the exe present in the Debug folder
Saturday, September 5, 2009 2:40 PM
Quote>The strings are in the code.
You mean the target strings you're going to try to find in some other file?
Quote>i have to extract all the strings present in an .exe file
Define "extract" - do you mean simply report on which of the target strings were found?
Or do you mean *remove* them from the exe file being searched?
Will these strings be recorded as Unicode, MBCS, SBCS, other?
Is it known how big the file to be searched may be? This impacts the search algorithm
as extremely large files may not be able to be loaded into memory in their entirety,
with the result that a "string" may be broken across blocks of data. If the entire file
can fit into memory, it simplifies the search.
- Wayne
P.S. - Note that you should always provide details such as this without being asked.
Saturday, September 5, 2009 4:06 PM
Thanks for the reply. This is my first post here so will surely take care next time
I have to remove and display the strings. I need to take a .EXE file which i get after building a CPP file and present in the Debug folder. I should be able to extract(remove) all the strings present in this file and display them.
So the file to be searched is a compiled CPP file.
Sunday, December 25, 2016 9:10 PM
Quite an old topic. I've found this tools tonight for the same problem :