Proposed method of auto-decryption on HDR-2000T

Even newer version. This one has a new feature that forces a DLNA reindex by simulating keyboard commands over ip. This is the new code:

Code:
# IP commands are used to simulate remote. Folder is created. File moved into it and then out again. Folder is deleted.

flag=0

for i in  "57" "3d" "56" "56" "56" "56" "56" "3d" "3b" "54" "58" "58" "58" "58" "22" "54" "3b" "54" "54" "54" "58" "58" "55" "20" "55" "58" "55" "3b" "54" "54" "54" "58" "20" "58" "3b" "58" "52" "58" "57"
do

cmd=`echo $i | xxd -p | sed 's/..$//'`
cmd=`echo '686d78726100000072637500000000003030'$cmd'00000000f410783a01000000'`
echo $cmd | xxd -r -p > /dev/udp/$HOST/22558

    if [ $i == "3d" ] && [ $flag == 0 ]; then
        sleep 10
        flag=1
    fi

    if  [ $i == "20" ]; then
        sleep 4
    fi
sleep 0.2
done

I am grateful for the info in this thread.
 

Attachments

  • 3DC-v5.zip
    584.7 KB · Views: 22
Hi Wiredcharlie. I'm not exactly sure what your 3DC-v5 is supposed to do. My mac is on High Sierra. Your program opens but nothing seems to happen, however if i point the cursor on the topbar To click 3DC or file or edit, I just get a spinning rainbow wheel. Nothing else happens.

So I guess I'm asking- Am I right in thinking that 3DC is a program for removing the encryption on HD recordings from humax2000t that have been put onto an external usb hard drive using a macbook on High Sierra? I'm not overly computer literate so an "Idiot's Guide" would be appreciated. How's it supposed to work? Many thanks. Cris.
 
Hi Wiredcharlie. I'm not exactly sure what your 3DC-v5 is supposed to do. My mac is on High Sierra. Your program opens but nothing seems to happen, however if i point the cursor on the topbar To click 3DC or file or edit, I just get a spinning rainbow wheel. Nothing else happens.

So I guess I'm asking- Am I right in thinking that 3DC is a program for removing the encryption on HD recordings from humax2000t that have been put onto an external usb hard drive using a macbook on High Sierra? I'm not overly computer literate so an "Idiot's Guide" would be appreciated. How's it supposed to work? Many thanks. Cris.

It removes the encryption flag on all recordings so that you can view them over your network using a UPNP/DNLA client like VLC.

Unzip the app. Right click on it and select Open. After a couple of minutes a window should pop up to show what its done.
 
Am I right in thinking that 3DC is a program for removing the encryption on HD recordings from humax2000t
To amplify the above, it will not decrypt the recordings by itself - instead performing the same function as Foxy would for HDR-FOX, HD-FOX, and FOXSAT-HDR. Once "Foxy'd", HiDef recordings behave the same as StDef recordings.
 
WiredCharlie: Just stumbled across this thread, and if I can get this to work, it will be a godsend, but so far - no joy! I can access my Humax by using gFTP on my Linux machine with no problems, so I know the FTP server is correctly configured.

Running the v5 script above from my Mac (High Sierra 10.13.6) gives a "Failed to connect to Humax" error, though I can ping the Humax ip address without problems. I also tried running the script from my Linux machine (Slackware current, 64-bit). This produces an instantaneous:

Code:
~./3dc.sh
rm: cannot remove '.Temp': No such file or directory
Humax: 192.168.0.51\n\nNothing to do!

Any suggestions gratefully received!

Cheers,

--
Pete
 
Managed to get it to work (eventually!) by adding the ip address of my Humax to line 7 of 3dc.sh (HOST="xxx.xxx.xxx.xxx"). This is odd, because the error message I was getting implied that it had successfully found the ip address!

It does leave an empty folder on the Humax, though: "."

It won't work under Linux because the associated file "ftp" is not recognised as a valid binary. Perhaps if you have the source code, it might be possible to re-compile it for Linux?

BTW, under Linux and VLC-3.0.6, if you follow the directions to stream the program, but right click on it instead of left clicking, and then select "information", it gives you the required media information to copy and paste into wget. This option doesn't seem to be available in the Mac version. Retrieving the file using wget is much quicker than unlocking the file with Foxy (or similar) and then transferring it to a portable drive of some kind.

At the moment, its all a bit unwieldy, as I have to use a Mac to "unlock" the files on the Humax, and then Linux to transfer them to my media drive (and for editing). It would be much easier if I could get it all to work on Linux...
 
