MCPcopy Create free account
hub / github.com/CheckPointSW/Karta / loadKnowledge

Function loadKnowledge

src/config/utils.py:228–244  ·  view source on GitHub ↗

Load the .json configuration for the current binary file, if exists. Args: bin_path (str, Optional): path to the compiled binary file (None by default) Return value: json parsed information, or None if none exist

(bin_path=None)

Source from the content-addressed store, hash-verified

226 return (bin_path if bin_path is not None else disas_layer.databaseFile()) + KNOWLEDGE_FILE_SUFFIX
227
228def loadKnowledge(bin_path=None):
229 """Load the .json configuration for the current binary file, if exists.
230
231 Args:
232 bin_path (str, Optional): path to the compiled binary file (None by default)
233
234 Return value:
235 json parsed information, or None if none exist
236 """
237 json_path = accumulatedKnowledgePath(bin_path)
238 if not os.path.exists(json_path):
239 return None
240
241 fd = open(json_path, "r")
242 config_dict = json.load(fd)
243 fd.close()
244 return config_dict
245
246def storeKnowledge(json_config, bin_path=None):
247 """Store the .json configuration for the current binary file.

Callers 5

mainFunction · 0.85
startMatchFunction · 0.85
matchLibrariesFunction · 0.85
identifyLibrariesFunction · 0.85
mainFunction · 0.85

Calls 2

accumulatedKnowledgePathFunction · 0.85
loadMethod · 0.45

Tested by

no test coverage detected