Patching 68K Software – SimpleText
6 months ago
- #CodePatching
- #MacOS
- #SimpleText
- Request to modify SimpleText to open a smaller text window at startup.
- Initial assumption of an easy fix by overwriting constants proved incorrect.
- Requires Apple developer CD's code editor in ResEdit for disassembling code resources.
- Challenges in patching include avoiding resizing for different window types (pictures, video, about box).
- Solution involves injecting a routine to detect text windows and substitute size without disrupting existing jumps.
- Technique includes jumping to appended code and returning, ensuring registers are correctly managed.
- Additional patches needed for window resizing after document content is read.
- Workaround for storing variables within the code itself due to lack of global variables.
- Use of direct system calls and register management tricks for efficiency.
- Issues with CodeWarrior's limitations and ResEdit's template corruption noted.
- Final solution includes a resource for easy future window size redefinition.