MCPcopy Create free account
hub / github.com/REhints/HexRaysCodeXplorer / isValid

Method isValid

src/HexRaysCodeXplorer/MSVCObjectFormatParser.cpp:218–241  ·  view source on GitHub ↗

A valid type_info/TypeDescriptor at pointer?

Source from the content-addressed store, hash-verified

216
217// A valid type_info/TypeDescriptor at pointer?
218bool RTTI::type_info::isValid(ea_t typeInfo)
219{
220 // TRUE if we've already seen it
221 if (tdSet.find(typeInfo) != tdSet.end())
222 return true;
223
224 if (is_loaded(typeInfo))
225 {
226 // Verify what should be a vftable
227 ea_t ea = getEa(typeInfo + offsetof(type_info, vfptr));
228 if (is_loaded(ea))
229 {
230 // _M_data should be NULL statically
231 ea_t _M_data = BADADDR;
232 if (getVerifyEa((typeInfo + offsetof(type_info, _M_data)), _M_data))
233 {
234 if (_M_data == 0)
235 return(isTypeName(typeInfo + offsetof(type_info, _M_d_name)));
236 }
237 }
238 }
239
240 return false;
241}
242
243// Returns TRUE if known typename at address
244bool RTTI::type_info::isTypeName(ea_t name)

Callers

nothing calls this directly

Calls 4

getEaFunction · 0.85
getVerifyEaFunction · 0.85
getVerify32_tFunction · 0.85
isValidFunction · 0.85

Tested by

no test coverage detected