MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / ReadCompleteObjectorLocator

Function ReadCompleteObjectorLocator

plugins/rtti/microsoft.cpp:88–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86
87
88std::optional<CompleteObjectLocator> ReadCompleteObjectorLocator(BinaryView *view, uint64_t address)
89{
90 auto coLocator = CompleteObjectLocator(view, address);
91 uint64_t startAddr = view->GetOriginalImageBase();
92
93 auto outsideSection = [&](uint64_t addr) {
94 return view->GetSectionsAt(addr).empty();
95 };
96
97 if (coLocator.signature > 1)
98 return std::nullopt;
99
100 if (coLocator.signature == COL_SIG_REV1)
101 {
102 if (coLocator.pSelf + startAddr != address)
103 return std::nullopt;
104
105 // Relative addrs
106 if (outsideSection(coLocator.pTypeDescriptor + startAddr))
107 return std::nullopt;
108
109 if (outsideSection(coLocator.pClassHierarchyDescriptor + startAddr))
110 return std::nullopt;
111 }
112 else
113 {
114 // Absolute addrs
115 if (outsideSection(coLocator.pTypeDescriptor))
116 return std::nullopt;
117
118 if (outsideSection(coLocator.pClassHierarchyDescriptor))
119 return std::nullopt;
120 }
121
122 return coLocator;
123}
124
125
126Ref<Type> GetPMDType(BinaryView *view)

Callers 2

ProcessRTTIMethod · 0.85
ProcessVFTMethod · 0.85

Calls 4

GetOriginalImageBaseMethod · 0.80
GetSectionsAtMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected