forked from Vector35/workflow_objc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
DataRenderers.h
66 lines (51 loc) · 1.94 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
* 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 tagged pointers.
*/
class TaggedPointerDataRenderer : public BinaryNinja::DataRenderer {
TaggedPointerDataRenderer() = 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&) override;
static void Register();
};
/**
* Data renderer for fast tagged pointers.
*/
class FastPointerDataRenderer : public BinaryNinja::DataRenderer {
FastPointerDataRenderer() = 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&) override;
static void Register();
};
/**
* 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&) override;
static void Register();
};