Skip to content

Commit 8fce70b

Browse files
committed
types: fragment types
1 parent c9dbb48 commit 8fce70b

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
@@ -3458,13 +3458,16 @@ def create(
34583458
assert core_type is not None, "core.BNCreateWideCharType returned None"
34593459
return cls(core_type, platform, confidence)
34603460

3461+
class FragmentType(Type):
3462+
pass
34613463

34623464
Types = {
34633465
TypeClass.VoidTypeClass: VoidType, TypeClass.BoolTypeClass: BoolType, TypeClass.IntegerTypeClass: IntegerType,
34643466
TypeClass.FloatTypeClass: FloatType, TypeClass.StructureTypeClass: StructureType,
34653467
TypeClass.EnumerationTypeClass: EnumerationType, TypeClass.PointerTypeClass: PointerType,
34663468
TypeClass.ArrayTypeClass: ArrayType, TypeClass.FunctionTypeClass: FunctionType,
34673469
TypeClass.NamedTypeReferenceClass: NamedTypeReferenceType, TypeClass.WideCharTypeClass: WideCharType,
3470+
TypeClass.FragmentTypeClass: FragmentType,
34683471
}
34693472

34703473

0 commit comments

Comments
 (0)