forked from Vector35/workflow_objc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Plugin.cpp
50 lines (41 loc) · 1.3 KB
/
Plugin.cpp
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
/*
* 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.
*/
#include "Commands.h"
#include "Constants.h"
#include "DataRenderers.h"
#include "Workflow.h"
#include "ArchitectureHooks.h"
extern "C" {
BN_DECLARE_CORE_ABI_VERSION
BINARYNINJAPLUGIN void CorePluginDependencies()
{
BinaryNinja::AddOptionalPluginDependency("arch_x86");
BinaryNinja::AddOptionalPluginDependency("arch_armv7");
BinaryNinja::AddOptionalPluginDependency("arch_arm64");
}
BINARYNINJAPLUGIN bool CorePluginInit()
{
TaggedPointerDataRenderer::Register();
FastPointerDataRenderer::Register();
RelativePointerDataRenderer::Register();
Workflow::registerActivities();
Commands::registerCommands();
std::vector<BinaryNinja::Ref<BinaryNinja::Architecture>> targets = {
BinaryNinja::Architecture::GetByName("aarch64"),
BinaryNinja::Architecture::GetByName("x86_64")
};
for (auto& target : targets) {
if (target)
{
auto* currentHook = new CFStringArchitectureHook(target);
target->Register(currentHook);
}
}
BinaryNinja::LogRegistry::CreateLogger(PluginLoggerName);
return true;
}
}