forked from jonpalmisc/ObjectiveNinja
-
Notifications
You must be signed in to change notification settings - Fork 9
/
ArchitectureHooks.cpp
34 lines (26 loc) · 1.07 KB
/
ArchitectureHooks.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
#include "ArchitectureHooks.h"
using namespace BinaryNinja;
std::string CFStringArchitectureHook::GetIntrinsicName(uint32_t intrinsic)
{
if (intrinsic == CFSTRIntrinsicIndex)
return "CFSTR";
return ArchitectureHook::GetIntrinsicName(intrinsic);
}
std::vector<uint32_t> CFStringArchitectureHook::GetAllIntrinsics()
{
auto parent = ArchitectureHook::GetAllIntrinsics();
parent.push_back(CFSTRIntrinsicIndex);
return parent;
}
std::vector<NameAndType> CFStringArchitectureHook::GetIntrinsicInputs(uint32_t intrinsic)
{
if (intrinsic != CFSTRIntrinsicIndex)
return ArchitectureHook::GetIntrinsicInputs(intrinsic);
return { NameAndType(Type::PointerType(ArchitectureHook::GetAddressSize(), Type::IntegerType(1, false))) };
}
std::vector<Confidence<BinaryNinja::Ref<Type>>> CFStringArchitectureHook::GetIntrinsicOutputs(uint32_t intrinsic)
{
if (intrinsic != CFSTRIntrinsicIndex)
return ArchitectureHook::GetIntrinsicOutputs(intrinsic);
return { Type::PointerType(ArchitectureHook::GetAddressSize(), Type::IntegerType(1, false)) };
}