(self)
return False
Detects if there is any reference to strings that look like SQL queries.
Detects if there is any reference to strings that look like SQL queries.
Detects if there is any reference to strings that look like SQL queries .
def has_sql(self):
        """
        Detects if there is any reference to strings that look like SQL queries.
        """

        # what strings are the current function referencing?
        for block in self._function.blocks:
            if block.size == 0:
                continue
            for ins_addr in block.instruction_addrs:
                xrefs = self.kb.xrefs.get_xrefs_by_ins_addr(ins_addr)
                for xref in xrefs:
                    xref: XRef
                    if xref.memory_data is not None and xref.memory_data.sort == 'string':
                        if looks_like_sql(xref.memory_data.content.decode("utf-8")):
                            return { CodeTags.HAS_SQL }

        return False
def has_sql ( self ) : # what strings are the current function referencing? for block in self . _function . blocks : if block . size == 0 : continue for ins_addr in block . instruction_addrs : xrefs = self . kb . xrefs . get_xrefs_by_ins_addr ( ins_addr ) for xref in xrefs : xref : XRef if xref . memory_data is not None and xref . memory_data . sort == 'string' : if looks_like_sql ( xref . memory_data . content . decode ( "utf-8" ) ) : return { CodeTags . HAS_SQL } return False