dlldiag/common/WindowsDebugger.py
def debugWithLoaderSnaps(self, architecture, executable, args=[], cwd=None):
		'''
		Enables loader snaps for the specified executable and runs it through the debugger
		'''
		
		# Attempt to enable loader snaps for the specified executable
		try:
			subprocess.run(
				[join(self._debuggers[architecture], 'gflags.exe'), '-i', basename(executable), '+sls'],
				stdout = subprocess.DEVNULL,
				stderr = subprocess.DEVNULL,
				check = True
			)
		except:
			raise RuntimeError('could not enable loader snaps. Please ensure you have sufficient privileges to perform this operation.')
		
		# Create a temporary directory to hold the log output from the debugger
		with tempfile.TemporaryDirectory() as tempDir:
			
			# Run the executable through the debugger and capture the output
			try:
				logFile = join(tempDir, 'log.txt')
				result = subprocess.run(
					[join(self._debuggers[architecture], 'cdb.exe'), '-logou', logFile, executable] + args,
					stdout = subprocess.PIPE,
					stderr = subprocess.PIPE,
					input = 'g\nq\n',
					universal_newlines = True,
					cwd = cwd
				)
				
				logData = FileIO.readFile(logFile, encoding='utf_16_le')
				setattr(result, 'log', logData)
				return result
				
			except Exception as e:
				raise e
				#raise RuntimeError('could not run the debugger. Please ensure you have sufficient privileges to perform this operation.')

		Enables loader snaps for the specified executable and runs it through the debugger
		
Enables loader snaps for the specified executable and runs it through the debugger
Enables loader snaps for the specified executable and runs it through the debugger
def debugWithLoaderSnaps(self, architecture, executable, args=[], cwd=None):
		try:
			subprocess.run(
				[join(self._debuggers[architecture], 'gflags.exe'), '-i', basename(executable), '+sls'],
				stdout = subprocess.DEVNULL,
				stderr = subprocess.DEVNULL,
				check = True
			)
		except:
			raise RuntimeError('could not enable loader snaps. Please ensure you have sufficient privileges to perform this operation.')
		with tempfile.TemporaryDirectory() as tempDir:
			try:
				logFile = join(tempDir, 'log.txt')
				result = subprocess.run(
					[join(self._debuggers[architecture], 'cdb.exe'), '-logou', logFile, executable] + args,
					stdout = subprocess.PIPE,
					stderr = subprocess.PIPE,
					input = 'g\nq\n',
					universal_newlines = True,
					cwd = cwd
				)
				logData = FileIO.readFile(logFile, encoding='utf_16_le')
				setattr(result, 'log', logData)
				return result
			except Exception as e:
				raise e
def debugWithLoaderSnaps ( self , architecture , executable , args = [ ] , cwd = None ) : try : subprocess . run ( [ join ( self . _debuggers [ architecture ] , 'gflags.exe' ) , '-i' , basename ( executable ) , '+sls' ] , stdout = subprocess . DEVNULL , stderr = subprocess . DEVNULL , check = True ) except : raise RuntimeError ( 'could not enable loader snaps. Please ensure you have sufficient privileges to perform this operation.' ) with tempfile . TemporaryDirectory ( ) as tempDir : try : logFile = join ( tempDir , 'log.txt' ) result = subprocess . run ( [ join ( self . _debuggers [ architecture ] , 'cdb.exe' ) , '-logou' , logFile , executable ] + args , stdout = subprocess . PIPE , stderr = subprocess . PIPE , input = 'g\nq\n' , universal_newlines = True , cwd = cwd ) logData = FileIO . readFile ( logFile , encoding = 'utf_16_le' ) setattr ( result , 'log' , logData ) return result except Exception as e : raise e
Enables loader snaps for the specified executable and runs it through the debugger
Enables loader snaps for the specified executable and runs it through the debugger
'''
		Enables loader snaps for the specified executable and runs it through the debugger
		''' # Attempt to enable loader snaps for the specified executable # Create a temporary directory to hold the log output from the debugger # Run the executable through the debugger and capture the output #raise RuntimeError('could not run the debugger. Please ensure you have sufficient privileges to perform this operation.')
self
architecture
executable
args
cwd