Add {system encryptionkey}

This commit is contained in:
HummyPkg 2018-04-18 18:04:08 +01:00
parent 89e61f669b
commit 9fdf3017f0
3 changed files with 16 additions and 0 deletions

View File

@ -17,6 +17,7 @@ Humax [system model] Fox T2 ([system hostname])
Custom firmware version: $modver Custom firmware version: $modver
Web interface version: [system pkgver webif] Web interface version: [system pkgver webif]
Serial Number: [system serialno] Serial Number: [system serialno]
Encryption Key: [system encryptionkey]
Last Boot Reason: [system lastbootreason] Last Boot Reason: [system lastbootreason]
" "

View File

@ -19,6 +19,9 @@ puts "<br>Humax Version: $fhtcpversion (kernel $kernelver)"
puts "<br>Loader Version: [system loaderver]" puts "<br>Loader Version: [system loaderver]"
puts "<br>System ID: [system systemid]" puts "<br>System ID: [system systemid]"
puts "<br>Serial Number: [system serialno]" puts "<br>Serial Number: [system serialno]"
if {$mws::pagetag eq "Diagnostics"} {
puts "<br>Encryption Key: [system encryptionkey]"
}
puts "<br>Last Boot Reason: [system lastbootreason]" puts "<br>Last Boot Reason: [system lastbootreason]"
puts "</span>" puts "</span>"

View File

@ -144,6 +144,18 @@ proc {system serialno} {} {{serial ""}} {
return $serial return $serial
} }
proc {system encryptionkey} {} {{key ""}} {
if {$key ne ""} { return $key }
set fd [open /dev/mtd3 r]
$fd seek 0xc8c00
set bytes [$fd read 6]
$fd seek 0xcb800
append bytes [$fd read 10]
$fd close
binary scan $bytes H* key
return $key
}
proc {system loaderver} {} {{ver ""}} { proc {system loaderver} {} {{ver ""}} {
if {$ver ne ""} { return $ver } if {$ver ne ""} { return $ver }
set fd [open /dev/mtd3 r] set fd [open /dev/mtd3 r]