mirror of https://github.com/n1nj4sec/pupy.git
reg: Fix QDWORD
This commit is contained in:
parent
1141583c00
commit
bd8da73684
|
@ -8,7 +8,7 @@ from pupylib.PupyOutput import Color, List, Table, MultiPart, TruncateToTerm
|
||||||
TYPES = (
|
TYPES = (
|
||||||
'NONE', 'SZ', 'EXPAND_SZ', 'BINARY', 'LE32', 'BE32',
|
'NONE', 'SZ', 'EXPAND_SZ', 'BINARY', 'LE32', 'BE32',
|
||||||
'LINK', 'MULTI_SZ', 'RESOURCE', 'RESOURCE_DESCRIPTOR',
|
'LINK', 'MULTI_SZ', 'RESOURCE', 'RESOURCE_DESCRIPTOR',
|
||||||
'RESOURCE_REQUIREMENTS_LIST'
|
'RESOURCE_REQUIREMENTS_LIST', 'LE64'
|
||||||
)
|
)
|
||||||
|
|
||||||
TYPE_COLORS = {
|
TYPE_COLORS = {
|
||||||
|
|
|
@ -8,6 +8,7 @@ __all__ = [
|
||||||
import _winreg
|
import _winreg
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
import struct
|
||||||
|
|
||||||
WELL_KNOWN_KEYS = {
|
WELL_KNOWN_KEYS = {
|
||||||
'HKEY_LOCAL_MACHINE': _winreg.HKEY_LOCAL_MACHINE,
|
'HKEY_LOCAL_MACHINE': _winreg.HKEY_LOCAL_MACHINE,
|
||||||
|
@ -30,6 +31,9 @@ WELL_KNOWN_TYPES = {
|
||||||
unicode: _winreg.REG_SZ,
|
unicode: _winreg.REG_SZ,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if not hasattr(_winreg, 'REG_QWORD'):
|
||||||
|
setattr(_winreg, 'REG_QWORD', 11)
|
||||||
|
|
||||||
WELL_KNOWN_TYPES_NAMES = {
|
WELL_KNOWN_TYPES_NAMES = {
|
||||||
_winreg.REG_DWORD: 'DWORD',
|
_winreg.REG_DWORD: 'DWORD',
|
||||||
_winreg.REG_QWORD: 'LE64',
|
_winreg.REG_QWORD: 'LE64',
|
||||||
|
@ -94,6 +98,8 @@ class Value(object):
|
||||||
|
|
||||||
if type(value) == str and ktype in (_winreg.REG_SZ, _winreg.REG_MULTI_SZ):
|
if type(value) == str and ktype in (_winreg.REG_SZ, _winreg.REG_MULTI_SZ):
|
||||||
value = value.decode(sys.getfilesystemencoding())
|
value = value.decode(sys.getfilesystemencoding())
|
||||||
|
elif type(value) == str and ktype == _winreg.REG_QWORD:
|
||||||
|
value, = struct.unpack('<q', value)
|
||||||
|
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
self.name = name
|
self.name = name
|
||||||
|
|
Loading…
Reference in New Issue