Decrypt recordings on the HD-FOX T2

From hummy.tv Wiki
Revision as of 10:55, 18 August 2011 by Af123 (talk | contribs)
Jump to: navigation, search

On the HD[R]-Fox T2 all recordings (including SD) are encrypted by default. The encryption means they will only play on the box they were recorded on. On the HDR, encryption can be removed by copying the recording to an external drive. This can be a USB drive, or by installing the modified firmware, a virtual drive or networked share also work.

On the HD-Fox T2 however this feature does exist, and copied recordings remain encrypted.

Luckily the HD and HDR hardware is very similar (give or take a hard disk and tuner), and the HD can be persuaded to run the software for the HDR. This then allows recordings to be copied and decrypted.


Prerequisites: Modified firmware installed, telnet set up, humidify and squashfs-tools packages.

  • Firstly download the firmware for the HDR-Fox T2. This can be either the package from Humax, or the modified version.
  • Using FTP, or a network share copy the downloaded file (hdr_fox_t2_upgrade.hdf) over to the box, and place it in the /mod/ directory.
  • Telnet to the box.
  • Install humidify and squshfs tools ("opkg install humidify" and "opkg install squashfs-tools")
  • Extract the HDR's root filesystem into the /mod folder on your hard drive with the following commands:
cd /mod
humidify -x -S1 hdr_fox_t2_upgrade.hdf
unsquashfs -d HDRfs 1.hdfbin-1-000000.raw
  • Now we just need a script to set up remap a couple of key folders to the HDR filesystem, set up some folders how the HDR expects, kill the running HD execuatable and launch the HDR version:

Call the script bootHDRmode, and put it in /mod/sbin. Its contents should be:

 #!/bin/sh
  
 #Run this script to load the HDR ELF
 exec >/tmp/loadhdr.log 2>&1 #output errors to this file
 mount -t ext3 /dev/sda1 /mnt/hd1/
 mount -t ext3 /dev/sda1 /mnt/hd2/
 mount -t ext3 /dev/sda1 /mnt/hd3/
 mount -t ext3 /dev/sda1 /mnt/hd4/
 ln -s /media/drive1/Video/ /media/drive1/My\ Video    # link HD Video directory into "My Video" as HDR expects 
 ln -s /media/drive1/Audio/ /media/drive1/My\ Music    # link HD Audio directory into "My Music" as HDR expects 
  
 mount /mnt/hd2/mod/HDRfs/usr/ /usr/            # map HDR elf and key data over the root
 mount /mnt/hd2/mod/HDRfs/opt/ /opt/
  
 rm -f /tmp/.humaxtv.running
 touch /tmp/.humaxtv.restart
 killall humaxtv    #kill HD, will automatically restart but this time the HDR
  • Now whenever you need to switch to "HDR Mode" to decrypt some recordings, just telnet onto the box and type:
/mod/sbin/bootHDmode

WARNING If the box is recording anything, the recording will halt and may be corrupted. [TODO - make the script detect and warn].

Further enhancement

If you frequently want to switch to "HDR mode" to decrypt recordings, it would be nice to be able to do this from the TV without having to telnet on. The method will allow this. Basically run a script that "polls" for the existence of a named folder, and when it finds it, runns the "bootHDRmode" script.

Two scripts are required - one to launch the polling script at startup, and the polling script itself.

Place this script in /mod/etc/init.d called something like S98polling:

#!/bin/sh

case "$1" in
       start)
               /mod/sbin/polling &   # launch as new process
               ;;
       stop)
               killall polling 
               ;;
       *)
               exit 1
               ;;
esac

exit 0

The polling script looks like this, and lives in /mod/sbin/polling

#!/bin/sh

mkdir /media/drive1/settings
mkdir /media/drive1/settings/bootHDR

while [ 1 ]; do
       if [ -d /media/drive1/bootHDR ]; then
               mv /media/drive1/bootHDR /media/drive1/settings
               /mod/sbin/bootHDRmode
       fi
       sleep 11
done

This creates a folder called bootHDR on the root of the drive in a "settings" folder. To force the box to reboot in HDR mode, simply move this folder (using the "opt+" button on the remote) to the root of the drive. The script will detect this, move it back to settings for next time, and boot in HDR mode. Again check that no recordings are in progress when doing this!