RAPATCH2(1)

πŸ“¦ version 6.1.8, in ubuntu stonking

✨ 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; skip N directories. like, N of them. gone. bye πŸ’…
  • -R β€” Reverse patch. undo arc, main character energy πŸ‘‘
  • -s β€” Sandbox mode: disable scripts and r2 command 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