View Full Version : tvapppatch.tcl

09-27-2016, 09:41 AM
Here is tvapppatch.tcl v2.0, an alternative to the superpatch family of patchers.

It was written to read a separate patch file (tvapppatches.tcl), which makes it easier to update by hand (no diffs needed). Only the patch file needs to be edited to add new patches. The patch file uses the same array format as superpatch, to make things easy.

It can also be called from a script, by using the '-confirm no' option. You can point it to different tivoapp files and patchfiles, and specify a patch version to use (to patch a tivoapp with a different version than the running one). Note: it will only leave a backup of your tivoapp file around if you are patching the running tivoapp.

usage: tvapppatch.tcl [-help]|[-p <patchfile>][-t <tivoappfile>][-v <sw version>][-confirm yes|no][-remount yes|no][verbose yes|no]

By default, it will patch the running tivoapp, and look for the patch file to be in the same directory as tvapppatch.tcl.

The format of the tvapppatches.tcl file is pretty simple. You can have a different patch selector and array for each version of TiVo software. A patch selector and array looks like this:

if { [regexp {^9\.3\.2a-} $sw] } {set patcha "patch_9.3.2a"}
array set patch_9.3.2a {
0x0aa2d54 "14400026 10400026"
0x07329c0 "00008021 24100001"
0x05a86a0 "104000aa 100000aa"

Optionally, each patch array can have an associated array giving patch descriptions. Descriptions are only shown with the -verbose yes option:

if { [regexp {^9\.3\.2a-} $sw] } {set patchd "desc_9.3.2a"}
array set desc_9.3.2a {
0x0aa2d54 "30 second skip"
0x07329c0 "backdoors"
0x05a86a0 "encryption"

For release 1.8, Red_Dog added the ability to put descriptions in the patch line, thusly:

if { [regexp {^6\.3e-} $sw] } {set patcha "patch_6.3e"}
array set patch_6.3e {
0x0063d2ec "3c060001 38c60003 Replace Full with Zoom in 4:3 TV type"
0x00a6a030 "50530001 50930001 Single Press Aspect Ratio Change (1of2)"
0x00a69fdc "10600008 10000013 Single Press Aspect Ratio Change (2of2)"
0x00a6a134 "24072710 240709c4 Aspect ratio display time (2.5 sec)"

tvapppatch.tcl Version History:
1.1 Initial release
1.2 Added more flexible options, ability to specify version for patching, looks for tivoapppatches.tcl in the same directory in which tvapppatch.tcl resides
1.3 Added option to not remount /, a missing fconfigure (thanks for both, Jamie), improved logic for determining whether we're patching the running tivoapp.
1.4 Improved error reporting, general cleanup, fixed missing ".
1.5 Added verbose and help options, allow renaming of script, support for patch descriptions, more cleanup and error checking.
1.6 Added some help text, fixed a scope issue. (thx to dah31)
1.7 Made location check case insensitive (case must still match in patch and description arrays in tvapppatches.tcl)
1.8 Added one line patch entries (thx to Red_Dog)

tvapppatches.tcl Version History:
1.0 Supports TiVo Series 2 software 9.3.2 and 9.3.2a
1.1 Added support for patch descriptions
1.1a Added 6.2, 6.2a, and 11.0 patches (untested, from StanSimmons)
1.1b Changed all hex to lower case.
1.2 Example one line patch/comment
2.0 Removed pre-11.0m patches, added 11.0n.H1 and J1

This is released into the public domain.

The support thread is here (http://www.dealdatabase.com/forum/showthread.php?60303-tvapppatch-tcl-support).