You do not need to use a Foxy-type process for StDef recordings. The point is to access HiDef recordings, which require unlocking even before retrieving with wget.

Which is exactly what I'm trying to do! I've been downloading HiDef for years using the "long-hand" method of 1) Copy hmt files to PC 2) Edit with Okteta 3) copy back to Humax 4) Copy to external HD 5) transfer to PC to edit out breaks, etc. However this is very labour intensive, and copying to an external HD takes forever. I tend to leave it running overnight!

Using WiredCharlies script completely automates the editing of the htm files (Great!), and copying over the network takes a minute or two at most compared to hours previously. But it would be nice if I could get it all to run on one machine, rather than have to split the task over two!
 
Well, I can only write about my experiences! But transferring stuff to a USB drive seems to take forever. I've tried VFAT, NTFS and Ext-3 (Linux native) filesystems on the USB drive. Ext-3 seems to be marginally quickest, but still painfully slow. With wget, even an HD 2 hr film takes under 2 mins.

But this isn't helping me discover what that "ftp" binary actually does in WiredCharlie's package. Ideally I would like to get his script running under Linux, but until I can work out precisely what that binary is doing - or locate the source code for it - I'm a bit stuck!
 
It seems you are completely misunderstanding what I write (possibly because you are blind to what exactly you yourself have written - a common fault we all suffer from), so I hesitate to comment further, but...

It seems obvious to me that a reference to "ftp" is exactly that. All you would need to do is replace it with an appropriate call for Linux. In any case (not having looked into it), you could always write your own Bash script (or whatever command interpreter you use) to carry out the same sequence of steps as described in my link in post 67.
 
Last edited:
Actually, I think you are right! I'm not a mac expert - Linux is my home territory, and while I make no claim to be a programmer, I can read and understand bash scripts and "C". What has had me fooled is that the mac - unlike Linux - does not appear to have an "ftp" command built in! It therefore has to be provided by the binary included in WiredCharlie's package!

This had me fooled because I know MacOS is essentially BSD Unix, with a flash graphical interface bolted on. I therefore assumed (wrongly!) that it would also have all the standard Unix networking tools built in. It appears it doesn't!

I'm currently working through the 3dc.sh script modifying it to use Linux' built in ftp command. I've got a slight problem at the moment because I've already run WiredCharlie's program from the mac and unlocked all my HD recordings. I'm just making a test recording at the moment. Once that is complete, I can finish debugging the script for Linux. Once I've got it working (assuming I do!) I'll post it up here.

Getting there slowly......! ;)
 
Well, here's a turn up for the book! I spent hours trying to get WiredCharlie's script to run under Linux, and kept running into all sorts of issues. It seems that the ftp binary in the Mac package has a different syntax - and works in a different way - to the Linux version. For example, the Humax ftp server doesn't seem to like passive mode, so simple commands like "ls" don't work. The Mac binary must have a workaround for this!

Anyway, whilst researching this, I stumbled across a perl script, written some 3 years ago, which does everything that WiredCharlie's script does - and more! For example, it won't modify files of a recording in progress, which could cause issues.

I've tried it under Slackware64-current (the development, but very stable, branch) and it works like a charm! I can't post links for some reason, but search github for GrahamCobb/humax-unenc-ftp.

I've no idea if it would work on the Mac or Windows, but it works very well on Linux.

Its worth having a look in the script, because there are a few extra commands not included in the documentation, for example there is a "dry-run" option.
 
Yeah, I've actually been a forum member for some time, but not made many posts. That's life! ;)

Two things that WiredCharlie's script does do that the perl script doesn't: 1) The perl script doesn't auto detect the ip address of the humax - but that didn't work for me for some reason anyway! 2) The per script doesn't force a re-indexing on the humax, so you either have to put the vdr in and out of standby, or figure out how to integrate that function into the perl script.

Looks like I'm going to need a perl primer..... :whistling:
 
Nobody responded to it at the time, but there was this post:

Hi guys

I originally posted this on the T2 thread but is also relavent to the 2000T

