Skip to content

Commit

Permalink
Add access and scope info from core to StructMember access methods
Browse files Browse the repository at this point in the history
  • Loading branch information
SmoothHacker authored and xusheng6 committed Nov 28, 2023
1 parent b5d6806 commit 39cc644
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2139,6 +2139,8 @@ vector<StructureMember> Structure::GetMembers() const
member.type = Confidence<Ref<Type>>(new Type(BNNewTypeReference(members[i].type)), members[i].typeConfidence);
member.name = members[i].name;
member.offset = members[i].offset;
member.access = members[i].access;
member.scope = members[i].scope;
result.push_back(member);
}

Expand All @@ -2162,6 +2164,8 @@ vector<InheritedStructureMember> Structure::GetMembersIncludingInherited(const T
member.member.type = Confidence<Ref<Type>>(new Type(BNNewTypeReference(members[i].member.type)), members[i].member.typeConfidence);
member.member.name = members[i].member.name;
member.member.offset = members[i].member.offset;
member.member.access = members[i].member.access;
member.member.scope = members[i].member.scope;
member.memberIndex = members[i].memberIndex;
result.push_back(member);
}
Expand All @@ -2183,6 +2187,8 @@ bool Structure::GetMemberIncludingInheritedAtOffset(BinaryView* view, int64_t of
result.member.type = Confidence<Ref<Type>>(new Type(BNNewTypeReference(member->member.type)), member->member.typeConfidence);
result.member.name = member->member.name;
result.member.offset = member->member.offset;
result.member.access = member->member.access;
result.member.scope = member->member.scope;
result.memberIndex = member->memberIndex;

BNFreeInheritedStructureMember(member);
Expand All @@ -2198,6 +2204,8 @@ bool Structure::GetMemberByName(const string& name, StructureMember& result) con
result.type = Confidence<Ref<Type>>(new Type(BNNewTypeReference(member->type)), member->typeConfidence);
result.name = member->name;
result.offset = member->offset;
result.access = member->access;
result.scope = member->scope;
BNFreeStructureMember(member);
return true;
}
Expand All @@ -2220,6 +2228,8 @@ bool Structure::GetMemberAtOffset(int64_t offset, StructureMember& result, size_
result.type = Confidence<Ref<Type>>(new Type(BNNewTypeReference(member->type)), member->typeConfidence);
result.name = member->name;
result.offset = member->offset;
result.access = member->access;
result.scope = member->scope;
BNFreeStructureMember(member);
return true;
}
Expand Down Expand Up @@ -2428,6 +2438,8 @@ vector<StructureMember> StructureBuilder::GetMembers() const
member.type = Confidence<Ref<Type>>(new Type(BNNewTypeReference(members[i].type)), members[i].typeConfidence);
member.name = members[i].name;
member.offset = members[i].offset;
member.access = members[i].access;
member.scope = members[i].scope;
result.push_back(member);
}

Expand All @@ -2444,6 +2456,8 @@ bool StructureBuilder::GetMemberByName(const string& name, StructureMember& resu
result.type = Confidence<Ref<Type>>(new Type(BNNewTypeReference(member->type)), member->typeConfidence);
result.name = member->name;
result.offset = member->offset;
result.access = member->access;
result.scope = member->scope;
BNFreeStructureMember(member);
return true;
}
Expand All @@ -2466,6 +2480,8 @@ bool StructureBuilder::GetMemberAtOffset(int64_t offset, StructureMember& result
result.type = Confidence<Ref<Type>>(new Type(BNNewTypeReference(member->type)), member->typeConfidence);
result.name = member->name;
result.offset = member->offset;
result.access = member->access;
result.scope = member->scope;
BNFreeStructureMember(member);
return true;
}
Expand Down

0 comments on commit 39cc644

Please sign in to comment.