<s> import idaapi <EOL> def dump_meminfo ( L ) : <EOL> for ( startEA , endEA , name , sclass , sbase , bitness , perm ) in L : <EOL> print "<STR_LIT>" % ( startEA , endEA , name , sclass , sbase , bitness , perm ) <EOL> def test_getmeminfo ( ) : <EOL> L = idaapi . dbg_get_memory_info ( ) <EOL> dump_meminfo ( L ) <EOL> def test_getregs ( ) : <EOL> L = idaapi . dbg_get_registers ( ) <EOL> for ( name , flags , cls , dtype , bit_strings , bit_strings_default_mask ) in L : <EOL> print "<STR_LIT>" % ( name , flags , cls , dtype , bit_strings_default_mask ) <EOL> if bit_strings : <EOL> for s in bit_strings : <EOL> print "<STR_LIT>" % s <EOL> def test_manual_regions ( ) : <EOL> L = idaapi . get_manual_regions ( ) <EOL> if not L : <EOL> print "<STR_LIT>" <EOL> else : <EOL> dump_meminfo ( L ) <EOL> def test_readwrite ( ) : <EOL> ea = cpu . Eip <EOL> buf = idaapi . dbg_read_memory ( ea , <NUM_LIT:5> ) <EOL> print "<STR_LIT>" , [ hex ( ord ( x ) ) for x in buf ] <EOL> idaapi . dbg_write_memory ( ea , buf ) <EOL> test_manual_regions ( ) <EOL> if idaapi . dbg_can_query ( ) : <EOL> print "<STR_LIT>" % ( idaapi . dbg_get_thread_sreg_base ( idc . GetCurrentThreadId ( ) , cpu . fs ) ) <EOL> test_getmeminfo ( ) <EOL> test_getregs ( ) <EOL> test_readwrite ( ) <EOL> else : <EOL> print "<STR_LIT>" </s>
