ghidra
ghidra copied to clipboard
DataTypeComponent.getLength - bits or bytes?
Is DataTypeComponent
's getLength()
method supposed to return the length of the component in bits or bytes? I cannot find this documented anywhere.
It is odd that the docs do not specify this. Taken from ghidra.program.model.data.DataType
:
Get the length of this DataType as a number of 8-bit bytes.
Taken from
ghidra.program.model.data.DataType
:
Get the length of this DataType as a number of 8-bit bytes.
That would answer the question if DataTypeComponent
were indeed a DataType
, but unfortunately it is not. So, the semantics of DataTypeComponent.getLength
are still uncertain. 🫤
I verified that the way DataTypeComponent
's length is set using, in some cases, the data type's length. This signaled that it is indeed byte-based.