forked from jonpalmisc/ObjectiveNinja
-
Notifications
You must be signed in to change notification settings - Fork 9
/
DataRenderers.h
30 lines (23 loc) · 905 Bytes
/
DataRenderers.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
* Copyright (c) 2022-2023 Jon Palmisciano. All rights reserved.
*
* Use of this source code is governed by the BSD 3-Clause license; the full
* terms of the license can be found in the LICENSE.txt file.
*/
#pragma once
#include "BinaryNinja.h"
using DataRendererContext = std::vector<std::pair<TypePtr, size_t>>;
/**
* Data renderer for relative offset pointers.
*/
class RelativePointerDataRenderer : public BinaryNinja::DataRenderer {
RelativePointerDataRenderer() = default;
public:
bool IsValidForData(BinaryViewPtr, uint64_t address, TypePtr,
DataRendererContext&) override;
std::vector<BinaryNinja::DisassemblyTextLine> GetLinesForData(
BinaryViewPtr, uint64_t address, TypePtr,
const std::vector<BinaryNinja::InstructionTextToken>& prefix,
size_t width, DataRendererContext&, const std::string&) override;
static void Register();
};