LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-25-2006, 10:21 AM   #1
aalex77
LQ Newbie
 
Registered: Dec 2005
Posts: 7

Rep: Reputation: 0
Search and replace string in executable files


Hello, i whish to write e little program that allow me to search a string in an executable file.
I though something like that:

myprog file_name string_to_search string_to_replace

Obviosly the two strings has the same length.

Some one can give me some hint on how to search a text string in an executable file??
I tried to open it as a binary file but my purpose is to get a bit sequency (0 and 1), cause i just find out the way to transform a string in a bitstream.
Regards
 
Old 05-25-2006, 08:22 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
3 things you can look at:
man strings
man od
binmode in Perl
 
Old 05-26-2006, 06:32 PM   #3
aalex77
LQ Newbie
 
Registered: Dec 2005
Posts: 7

Original Poster
Rep: Reputation: 0
Thanks i will try!
Regards
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
search/replace in many files allelopath Linux - General 1 08-02-2005 09:21 PM
Search and Replace a string1 with string2 in many files TroelsSmit Linux - Newbie 5 12-16-2004 01:04 PM
Search and Replace over multiple files The_Nerd Linux - Software 8 06-20-2004 06:59 AM
search for pattern in files and replace mizuki26 Linux - Newbie 3 01-04-2004 11:57 AM
problem in perl replace command with slash (/) in search/replace string ramesh_ps1 Red Hat 4 09-10-2003 01:04 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration