Jump to content

New ResPatch patching tool

Recommended Posts

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.)




Link to post
Share on other sites

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. 

Link to post
Share on other sites
On 8/28/2020 at 10:21 PM, Crutch said:

(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.

Link to post
Share on other sites

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. 

Link to post
Share on other sites
  • 4 weeks later...
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...