$type = 1;
$data = _parse_quoted_string ($1);
return undef unless defined $data;
+ $data .= "\0"; # Value strings are implicitly ASCIIZ.
$data = encode ($encoding, $data);
} elsif (m/^str\(([[:xdigit:]]+)\):(".*")$/) {
$type = hex ($1);
$data = _parse_quoted_string ($2);
return undef unless defined $data;
+ $data .= "\0"; # Value strings are implicitly ASCIIZ.
$data = encode ($encoding, $data);
} elsif (m/^(".*")$/) {
$type = 1;
$data = _parse_quoted_string ($1);
return undef unless defined $data;
+ $data .= "\0"; # Value strings are implicitly ASCIIZ.
$data = encode ($encoding, $data);
} else {
return undef;
[\C]
"Key1"=hex(2):48,00,65,00,6c,00,6c,00,6f,00
-"Key2"=hex(2):48,00,65,00,6c,00,6c,00,6f,00
+"Key2"=hex(2):48,00,65,00,6c,00,6c,00,6f,00,00,00
"Key3"=hex(3):48,00,65,00,6c,00,6c,00,6f,00,48,00,65,00,6c,00,6c,00,6f,00
"Key4"=dword:ff123456
$expected = '[\]
[\A]
-@=hex(1):48,00,65,00,6c,00,6c,00,6f,00
+@=hex(1):48,00,65,00,6c,00,6c,00,6f,00,00,00
[\C]
"Key1"=hex(2):48,00,65,00,6c,00,6c,00,6f,00
-"Key2"=hex(2):48,00,65,00,6c,00,6c,00,6f,00
+"Key2"=hex(2):48,00,65,00,6c,00,6c,00,6f,00,00,00
"Key3"=hex(3):48,00,65,00,6c,00,6c,00,6f,00,48,00,65,00,6c,00,6c,00,6f,00
"Key4"=dword:ff123456