Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Commit

Permalink
Convert forgotten data variables to tagged pointers
Browse files Browse the repository at this point in the history
  • Loading branch information
jonpalmisc committed Jan 24, 2022
1 parent 5628c5e commit 7bcc99c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/StructureAnalyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ StructureAnalyzer::StructureAnalyzer(BinaryViewRef bv)
, m_reader(bv)
, m_writer(bv)
, m_isARM64(bv->GetDefaultArchitecture()->GetName() == "aarch64")
, m_taggedPointerType(Type::NamedType(m_bv, CustomTypes::TaggedPointer))
, m_cfStringType(Type::NamedType(m_bv, CustomTypes::CFString))
, m_methodListType(Type::NamedType(m_bv, CustomTypes::MethodList))
, m_classDataType(Type::NamedType(m_bv, CustomTypes::ClassData))
Expand Down Expand Up @@ -139,8 +140,7 @@ SelectorRefRecord StructureAnalyzer::analyzeSelectorRef(uint64_t address)

LOG(" rawSelector=0x%llx, nameAddress=0x%llx", rawSelector, nameAddress);

m_bv->DefineDataVariable(address,
Type::PointerType(8, Type::NamedType(m_bv, CustomTypes::Selector)));
m_bv->DefineDataVariable(address, m_taggedPointerType);
return { address, rawSelector, nameAddress };
}

Expand Down Expand Up @@ -359,7 +359,7 @@ void StructureAnalyzer::runPrivate()
const auto classListStart = classListSection->GetStart();
const auto classListEnd = classListStart + classListSection->GetLength();
for (auto address = classListStart; address < classListEnd; address += 8) {
m_bv->DefineDataVariable(address, Type::PointerType(8, m_classType));
m_bv->DefineDataVariable(address, m_taggedPointerType);

seek(address);
const auto classAddress = readTaggedPointer();
Expand Down
1 change: 1 addition & 0 deletions source/StructureAnalyzer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class StructureAnalyzer {

bool m_isARM64;

TypeRef m_taggedPointerType;
TypeRef m_cfStringType;
TypeRef m_methodType;
TypeRef m_methodListType;
Expand Down

0 comments on commit 7bcc99c

Please sign in to comment.