472,972 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,972 software developers and data experts.

extract the strings in an exe

Hi,

How can I extract all the strings in an exe with python? O:-)
Jul 18 '05 #1
3 4849
Fernando Rodriguez wrote:
Hi,

How can I extract all the strings in an exe with python? O:-)


I don't know about Python, but Unixoid systems, and on Windows, Cygwin
has a utility called 'strings' which you can use for exactly this purpose.

It's written in C and you could translate its algorithm to Python ;)

-- Gerhard

Jul 18 '05 #2

On Nov 21, 2003, at 2:52 AM, Fernando Rodriguez wrote:
How can I extract all the strings in an exe with python? O:-)

CTRL-D

$ strings foo.exe

--- OR ---

import os
os.exec1p('strings', 'foo.exe')

--- OR ---

import re
fooExe = file('foo.exe', 'r').read()
strings = re.findall("[\x1f-\x7e]{4,}", fooExe)

---

If you're looking for something a little more discriminating, you'll
need to ask someone who cares about executable formats. This will
probably print out the function names as well. Basically, the code
finds strings of printing characters at least four characters long.

If you're looking for the definitive list of strings, you're going to
hit your head against the cold, hard reality of executable formats not
usually storying that information. It just isn't there.
Jul 18 '05 #3
Fernando Rodriguez <fr*@easyjob.net> wrote in message news:<1j********************************@4ax.com>. ..
Hi,

How can I extract all the strings in an exe with python? O:-)


Looks like this might be of use (look for SRV):

http://www.micon.no/PythonPage.asp

I haven't tried it myself; just came across it looking for something else.

TJG
Jul 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Logical | last post by:
I wanted to do: include('page.htm?id=12&foo=bar'); But since I can't (and don't want to make another seperate HTTP request with include('http://...')); I was wondering if there's a function...
9
by: Sharon | last post by:
hi, I want to extract a string from a file, if the file is like this: 1 This is the string 2 3 4 how could I extract the string, starting from the 10th position (i.e. "T") and...
4
by: Barry | last post by:
How can I open a word doc and extract the text as text without any formatting characters?? -- Barry Fitzgerald
4
by: yinglcs | last post by:
Hi, how can I extract 2 integers from a string in python? for example, my source string is this: Total size: 173233 (371587) I want to extract the integer 173233 and 371587 from that...
9
by: flit | last post by:
Hello All, Using poplib in python I can extract only the headers using the .top, there is a way to extract only the message text without the headers? like remove the fields below: "...
3
by: maylee21 | last post by:
hi, anyone can help me figure out how to read data from a text file like this: 10980012907200228082002 and extract the data according to this kind of format: Record type 1 TY-RECORD ...
4
by: Horacius ReX | last post by:
Hi, I have to read some data from a file, and on each block it always appears the followng string; xyz.vs.1-81_1 . It appears a lot of time with different numbers like; xyz.vs.1-81_1...
1
by: davidson1 | last post by:
Hai, i have a string 04AF045 in that AF are character , others are numbers , now what i need is i have to extract AF alone in ASP.NET written in vb. if anybody know pl reply me.. other...
3
by: SteveB | last post by:
I have posted this question in the Visual Basic 2005 and Visual Basic .Net 2005 discussion groups, also. Hi. I am developing an application/web page with VB.Net that will populate a SQL...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
3
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.