bin_replace_string: Edit Precompiled Binaries

bin_replace_string edits C-style strings in precompiled binaries. This is intended to be useful to replace arbitrary strings in binaries whose source code is not available. If you find yourself using this utility on a GPL-licensed program, you're using the wrong method ;-). However, because of the nature of compiled binaries, bin_replace_string may only replace a given C-string with a shorter C-string.

One supposed use case is where a precompiled binary tries to access an arbitrary path which is both incorrect and unconfigurable.

I recognize that bin_replace_string is a simple and limited tool. If you want to modify portions of an ELF header itself, for example, you should not use bin_replace_string. Instead, try patchelf which is designed to edit ELF headers, such as RPATH. It even knows how to replace short strings (in ELF headers, not compiled code or C strings) with longer ones.

Documentation

Documentation is shipped with the sources and installed as a manpage using the txt2man(1) utility. You may read bin_replace_string(1) online.

Downloads

Ubuntu users may use binki's PPA to install bin_replace_string (the package is called bin-replace-string because debian uses the scheme P=${PN}_${PV} and doesn't allow _ in ${PN}).

The first release of bin_replace_string was unix-style filter-based. The current release has a completely different CLI, which is documented in the man page which was first written for this release.

Dependencies

bin_replace_string depends on the following packages:

Bugs

Please report bugs at our local bugtracker. Also, feel free to speak to binki directly via email or IRC.

Version Control System

The sourcecode for bin_replace_string is managed by Mercurial. The hgweb interface is available at at http://ohnopub.net/hg/bin_replace_string. One may clone the repository with the following command:

$ hg clone http://ohnopub.net/hg/bin_replace_string

Nathan Phillip Brink (binki) <ohnobinki at oh no publishing dot net> a.k.a. apostrophe
Last-Modified: 2012-02-06T18:08:13-05:00