https://github.com/magnuschase03/gopatch
Tool to easily patch binary files.
https://github.com/magnuschase03/gopatch
binary go patcher patching
Last synced: about 1 year ago
JSON representation
Tool to easily patch binary files.
- Host: GitHub
- URL: https://github.com/magnuschase03/gopatch
- Owner: MagnusChase03
- License: gpl-3.0
- Created: 2024-09-14T13:54:02.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-14T13:54:35.000Z (almost 2 years ago)
- Last Synced: 2025-02-13T11:34:29.658Z (over 1 year ago)
- Topics: binary, go, patcher, patching
- Language: Go
- Homepage:
- Size: 16.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GoPatch
*Tool to easily patch binary files.*
## Build
To build the tool:
```
$ go build main.go
$ strip main
$ mv main /usr/bin/gopatch
```
## Usage
To patch a binary:
```
$ gopatch
```
## Patchfile
A patchfile should follow the below syntax:
```
1
:
2 0x
```
Example:
```
1 0x12345678:
2 0x5058
3 0xe9
4
5 0x23456789:
6 0x45
```
This patches will happen at specified binary addresses, and the bytes will be
written in order.
## Example
Here is an example of gopatch being used:
`patch.txt`
```
1 0x0:
2 0x67
3 0x6869
```
```
$ xxd binary
00000000: 6162 630a 6465 660a abc.def.
$ gopatch binary patch.txt
$ xxd binary
00000000: 6768 690a 6465 660a ghi.def.
```