From d4fd2ffdbc95e90d1a14ce1048870b99cdcd72c3 Mon Sep 17 00:00:00 2001 From: Mastho Date: Thu, 22 Jul 2021 19:36:31 +0200 Subject: [PATCH] Fix winutils check_debug API (#25) Now using the windows.system.registry object --- windows/utils/winutils.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/windows/utils/winutils.py b/windows/utils/winutils.py index 8ca42a5..b599ac5 100644 --- a/windows/utils/winutils.py +++ b/windows/utils/winutils.py @@ -199,15 +199,8 @@ def check_debug(): https://msdn.microsoft.com/en-us/library/windows/hardware/ff556253(v=vs.85).aspx#_______noumex______ """ - hkresult = HKEY() - cbsize = DWORD(1024) - bufferres = (c_char * cbsize.value)() - - winproxy.RegOpenKeyExA(HKEY_LOCAL_MACHINE, "System\\CurrentControlSet\\Control", 0, KEY_READ, byref(hkresult)) - winproxy.RegGetValueA(hkresult, None, "SystemStartOptions", RRF_RT_REG_SZ, None, byref(bufferres), byref(cbsize)) - winproxy.RegCloseKey(hkresult) - - control = bufferres[:] + options = windows.system.registry(r'HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control')['SystemStartOptions'] + control = options.value if "DEBUG" not in control: # print "[-] Enable debug boot!" # print "> bcdedit /debug on"