MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / _loadQueries

Function _loadQueries

lib/core/option.py:180–216  ·  view source on GitHub ↗

Loads queries from 'xml/queries.xml' file.

()

Source from the content-addressed store, hash-verified

178 WindowsError = None
179
180def _loadQueries():
181 """
182 Loads queries from 'xml/queries.xml' file.
183 """
184
185 def iterate(node, retVal=None):
186 class DictObject(object):
187 def __init__(self):
188 self.__dict__ = {}
189
190 def __contains__(self, name):
191 return name in self.__dict__
192
193 if retVal is None:
194 retVal = DictObject()
195
196 for child in node.findall("*"):
197 instance = DictObject()
198 retVal.__dict__[child.tag] = instance
199 if child.attrib:
200 instance.__dict__.update(child.attrib)
201 else:
202 iterate(child, instance)
203
204 return retVal
205
206 tree = ElementTree()
207 try:
208 tree.parse(paths.QUERIES_XML)
209 except Exception as ex:
210 errMsg = "something appears to be wrong with "
211 errMsg += "the file '%s' ('%s'). Please make " % (paths.QUERIES_XML, getSafeExString(ex))
212 errMsg += "sure that you haven't made any changes to it"
213 raise SqlmapInstallationException(errMsg)
214
215 for node in tree.findall("*"):
216 queries[node.attrib['value']] = iterate(node)
217
218def _setMultipleTargets():
219 """

Callers 1

initFunction · 0.85

Calls 4

getSafeExStringFunction · 0.90
iterateFunction · 0.85
parseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…