Main Menu
Login
bpatch - Binary patching tool
  Posted on Sun 07 Aug 2005 (5979 reads)
BINARY PATCHING TOOL - BPATCH

Current release of bpatch is: 1.02b.


SUPPORTED PLATFORM
All Psions, Linux, Windoze and Dos machines.


KEYWORDS
Patching of binary files, .dif file


MOTIVATION
My friend Bur says that hackers are divided to the two major groups: text hackers (which create new version of program only if they have sources of the program) and binary hackers (which create new version directly from binaries).
This is story about second case of hacking.
I bought Psion netBook two years ago. This machine boot system from image file stored on CF card. You can download new version of image file direct from Psion homepage, but now Psion stop developing and publishing new images and not released sources of OS. Actual version has bugs. So I try fixing some bugs and making some improvements. I was surprised how many owners of netBook want my patches. Therefore I decide to publish small patch files and not whole large 14 Mb image files.


DOWNLOAD
For download bpatch distribution with binaries and sources visit: Patisoners download section.


WHY EXIST BPATCH
Bpatch is universal tool for patching any binary files. This tool maybe exists for many GPL OS but I don't find it. So, I developed my own.
For any patching process you need patching tool, patch file (typically simple text file with .dif extension) and file for patching.
Structure of patch file is very easy to understand. You can make modification of bytes without bpatch (for example with some hex editor), but for modification many bytes is better use bpatch tool.
I developed bpatch in ANSI C with emphasis to the portability. So you can compile and use bpatch on: M$-DOS, Windoze, Linux, Epoc, EpocEmx and many others OSes. Sources are published under GPL license, so you can feel free if you want make some modifications.


HOW TO USE BPATCH
Typically usage is:


Apply file.dif patch to the file file.bin. File file.bin has been modified.
If you want have original version you must backup it before patching or run bpatch again with -u option.


Apply file.dif patch in reverse order to the file file.bin. You get original version of file.bin.

bpatch have many options for full list of them please type:


Note:
Epoc version of bpatch need some command line enviroment. Typically eshell.exe from Symbian. If you use eshell version copy bpatch to the system\programs\ folder. For eshell version you must always type whole path for files,for example:

Therefore is better use epocemx version of the bpatch.


WHAT IS PATCH FILE
Patch file (dif file) is simple text file where each line defines one byte change in patched file (change record). Change record is defined by: file offset, old byte value and new byte value. All values must be in hexadecimal base.
For example (file.dif):


This example patch file defines byte modification from value 0x03 to the value 0xAF at offset 0x89ABCD on the patched file.


BUG REPORTS
If you have some problem with bpatch or you find some bug, send me email or post comments at end of this article.

Cheers,
Poke^Patisoners.
2005-09-01
Index :: Print
The comments are owned by the poster. We aren't responsible for their content.
Poster Thread