def __init__(self, list=None):
     if list:
         self.list = list
     else:
         self.list = []
     Choose.__init__(self, self.list, "ScriptBox", 1)
     self.width = 50
Beispiel #2
0
 def __init__(self, list=None):
     if list:
         self.list = list
     else:
         self.list = []
     Choose.__init__(self, self.list, "ScriptBox", 1)
     self.width = 50
 def __init__(self, title, all_funcs, flags=0):
     Choose.__init__(self,
                      title,
                      [["Address", 12 | Choose.CHCOL_DEC],
                       ["Function Name", 20 | Choose.CHCOL_PLAIN]],
                      embedded=True, width=80, height=6, flags=flags
                      )
     self.all_funcs = all_funcs
     self.PopulateItems()
 def __init__(self, manager, flags=0):
     Choose.__init__(self,
                      "apps",
                      [
                          ["Connection Identifier",
                           50 | Choose.CHCOL_PLAIN]],
                      embedded=True, width=80, height=6, flags=flags)
     self.manager = manager
     self.UpdateItems()
Beispiel #5
0
    def __init__(self, title, nb=5, flags=0):
        Choose.__init__(self,
                        title,
                        [["Action", 30 | Choose.CHCOL_PLAIN]],
                        embedded=True, height=10, flags=flags)
        # embedded=True, width=30, height=20, flags=flags)

        self.n = 0
        self.items = []
        self.icon = 0
 def __init__(self, title, all_funcs, flags=0):
     Choose.__init__(self,
                     title, [["Address", 12 | Choose.CHCOL_DEC],
                             ["Function Name", 20 | Choose.CHCOL_PLAIN]],
                     embedded=True,
                     width=80,
                     height=6,
                     flags=flags)
     self.all_funcs = all_funcs
     self.PopulateItems()
 def __init__(self, manager, flags=0):
     Choose.__init__(self,
                     "apps",
                     [["Connection Identifier", 50 | Choose.CHCOL_PLAIN]],
                     embedded=True,
                     width=80,
                     height=6,
                     flags=flags)
     self.manager = manager
     self.UpdateItems()
Beispiel #8
0
 def __init__(self, title, analyser, nb=5):
     sizes = self._get_sizes(analyser)
     head = [
         ["Address", sizes["Address"]],
         ["Name", sizes["Name"]],
         ["Service", sizes["Service"]],
         ["Place", sizes["Place"]],
         ["GUID", sizes["GUID"]],
     ]
     Choose.__init__(
         self, title, head, flags=0, width=None, height=None, embedded=False
     )
     self.n = 0
     self.items = self._get_lines(analyser)
     self.selcount = 0
     self.modal = False
     self.popup_names = list()
Beispiel #9
0
 def __init__(self, title, dep_json, nb=5):
     sizes = self._get_sizes(dep_json)
     Choose.__init__(
         self,
         title,
         [['GUID', sizes['GUID']], ['Name', sizes['Name']],
          ['Module', sizes['Module']], ['Service', sizes['Service']]],
         flags=0,
         width=None,
         height=None,
         embedded=False)
     self.n = 0
     self.items = self._get_lines(dep_json)
     self.selcount = 0
     self.modal = False
     self.popup_names = []
     self.dep_json = dep_json
Beispiel #10
0
def import_export():
	ch = Choose([], "Dump/Restore pseudocode details", 1)
	ch.list = ["Import", "Export"]
	ch.width = 25
	ch.deflt = 1

	c = ch.choose()
	if c > 0:
		pkl_file = pickle_file(c)
		if not pkl_file:
			print "error with file choice"
			return
		if c == 1:
			import_pseudocomments(pkl_file)
		elif c == 2:
			export_pseudocomments(pkl_file)
	else:
		print "moep"
Beispiel #11
0
 def __init__(self, title, analyser, nb=5):
     sizes = self._get_sizes(analyser)
     Choose.__init__(self,
                     title, [
                         ['Address', sizes['Address']],
                         ['Name', sizes['Name']],
                         ['Service', sizes['Service']],
                         ['Place', sizes['Place']],
                         ['GUID', sizes['GUID']],
                     ],
                     flags=0,
                     width=None,
                     height=None,
                     embedded=False)
     self.n = 0
     self.items = self._get_lines(analyser)
     self.selcount = 0
     self.modal = False
     self.popup_names = []
