<s> import idc <EOL> import idaapi <EOL> import binwalk <EOL> class binwalk_t ( idaapi . plugin_t ) : <EOL> flags = <NUM_LIT:0> <EOL> comment = "<STR_LIT>" <EOL> help = "<STR_LIT>" <EOL> wanted_name = "<STR_LIT>" <EOL> wanted_hotkey = "<STR_LIT>" <EOL> def init ( self ) : <EOL> self . menu_context_1 = idaapi . add_menu_item ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <NUM_LIT:0> , self . opcode_scan , ( None , ) ) <EOL> self . menu_context_2 = idaapi . add_menu_item ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <NUM_LIT:0> , self . signature_scan , ( None , ) ) <EOL> return idaapi . PLUGIN_KEEP <EOL> def term ( self ) : <EOL> idaapi . del_menu_item ( self . menu_context_1 ) <EOL> idaapi . del_menu_item ( self . menu_context_2 ) <EOL> return None <EOL> def run ( self , arg ) : <EOL> return None <EOL> def signature_scan ( self , arg ) : <EOL> binwalk . scan ( idc . GetIdbPath ( ) , signature = True ) <EOL> def opcode_scan ( self , arg ) : <EOL> binwalk . scan ( idc . GetIdbPath ( ) , opcode = True ) <EOL> def PLUGIN_ENTRY ( ) : <EOL> return binwalk_t ( ) </s>
