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

Method GetValue

database.cpp:69–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67
68
69Json::Value KeyValueStore::GetValue(const std::string& name) const
70{
71 BNDataBuffer* bnBuffer = BNGetKeyValueStoreBuffer(m_object, name.c_str());
72 if (bnBuffer == nullptr)
73 {
74 throw DatabaseException("BNGetKeyValueStoreBuffer");
75 }
76 DataBuffer value = DataBuffer(bnBuffer);
77 Json::Value json;
78 std::unique_ptr<Json::CharReader> reader(Json::CharReaderBuilder().newCharReader());
79 std::string errors;
80 if (!reader->parse(static_cast<const char*>(value.GetData()),
81 static_cast<const char*>(value.GetDataAt(value.GetLength())), &json, &errors))
82 {
83 throw DatabaseException(errors);
84 }
85 return json;
86}
87
88
89DataBuffer KeyValueStore::GetValueHash(const std::string& name) const

Callers 15

AddFunctionMethod · 0.45
IntegerTypeMethod · 0.45
NamedTypeMethod · 0.45
EnumerationTypeMethod · 0.45
PointerTypeMethod · 0.45
FunctionTypeMethod · 0.45
type.cppFile · 0.45

Calls 8

DatabaseExceptionClass · 0.85
c_strMethod · 0.80
newCharReaderMethod · 0.80
GetDataAtMethod · 0.80
DataBufferClass · 0.70
parseMethod · 0.45
GetDataMethod · 0.45
GetLengthMethod · 0.45

Tested by

no test coverage detected