Made an observation yesterday. I went through my T2 drive and foxy'd every HD recording .hmt file.
I then moved a recording to a different folder to force the re-indexing of it. Streamed perfectly to my lappy, and to my 2000T.
Buy accident I forgot to move another video to a different folder to re-index it before playing it. It was visible in uPnP inspector and streamed straight away.
I tried streaming some of the other foxy'd but not moved recordings and they all stream straight away.
So it would appear that you only need to move one file to cause the whole lot to be re-indexed. That saved a lot of time. Foxy a batch, move one file on the T2 and all will be re-indexed.
This would indicate that the box will re-index all files every time any form of file operation, performed from the remote control (Move/Copy/Delete) etc. is carried out.
Has anyone else observed this behaviour?
 
I did see that, but I've since been more involved in getting anything to work under Linux! Now that I have a (partial) solution, I may investigate this as an alternative to WiredCharlie's method. Depends which is easier under perl! It will also have to wait a few days, as I have other things that now need attending to have have been neglected whilst I batter my brains with this one...!
 
Just a quick update: I was wrong when I said that VLC on the Mac didm't seem able to display the media ID (necessary to retrieve the unencrypted video with wget). It does! At least version 3.0.6 does. Pressing "cmd i" brings up the media information page with all sorts of information, including the required media ID (at the bottom of the box) which can then be copied into wget. No need for the "upnp inspector" referred to elsewhere, and Avidemux can be used to re-encode the LATM audio used to ordinary aac, for those who have problems with the audio.
 
Last edited:
Sorry for not paying attention! I stumbled across my own thread on an internet search for something else! It looks like a recap may be useful. On a Mac if you right click on an app you can "Show Package Contents". 3DC.app is an Applescript app and this is the Applescript:
Code:
set scriptpath to POSIX path of (path to me as text) & "/Contents/Resources/"

set my_icon to (path to me as text) & "Contents:Resources:applet.icns"

set output to do shell script scriptpath & "3dc.sh"
display dialog output with title "Humax Encryption Flag Reset" buttons {"OK"} with icon file my_icon


error number -128
All that does is to run a shell script that does the work. (Also within the app is the ftp binary that apple removed from its OS because of security concerns around the FTP protocol).

This is the shell script,
Code:
#!/bin/sh



GetHOST()     #Search ARP table for a Humax MAC Address
{
HOST=""

ArpRes=`arp -a`

if [ "$HOST" == "" ]; then
    HOST=`echo "$ArpRes" | grep '00:03:78' | cut -d "(" -f2 | cut -d ")" -f1`
fi

if [ "$HOST" == "" ]; then
    HOST=`echo "$ArpRes" | grep '08:eb:74' | cut -d "(" -f2 | cut -d ")" -f1`
fi

if [ "$HOST" == "" ]; then
    HOST=`echo "$ArpRes" | grep '28:32:c5' | cut -d "(" -f2 | cut -d ")" -f1`
fi

if [ "$HOST" == "" ]; then
    HOST=`echo "$ArpRes" | grep '4c:d0:8a' | cut -d "(" -f2 | cut -d ")" -f1`
fi

if [ "$HOST" == "" ]; then
    HOST=`echo "$ArpRes" | grep '6c:b5:6b' | cut -d "(" -f2 | cut -d ")" -f1`
fi

if [ "$HOST" == "" ]; then
    HOST=`echo "$ArpRes" | grep '94:09:37' | cut -d "(" -f2 | cut -d ")" -f1`
fi

if [ "$HOST" == "" ]; then
    HOST=`echo "$ArpRes" | grep 'cc:4e:ec' | cut -d "(" -f2 | cut -d ")" -f1`
fi

if [ "$HOST" == "" ]; then
    HOST=`echo "$ArpRes" | grep 'dc:d3:21' | cut -d "(" -f2 | cut -d ")" -f1`
fi

}


doFTP()

{
local file
local list
local lines

list="$($(dirname "$0")/ftp -n $HOST 2>&1 <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
cd "$1"
ls
END_SCRIPT
)"

#echo "$list"
#echo
#get number of files/directories
lines=`echo "$list" | sed -n '$='`
lines=$(expr $lines + 1)

myloop "$lines" "$list" "$1"

}

myloop()
{

local f
local type
local i
local path

#   lines $1
#   list  $2
#   file (path)  $3

#echo lines: $1
#echo list: "$2"
#echo file: "$3"

i=2
while [ $i != $1 ]
do

#select individual file line from list
f=`echo "$2" | sed -n "${i}p"`

#echo "$f"

#directory or file?
type=`echo "$f" | cut -c 1`
#echo $type
#extract file/directory name

f=`echo "$f" | sed 's/.*://' | cut -c 4-`


    if [ "$type" = "d" ]; then
        
        if [ "$f" != "." ]; then
            if [ "$f" != ".." ]; then
            
            #echo path is "$3/$f"


            doFTP "$3/$f"

            fi
        fi
    else     
        # only want hmt files   
    
        if [[ ( "$f" == *.hmt ) ]]; then


            #echo     "$3/$f"

            download "$3" "$f"
        fi

    fi

i=`expr $i + 1`
done
}



