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)
| 226 | return (bin_path if bin_path is not None else disas_layer.databaseFile()) + KNOWLEDGE_FILE_SUFFIX |
| 227 | |
| 228 | def 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 | |
| 246 | def storeKnowledge(json_config, bin_path=None): |
| 247 | """Store the .json configuration for the current binary file. |
no test coverage detected