Example #1
0
	def read_cpp_enumeration(self, line):
		name = line.get("Name")
		if IDAtools.is_in_ida("Enumeration", name):
			return {"table": "PDOMCPPEnumeration","name" : name}

		enumerators = self.get_array_list("IEnumerator", line.get("ID"),"enumerators")
		result = {"table":"PDOMCPPEnumeration","name" : name ,"enumerators" : enumerators}

		self.symbol_builder.build_enum(result)
		return result
Example #2
0
	def read_cpp_constructor_specialization_type(self, line):
		name = line.get("Name")
		parameter = self.get_array_list("ICPPParameter",line.get("ID"), "parameters")
		functionType = self.call_cpp_function_by_owner(line.get("TypeTable"),line.get("ID"),"type")

		if IDAtools.is_in_ida("CPPFunction", name):
			return {"table":"CPPConstructorSpecialization","name":name ,"parameter":parameter,"functionType":functionType}

		result = {"table":"CPPConstructorSpecialization","name":name,"argumentCount ": argumentCount ,"parameter":parameter,"functionType":functionType}
		self.symbol_builder.build_function(result)
		return result
Example #3
0
    def read_c_structure(self, line):
        name = line.get("Name")

        if IDAtools.is_in_ida("Structure", name):
            return {"table": "PDOMCStructure", "name": name}

        fields = self.get_array_list("IField", line.get("ID"), "fields")

        result = {"table": "PDOMCStructure", "name": name, "fields": fields}

        self.symbol_builder.build_struct(result)
        return result
Example #4
0
	def read_cpp_method_instance(self, line):
		name = line.get("Name")
		argumentCount = line.get("requiredArgumentCount")
		parameter = self.get_array_list("ICPPParameter",line.get("ID"), "parameters")
		functionType = self.call_cpp_function_by_owner(line.get("TypeTable"),line.get("ID"),"type")

		if IDAtools.is_in_ida("CPPFunction", name):
			return {"table":"PDOMCPPMethodInstance","name":name,"argumentCount ": argumentCount ,"parameter":parameter,"functionType":functionType}

		result = {"table":"PDOMCPPMethodInstance","name":name,"argumentCount ": argumentCount ,"parameter":parameter,"functionType":functionType}
		self.symbol_builder.build_function(result)
		return result
Example #5
0
	def read_cpp_class_template_partial_specialization(self, line):
		name = line.get("Name")
		if IDAtools.is_in_ida("Structure", name):
			return {"table": "PDOMCPPClassTemplatePartialSpecialization","name" : name}

		fields = self.get_array_list("IField", line.get("ID"),"fields")
		methods = self.get_array_list("ICPPMethod", line.get("ID"),"methods")	

		result = {"table": "PDOMCPPClassTemplatePartialSpecialization", "name":line.get("Name"),"fields": fields,"methods": methods}
		
		self.symbol_builder.build_class_type(result)
		return result		
Example #6
0
	def read_cpp_class_instance(self, line):
		name = line.get("Name")
		if IDAtools.is_in_ida("Structure", name):
			return {"table": "PDOMCPPClassType","name" : name}

		fields = self.get_array_list("IField", line.get("ID"),"fields")
		methods = self.get_array_list("ICPPMethod", line.get("ID"),"methods")	

		result = {"table": "PDOMCPPClassInstance", "name":line.get("Name"),"fields": fields,"methods": methods}
		
		self.symbol_builder.build_class_type(result)
		return result
Example #7
0
	def read_cpp_typedef_specialization(self, line):
		name = line.get("Name")			
		if line.get("TypeTableSubId") == 0:
			type = self.call_cpp_function_by_owner(line.get("TypeTable"), line.get("ID"), "type")
		else:
			type = self.call_cpp_function_by_id(line.get("TypeTable"), line.get("TypeTableSubId"))

		result = {"table":"PDOMCPPTypedefSpecialization","name": name, "type" :type} 

		if IDAtools.is_in_ida("Typedef", name):
			return result
		self.symbol_builder.build_typedef(result)
		return  result
Example #8
0
	def read_cpp_variable(self, line):
		name = line.get("Name")	

		if line.get("TypeTableSubId") == 0:
			type = self.call_cpp_function_by_owner(line.get("TypeTable"), line.get("ID"), "type")
		else:
			type = self.call_cpp_function_by_id(line.get("TypeTable"), line.get("TypeTableSubId"))	

		result = {"table":"PDOMCPPVariable","name": name , "type": type}

		if IDAtools.is_in_ida("Variable", name):
			return result
		self.symbol_builder.build_global_variable(result)
		return result
Example #9
0
    def read_c_function(self, line):
        name = line.get("Name")
        parameter = self.get_array_list("IParameter", line.get("ID"),
                                        "parameters")
        functionType = self.call_c_function_by_owner(line.get("TypeTable"),
                                                     line.get("ID"), "type")

        result = {
            "table": "PDOMCFunction",
            "name": name,
            "parameter": parameter,
            "functionType": functionType
        }

        if IDAtools.is_in_ida("CFunction", name):
            return result
        self.symbol_builder.build_function(result)
        return result
Example #10
0
	def read_cpp_constructor_template(self, line):
		name = line.get("Name")

		argumentCount = line.get("requiredArgumentCount")
		parameter = self.get_array_list("ICPPParameter",line.get("ID"), "parameters")
		functionType = self.call_cpp_function_by_owner(line.get("FunctionTypeTable"),line.get("ID"),"type")

		allInstances = self.get_array_list("ICPPTemplateInstance",line.get("ID"), "allInstances")
		templateParameters = self.get_array_list("IPDOMCPPTemplateParameter",line.get("ID"), "templateParameters")


		result = {"table":"PDOMCPPConstructorTemplate","name":name,"argumentCount ": argumentCount ,"parameter":parameter,"functionType":functionType}

		if IDAtools.is_in_ida("CPPFunctionTemplate", name):
			return result

		self.symbol_builder.build_function(result)
		return result