• Updated 2023-07-12: Hello, Guest! Welcome back, and be sure to check out this follow-up post about our outage a week or so ago.

New ResPatch patching tool

Crutch

Well-known member
I wanted to do a little Toolbox coding recently, and at @ZaneKaminski’s suggestion put together a toy tool to apply/remove arbitrary patches to resource files.

“ResPatch” gives you a prepopulated popup menu of likely files to patch and available patches (it comes with several), checks to ensure the current contents are as expected, applies a patch, and adds a little string to the Get Info comment so you can tell from the Finder that the file has been patched.  It can reverse all that, too, if you want to remove a patch.

It comes with the common patch to run System 7.5.5 on an SE/30 with a modded ROM built in.  So you can use this tool to apply/remove that patch from the System file on your local HD with one click (it finds the System file for you automatically).  I also included a couple other small patches I developed that remove “nagware” warnings from a couple nice old Shareware cdevs, BeHierarchic and Helium.

You can create your own patch instructions with ResEdit, and save it as a double-clickable file to be applied by ResPatch as the default patch.  Instructions (ReadMe and “About” box text are identical) and THINK C source are included.  (I used THINK C 6.)

Perhaps someone will find it useful, or maybe find the code handy.  (Looping through nested directories with HFS is annoying to get right without poring through MacTutor, so this is an example...  I only check for files that are exactly one folder deep to prevent taking too long to load with a big HD.)

https://macintoshgarden.org/apps/respatch-10

29472404-707F-4794-85D7-70ED3001A5A0.png

 

Crutch

Well-known member
(Always patch a COPY of any file you really care about, not guaranteed to be bug free .... :) :)  )

 

Crutch

Well-known member
By the way, a “patch specification” is just an arbitrary length list of (resource type, resource ID, offset, length, old hex [for verification we’re patching the right thing], new hex). So, patches could be pretty involved, as long as you’re not creating new resources or changing their length. 

 

CC_333

Well-known member
This is an excellent application!

I wish someone had come up with this 20 years ago!  Better late than never, I suppose....

This is an absolute must for inclusion on any ROM SIMM!

c

 

ravuya

Active member
(Always patch a COPY of any file you really care about, not guaranteed to be bug free .... :) :)  )
Could you add a feature to have it make a backup of the files before patching them?

What error does it give if you've already patched? I assume the target signature doesn't exist then.

 

Crutch

Well-known member
Yes, if the target isn’t as expected, it will actually check to see if the patch has already been applied and tell you. 

I didn’t have it backup the file automatically because the file might be a System file and perhaps large. But that’s a good idea as an option. 

 
Top