diff --git a/examples/reg.py b/examples/reg.py index d3e03d911..aae1d5402 100755 --- a/examples/reg.py +++ b/examples/reg.py @@ -33,6 +33,7 @@ import logging import sys import time +import binascii from struct import unpack from impacket import version @@ -283,6 +284,10 @@ def add(self, dce, keyName): rrp.REG_QWORD, rrp.REG_QWORD_LITTLE_ENDIAN ): valueData = int(self.__options.vd) + elif dwType == rrp.REG_BINARY: + bin_value_len = len(self.__options.vd) + bin_value_len += (bin_value_len & 1) + valueData = binascii.a2b_hex(self.__options.vd.ljust(bin_value_len, '0')) else: valueData = self.__options.vd