RAPATCH2(1)
β¨ RAPATCH2(1) β binary patching utility β¨
okay bestie, so rapatch2 is a binary patching utility π
it's the section-1 manual page for it, and honestly? it's a whole vibe. let's get into it π«Ά
πΈ SYNOPSIS πΈ
rapatch2 [-psRqv] [patchfile] [targetfile]
that's the whole shape of it, babes. flags, then the patch file, then the target file. no cap. β¨
π¦ DESCRIPTION π¦
so this is a utility for applying binary patches to files using a human-friendly text format. yes queen, human-friendly. not some cursed hex-dump nightmare. π
the patches have to be written in a file, and they use this syntax here β writing them EXACTLY like this, character for character:
^# -> comments
! -> execute command
OFFSET { code block }
OFFSET "string"
OFFSET 01020304
OFFSET : assembly
+ {code}|"str"|0210|: asm
that's it, that's the grammar bestie, iykyk π ^# for comments, ! to execute a command, an OFFSET followed by a code block, a string, raw hex bytes, or some assembly with :. and that last line? + {code}|"str"|0210|: asm β alternate forms, the way that it just lets you mix and match. iconic fr fr π
β¨ OPTIONS β¨
-p Nβ Patch level; skipNdirectories. like,Nof them. gone. bye π-Rβ Reverse patch. undo arc, main character energy π-sβ Sandbox mode: disable scripts andr2command execution. safety first, gorgeous π-qβ be quiet π€«-vβ show version β
π ENVIRONMENT π
real talk: rapatch2 does not use any environment variables.
not a single one. zero. the environment could be empty and it would not care, and honestly? that's self-care πΈ
π EXAMPLES π
1. generate a patch with radiff2 and then apply it with rapatch2: π₯
$ radiff2 -u bin1 bin2 > patch
$ rapatch2 -p 1 < patch
2. patch a specific file:
$ rapatch2 bin1 patch
3. create a simple patch file manually: (yes, by hand, we're artisanal now π)
$ cat > mypatch.r2
0x100 "Hello World"
0x200 9090
0x300 : nop
^D
$ rapatch2 target_binary mypatch.r2
look at you, hand-writing offsets and a lil nop and everything. slay π«Ά
π SEE ALSO π
(the whole fam, go read them too π)
π AUTHORS π
Written by pancake <pancake@nopcode.org>.
and that's the tea, bestie π¦ this page is from Jul 10, 2025, man page RAPATCH2(1) β you now know binary patching better than half the internet. periodt. π
β¨
π¦ where this page comes from
- ubuntu stonking: radare2 6.1.8+ds-1 Β· LGPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms