Skip to content

Commit 290374e

Browse files
committed
Add Type::SetIgnored API
1 parent 3e63b6e commit 290374e

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

binaryninjaapi.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10348,6 +10348,11 @@ namespace BinaryNinja {
1034810348

1034910349
Ref<Type> Duplicate() const;
1035010350

10351+
/*! Call this with setIgnored=True if this Type object is expected to be always resident.
10352+
* This prevents the type object from showing up in the results of GetMemoryUsageInfo
10353+
*/
10354+
Type* SetIgnored(bool setIgnored);
10355+
1035110356

1035210357
/*! Create a "void" type
1035310358

binaryninjacore.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6799,6 +6799,7 @@ extern "C"
67996799
BINARYNINJACOREAPI char* BNGetTypeAndName(BNType* type, BNQualifiedName* name, BNTokenEscapingType escaping);
68006800
BINARYNINJACOREAPI void BNFreeType(BNType* type);
68016801
BINARYNINJACOREAPI void BNFreeTypeList(BNType** types, size_t count);
6802+
BINARYNINJACOREAPI BNType* BNTypeSetIgnored(BNType* type, bool ignored);
68026803

68036804
BINARYNINJACOREAPI BNTypeBuilder* BNCreateTypeBuilderFromType(BNType* type);
68046805
BINARYNINJACOREAPI BNTypeBuilder* BNCreateVoidTypeBuilder(void);

type.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,8 @@ string Type::GetTypeAndName(const QualifiedName& nameList, BNTokenEscapingType e
793793
return outName;
794794
}
795795

796+
797+
796798
string Type::GetStringBeforeName(Platform* platform, BNTokenEscapingType escaping) const
797799
{
798800
char* str = BNGetTypeStringBeforeName(m_object, platform ? platform->GetObject() : nullptr, escaping);
@@ -846,6 +848,13 @@ Ref<Type> Type::Duplicate() const
846848
}
847849

848850

851+
Type* Type::SetIgnored(bool setIgnored)
852+
{
853+
BNTypeSetIgnored(m_object, setIgnored);
854+
return this;
855+
}
856+
857+
849858
Ref<Type> Type::VoidType()
850859
{
851860
return new Type(BNCreateVoidType());

0 commit comments

Comments
 (0)