(self)
Calculate the total size of arguments, # of arguments and # of local variables. Update the internal class member
        variables appropriately.
Calculate the total size of arguments, # of arguments and # of local variables. Update the internal class member
        variables appropriately.
Calculate the total size of arguments # of arguments and # of local variables . Update the internal class member variables appropriately .
def __init_args_and_local_vars__ (self):
        '''
        Calculate the total size of arguments, # of arguments and # of local variables. Update the internal class member
        variables appropriately.
        '''

        # grab the ida function and frame structures.
        func_struct  = get_func(self.ea_start)
        frame_struct = get_frame(func_struct)

        if not frame_struct:
            return

        argument_boundary = self.local_var_size + self.saved_reg_size + self.ret_size
        frame_offset      = 0

        for i in xrange(0, frame_struct.memqty):
            end_offset = frame_struct.get_member(i).soff

            if i == frame_struct.memqty - 1:
                begin_offset = frame_struct.get_member(i).eoff
            else:
                begin_offset = frame_struct.get_member(i+1).soff

            frame_offset += (begin_offset - end_offset)

            # grab the name of the current local variable or argument.
            name = get_member_name(frame_struct.get_member(i).id)

            if name == None:
                continue

            if frame_offset > argument_boundary:
                self.args[end_offset] = name
            else:
                # if the name starts with a space, then ignore it as it is either the stack saved ebp or eip.
                # XXX - this is a pretty ghetto check.
                if not name.startswith(" "):
                    self.local_vars[end_offset] = name

        self.arg_size       = frame_offset - argument_boundary
        self.num_args       = len(self.args)
        self.num_local_vars = len(self.local_vars)
def __init_args_and_local_vars__ ( self ) : # grab the ida function and frame structures. func_struct = get_func ( self . ea_start ) frame_struct = get_frame ( func_struct ) if not frame_struct : return argument_boundary = self . local_var_size + self . saved_reg_size + self . ret_size frame_offset = 0 for i in xrange ( 0 , frame_struct . memqty ) : end_offset = frame_struct . get_member ( i ) . soff if i == frame_struct . memqty - 1 : begin_offset = frame_struct . get_member ( i ) . eoff else : begin_offset = frame_struct . get_member ( i + 1 ) . soff frame_offset += ( begin_offset - end_offset ) # grab the name of the current local variable or argument. name = get_member_name ( frame_struct . get_member ( i ) . id ) if name == None : continue if frame_offset > argument_boundary : self . args [ end_offset ] = name else : # if the name starts with a space, then ignore it as it is either the stack saved ebp or eip. # XXX - this is a pretty ghetto check. if not name . startswith ( " " ) : self . local_vars [ end_offset ] = name self . arg_size = frame_offset - argument_boundary self . num_args = len ( self . args ) self . num_local_vars = len ( self . local_vars )