In case somebody is interested, here is some background on these patches.
In newer PS2 BIOSes, LoadExecPS2 and ExecPS2 are almost identical, as both of them hand over control of the system to another program. The difference is that LoadExecPS2 clears user memory and loads the new program from secondary storage, whereas ExecPS2 expects it to have already been loaded into memory, so it can be invoked directly. For this to work correctly, both routines reset hardware and kernel state: all threads are terminated, semaphores are freed, and the lists of registered interrupt and DMAC handlers are cleared.
Interestingly, the ExecPS2 implementation is different in the very first kernel version (which is used in both the retail SCPH-10000 (ROMVER=0100JC20000117) as well as the DTL-H10000 TEST unit (ROMVER=0101XD20000224)), as it skips the hardware and kernel reset: it just invokes the new program in the context of the calling thread, with all the old stuff still in place. I think you can guess what's going to happen once the kernel invokes one of those old handlers... :gravedigging:
With this in mind, it should be quite obvious what the patch for the old kernel does: insert a new implementation of ExecPS2 that mimics the behaviour of later versions. As there is only one kernel version that includes the misbehaving ExecPS2, existing helper functions (e.g., to reset thread priorities, terminate threads, reinitialize the semaphore control blocks and so on) can be called directly, so this patch isn't really that big.
What's more interesting is how to check whether it needs to be applied. The contents of ROMVER provides no direct indication whether the old kernel is in use (for example, TOOLs use something like 0100TD... as ROMVER regardless of SDK version, but include a much more recent kernel), so Sony decided to use a different detection method instead. There is a certain set of system calls (Get/SetOsdConfigParam) that is used by OSDSYS to save its configuration while the system is running, and it turns out that a certain field of the configuration structure cannot be changed by the old implementation; it will always read back as zero, regardless of which value has been specified in the last call to SetOsdConfigParam. So detection goes as follows: query config param (to be able to restore it later), set config param to attempt to change that special field, query config param again, then restore original config. If the second query call returns a non-zero value for the special field, an original old kernel is running and the ExecPS2 patch needs to be applied.
This patch detection is perfectly safe; the ExecPS2 patch can be applied repeatedly, even by different programs, without having to fear any crashes caused by different versions of the patcher binary. The original Sony patcher also contains replacements for Get/SetOsdConfigParam that disable the detection method mentioned above (as they allow changing the entire configuration value). However, they are not installed by default, and the only program I know of that installs them is the HDD-enabled OSDSYS. On the other hand, I have seen the ExecPS2 patch getting invoked as part of Sony's LIBC initialization code in various retail games.