summaryrefslogtreecommitdiffstats
path: root/client/engine/Registry.lib
diff options
context:
space:
mode:
authorramon <ramongomez@us.es>2015-09-29 07:49:10 +0000
committerramon <ramongomez@us.es>2015-09-29 07:49:10 +0000
commit0e24b1658df3564c6f4239f268faff9769859139 (patch)
treef0f26da7935cc970be88b16b9614907964e8f025 /client/engine/Registry.lib
parent0476bb8eacb84e949e45d9e018cc2889bc0ef0d7 (diff)
Función {{{ogGetRegistryValue}}} devuelve todo el contenido de un valor binario del registro de Windows.
git-svn-id: https://opengnsys.es/svn/branches/version1.1@4687 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'client/engine/Registry.lib')
-rwxr-xr-xclient/engine/Registry.lib12
1 files changed, 10 insertions, 2 deletions
diff --git a/client/engine/Registry.lib b/client/engine/Registry.lib
index 12ef270e..49bd1583 100755
--- a/client/engine/Registry.lib
+++ b/client/engine/Registry.lib
@@ -255,6 +255,9 @@ echo "$FILE"
#@version 0.9 - Adaptación para OpenGNSys.
#@author Ramon Gomez, ETSII Universidad de Sevilla
#@date 2009-09-11
+#@version 1.1.0 - Soportar tipos BINARY (parejas hexadecimales separadas por espacio).
+#@author Ramon Gomez, ETSII Universidad de Sevilla
+#@date 2015-09-28
#*/ ##
function ogGetRegistryValue ()
{
@@ -274,7 +277,12 @@ FILE=$(ogGetHivePath "$1" "$2") || return $?
# Devolver el dato del valor de registro.
# /* (comentario Doxygen)
-chntpw "$FILE" << EOT 2> /dev/null | awk '/> Value/ {getline;print $0;}'
+chntpw "$FILE" << EOT 2> /dev/null | awk '^/> Value/ {if (index($0, "REG_BINARY") > 0)
+ {data=""}
+ else
+ {getline; data=$0;} }
+ /^:[0-9A-F]+ / {data=data""substr($0, 9, 48);}
+ END {print data;}'
cd ${3%\\*}
cat ${3##*\\}
q
@@ -413,7 +421,7 @@ q
EOT
if [ -n "$(chntpw "$FILE" < $tmpfile 2> /dev/null | grep "BINARY.*<${3##*\\}>")" ]; then
# Procesar tipo binario (incluir nº de bytes y líneas de 16 parejas hexadecimales).
- [[ "$4 " =~ ^([0-9A-Z]{2} )*$ ]] || ogRaiseError $OG_ERR_FORMAT "$4" || return $?
+ [[ "$4 " =~ ^([0-9A-F]{2} )*$ ]] || ogRaiseError $OG_ERR_FORMAT "\"$4\"" || return $?
let n=${#4}+1
cat << EOT >$tmpfile
cd ${3%\\*}