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

Method IsValidForDataCallback

datarenderer.cpp:41–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39
40
41bool DataRenderer::IsValidForDataCallback(
42 void* ctxt, BNBinaryView* view, uint64_t addr, BNType* type, BNTypeContext* typeCtx, size_t ctxCount)
43{
44 CallbackRef<DataRenderer> renderer(ctxt);
45 Ref<BinaryView> viewObj = new BinaryView(BNNewViewReference(view));
46 Ref<Type> typeObj = new Type(BNNewTypeReference(type));
47 vector<pair<Type*, size_t>> context;
48 context.reserve(ctxCount);
49 for (size_t i = 0; i < ctxCount; i++)
50 {
51 // To keep API compatibility we have to manually do the refcounting here
52 Type* contextType = new Type(BNNewTypeReference(typeCtx[i].type));
53 contextType->AddRef();
54 context.push_back({contextType, typeCtx[i].offset});
55 }
56
57 bool result = renderer->IsValidForData(viewObj, addr, typeObj, context);
58
59 for (size_t i = 0; i < ctxCount; i++)
60 context[i].first->Release();
61
62 return result;
63}
64
65
66BNDisassemblyTextLine* DataRenderer::GetLinesForDataCallback(void* ctxt, BNBinaryView* view, uint64_t addr,

Callers

nothing calls this directly

Calls 4

push_backMethod · 0.80
IsValidForDataMethod · 0.80
AddRefMethod · 0.45
ReleaseMethod · 0.45

Tested by

no test coverage detected