Skip to content

Commit 77a8886

Browse files
committed
types: fragment types
1 parent 7a4114b commit 77a8886

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

binaryninjacore.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@
3737
// Current ABI version for linking to the core. This is incremented any time
3838
// there are changes to the API that affect linking, including new functions,
3939
// new types, or modifications to existing functions or types.
40-
#define BN_CURRENT_CORE_ABI_VERSION 162
40+
#define BN_CURRENT_CORE_ABI_VERSION 163
4141

4242
// Minimum ABI version that is supported for loading of plugins. Plugins that
4343
// are linked to an ABI version less than this will not be able to load and
4444
// will require rebuilding. The minimum version is increased when there are
4545
// incompatible changes that break binary compatibility, such as changes to
4646
// existing types or functions.
47-
#define BN_MINIMUM_CORE_ABI_VERSION 161
47+
#define BN_MINIMUM_CORE_ABI_VERSION 163
4848

4949
#ifdef __GNUC__
5050
#ifdef BINARYNINJACORE_LIBRARY
@@ -871,7 +871,8 @@ extern "C"
871871
VarArgsTypeClass = 9,
872872
ValueTypeClass = 10,
873873
NamedTypeReferenceClass = 11,
874-
WideCharTypeClass = 12
874+
WideCharTypeClass = 12,
875+
FragmentTypeClass = 13,
875876
};
876877

877878
BN_ENUM(uint8_t, BNNamedTypeReferenceClass)

plugins/dwarf/dwarf_export/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,10 @@ fn export_type(
401401
);
402402
Some(wide_char_die_uid)
403403
}
404+
TypeClass::FragmentTypeClass => {
405+
tracing::error!("Fragment types are not representable in DWARF");
406+
None
407+
}
404408
}
405409
}
406410

plugins/warp/src/convert/types.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,10 @@ pub fn from_bn_type_internal(
244244
};
245245
TypeClass::Character(char_class)
246246
}
247+
BNTypeClass::FragmentTypeClass => {
248+
// XXX: possibly unrepresentable?
249+
TypeClass::Void
250+
}
247251
};
248252

249253
let name = raw_ty.registered_name().map(|n| n.name().to_string());

python/types.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3484,13 +3484,16 @@ def create(
34843484
assert core_type is not None, "core.BNCreateWideCharType returned None"
34853485
return cls(core_type, platform, confidence)
34863486

3487+
class FragmentType(Type):
3488+
pass
34873489

34883490
Types = {
34893491
TypeClass.VoidTypeClass: VoidType, TypeClass.BoolTypeClass: BoolType, TypeClass.IntegerTypeClass: IntegerType,
34903492
TypeClass.FloatTypeClass: FloatType, TypeClass.StructureTypeClass: StructureType,
34913493
TypeClass.EnumerationTypeClass: EnumerationType, TypeClass.PointerTypeClass: PointerType,
34923494
TypeClass.ArrayTypeClass: ArrayType, TypeClass.FunctionTypeClass: FunctionType,
34933495
TypeClass.NamedTypeReferenceClass: NamedTypeReferenceType, TypeClass.WideCharTypeClass: WideCharType,
3496+
TypeClass.FragmentTypeClass: FragmentType,
34943497
}
34953498

34963499

0 commit comments

Comments
 (0)