| 39 | |
| 40 | |
| 41 | bool 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 | |
| 66 | BNDisassemblyTextLine* DataRenderer::GetLinesForDataCallback(void* ctxt, BNBinaryView* view, uint64_t addr, |
nothing calls this directly
no test coverage detected