MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / ReadGlobal

Method ReadGlobal

database.cpp:481–499  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

479
480
481Json::Value Database::ReadGlobal(const std::string& key) const
482{
483 char* value = BNReadDatabaseGlobal(m_object, key.c_str());
484 if (value == nullptr)
485 {
486 throw DatabaseException("BNReadDatabaseGlobal");
487 }
488
489 Json::Value json;
490 std::unique_ptr<Json::CharReader> reader(Json::CharReaderBuilder().newCharReader());
491 std::string errors;
492 if (!reader->parse(value, value + strlen(value), &json, &errors))
493 {
494 throw DatabaseException(errors);
495 }
496
497 BNFreeString(value);
498 return json;
499}
500
501
502void Database::WriteGlobal(const std::string& key, const Json::Value& val)

Callers 8

RecognizeMethod · 0.80
RecognizeMethod · 0.80
RecognizeMethod · 0.80
RecognizeMethod · 0.80
RecognizeMethod · 0.80
RecognizeMethod · 0.80
RecognizeMethod · 0.80
RecognizeMethod · 0.80

Calls 4

DatabaseExceptionClass · 0.85
c_strMethod · 0.80
newCharReaderMethod · 0.80
parseMethod · 0.45

Tested by

no test coverage detected