Skip to content

Commit 8363537

Browse files
committed
types: fragment types
1 parent 7228ba0 commit 8363537

4 files changed

Lines changed: 13 additions & 1 deletion

File tree

binaryninjacore.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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)