#NEWLINE# def run( self , args ) : #NEWLINE# #INDENT# regs = gxf . Registers ( ) #NEWLINE# memory = gxf . Memory ( ) #NEWLINE# tomark = args . mark [ : ] #NEWLINE# if args . mark_used : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# dis = gxf . disassemble_lines ( regs . get ( 'pc' ) ) . lines [ : 1 ] #NEWLINE# #UNINDENT# except gxf . GdbError : #NEWLINE# #INDENT# dis = ( ) #NEWLINE# #UNINDENT# for line in dis : #NEWLINE# #INDENT# for ( _ , t ) in line . tokens [ line . instidx : ] : #NEWLINE# #INDENT# tomark . append ( t ) #NEWLINE# tomark . extend ( regs . impact . get ( t , ( ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# for ( reg , val ) in regs . regs . items ( ) : #NEWLINE# #INDENT# if ( ( reg == 'eflags' ) or ( ( len ( reg ) == 2 ) and ( reg [ 1 ] == 's' ) ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if ( reg in tomark ) : #NEWLINE# #INDENT# ttype = Token . Name . Builtin #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( reg in ( 'rdi' , 'rsi' , 'rdx' , 'rcx' , 'r8' , 'r9' ) ) : #NEWLINE# #INDENT# ttype = Token . Text #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( reg in ( 'rip' , 'eip' , 'rbp' , 'esp' , 'rsp' , 'rax' , 'eax' ) ) : #NEWLINE# #INDENT# ttype = Token . Generic . Heading #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ttype = Token . Comment #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# print ( ( '%s%s' % ( Formattable ( ( ( ttype , ( '%-4s' % reg ) ) , ( Token . Comment , ': ' ) ) ) , memory . refchain ( val ) ) ) )