download()
{

cd "$HOME/Desktop"
mkdir -p .Temp
#open .Temp
cd .Temp



# download hmt file
list="$($(dirname "$0")/ftp -n $HOST 2>&1 <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
binary
cd "$1"
get "$2"
END_SCRIPT
)"


prog=`echo "$2" | sed 's/.\{4\}$//'`
#echo Found: "$prog"
found="$found\n$prog"


if [ "${prog: -1}" != "D" ]; then

# do the foxy trick  (3DC is 988 as decimal)
replaceByte "$2" 988 04



# send the hmt file back to the Humax
list="$($(dirname "$0")/ftp -n $HOST 2>&1 <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
binary
cd "$1"
put "$2"
rename "${prog}.hmt" "${prog}D.hmt"
rename "${prog}.ts" "${prog}D.ts"
rename "${prog}.thm" "${prog}D.thm"
rename "${prog}.nts" "${prog}D.nts"
END_SCRIPT
)"

count=$((count+1))
#echo Done:   "$1/$2"
done="$done\n$prog"

fi

cd ..
}

replaceByte()
{
# param 1: file
# param 2: offset
# param 3: value

    printf "$(printf '\\x%02X' $3)" | dd of="$1" bs=1 seek=$2 count=1 conv=notrunc &> /dev/null
}



# Find IP of Humax from partial MAC Address

GetHOST


if [ "$HOST" == "" ] # Humax did not show up in ARP cache so ping entire subnet

then

subnet=`arp -a | head -1 | cut -d "(" -f2 | cut -d ")" -f1 | cut -d . -f 1-3`

# echo Humax not in ARP Table so ping entire subnet: $subnet

for ((i=1;i<=255;i+=1)); do
#echo "Pinging $subnet.$i"
ping -c 1 -q $subnet.$i  &> /dev/null &
sleep 0.05
done

fi

GetHOST


USER='humaxftp'
PASSWD='0000'

if ping -c 1 $HOST &> /dev/null
 then

    #echo Connect: $HOST
    
    output="Humax: $HOST"
    count=0

    doFTP "."

    # clean up
    cd "$HOME/Desktop"
    rm -r .Temp


    if [ $count == 0 ]; then
        output="$output\n\nNothing to do!"
    else   
    
    
    
##############       Force DLNA rescan        #############################################################################

# IP commands are used to simulate remote. Folder is created. File moved into it and then out again. Folder is deleted.

flag=0

for i in  "57" "3d" "56" "56" "56" "56" "56" "3d" "3b" "54" "58" "58" "58" "58" "22" "54" "3b" "54" "54" "54" "58" "58" "55" "20" "55" "58" "55" "3b" "54" "54" "54" "58" "20" "58" "3b" "58" "52" "58" "57"
do

cmd=`echo $i | xxd -p | sed 's/..$//'`
cmd=`echo '686d78726100000072637500000000003030'$cmd'00000000f410783a01000000'`
echo $cmd | xxd -r -p > /dev/udp/$HOST/22558

    if [ $i == "3d" ] && [ $flag == 0 ]; then
        sleep 10
        flag=1
    fi

    if  [ $i == "20" ]; then
        sleep 4
    fi
sleep 0.2
done
    
############################################################################################################

    
        if [ $count == 1 ]; then
            output="$output\n\nEncryption flag for the following programme has been reset:\n$done"
        else
            output="$output\n\nEncryption flags for the following programmes have been reset:\n$done"
        fi
            output="$output\n\nChanges should now be reflected on DLNA Server."       
    fi   
    
    
    
    
 else
  output="$output\n\nFailed to connect to Humax $HOST\n\nMake sure your box is turned on and that FTP Server is set to on."
fi



echo $output |sed 's/\_/\ /g'

I wasn't aware of the Graham Cobb work. There are some differences between Mac Shell and Linux shell, but a good solution for Linux may be to use the ARP table discovery part of my script, call humax-unenc-ftp from Cobb then Force DLNA rescan part of my script. It would be pretty cool if someone could make this work on Android!
 
Back
Top