Beispiel #12
0
    def __init__(self, items, call_addr_list, title):
        Choose.__init__(self,
                        title,
                        [["Call Address", 10], ["Call Argument", 20],
                         ["Caller function", 20], ["Function offset", 10],
                         ["Segment", 10], ["Stack pointer", 10]],
                        flags=Choose.CH_RESTORE
                        | (Choose.CH_CAN_INS
                           | Choose.CH_CAN_DEL
                           | Choose.CH_CAN_EDIT
                           | Choose.CH_CAN_REFRESH),
                        embedded=None,
                        width=None,
                        height=None)

        self.items = items
        self.call_addr_list = call_addr_list
        self.icon = 5
        self.selcount = 0
        self.modal = False
Beispiel #13
0
 def __init__(self, title, dep_json, nb=5):
     sizes = self._get_sizes(dep_json)
     Choose.__init__(
         self,
         title,
         [
             ["GUID", sizes["GUID"]],
             ["Name", sizes["Name"]],
             ["Module", sizes["Module"]],
             ["Service", sizes["Service"]],
         ],
         flags=0,
         width=None,
         height=None,
         embedded=False,
     )
     self.n = 0
     self.items = self._get_lines(dep_json)
     self.selcount = 0
     self.modal = False
     self.popup_names = list()
     self.dep_json = dep_json
 def __init__(self,
              title,
              items,
              flags=0,
              width=None,
              height=None,
              embedded=False,
              modal=False):
     Choose.__init__(self,
                     title,
                     [["Address", 5], ["Function", 5], ["Device", 15],
                      ["Method", 15], ["Access", 30], ["C define", 100]],
                     flags=flags,
                     width=width,
                     height=height,
                     embedded=embedded)
     self.n = 0
     self.items = items
     self.icon = 5
     self.selcount = 0
     self.modal = modal
     self.popup_names = ["Insert", "Delete", "Refresh"]
Beispiel #15
0
def import_export():
    ch = Choose([], "Dump/Restore pseudocode details", 1)
    ch.list = ["Import", "Export"]
    ch.width = 25
    ch.deflt = 1

    c = ch.choose()
    if c > 0:
        pkl_file = pickle_file(c)
        if not pkl_file:
            print "error with file choice"
            return
        if c == 1:
            import_pseudocomments(pkl_file)
        elif c == 2:
            export_pseudocomments(pkl_file)
    else:
        print "moep"
Beispiel #16
0
 def __init__(self, list, title):
     Choose.__init__(self, list, title)
     self.width = 250
Beispiel #17
0
#---------------------------------------------------------------------
# Chooser test
#
# This script demonstrates the usage of the class-based chooser.
#
# Author: Gergely Erdelyi <*****@*****.**>
#---------------------------------------------------------------------
from idaapi import Choose

#
# Modal chooser
#

# Get a modal Choose instance
chooser = Choose([], "MyChooser", 1)
# List to choose from
chooser.list = [ "First", "Second", "Third" ]
# Set the width
chooser.width = 50
# Run the chooser
ch = chooser.choose()
# Print the results
if ch > 0:
    print "You chose %d which is %s" % (ch, chooser.list[ch-1])
else:
    print "Escape from chooser"

#
# Normal chooser
#
class MyChoose(Choose):
Beispiel #18
0
 def __init__(self, list=[], name="Choose"):
     Choose.__init__(self, list, name)
     # Set the width
     self.width = 50
     self.deflt = 1
Beispiel #19
0
 def __init__(self, list, title):
     Choose.__init__(self, list, title)
     self.width = 250
Beispiel #20
0
 def __init__(self, list=[], name="Choose"):
     Choose.__init__(self, list, name)
     # Set the width
     self.width = 50
     self.deflt = 1
Beispiel #21
0
#---------------------------------------------------------------------
# Chooser test
#
# This script demonstrates the usage of the class-based chooser.
#
# Author: Gergely Erdelyi <*****@*****.**>
#---------------------------------------------------------------------
from idaapi import Choose

#
# Modal chooser
#

# Get a modal Choose instance
chooser = Choose([], "MyChooser", 1)
# List to choose from
chooser.list = ["First", "Second", "Third"]
# Set the width
chooser.width = 50
# Run the chooser
ch = chooser.choose()
# Print the results
if ch > 0:
    print "You chose %d which is %s" % (ch, chooser.list[ch - 1])
else:
    print "Escape from chooser"


#
# Normal chooser
#
 def __init__(self, list=[]):
     Choose.__init__(self, list, "ScriptBox", 1)
     self.width = 50