Skip to content

Commit f771c36

Browse files
committed
Addressing Peter's feedback.
1 parent 55fd743 commit f771c36

5 files changed

Lines changed: 16 additions & 3 deletions

File tree

binaryninjaapi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11217,6 +11217,7 @@ namespace BinaryNinja {
1121711217
Confidence<bool> IsConst() const;
1121811218
Confidence<bool> IsVolatile() const;
1121911219
bool IsSystemCall() const;
11220+
BNIntegerDisplayType GetIntegerTypeDisplayType() const;
1122011221
void SetIntegerTypeDisplayType(BNIntegerDisplayType displayType);
1122111222

1122211223
Confidence<Ref<Type>> GetChildType() const;

docs/guide/migration/migrationguideida.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Some major exceptions are:
4444
- `T` for Types
4545
- `H` to toggle to/from Hex View
4646
- `[TAB]` to toggle to/from disassembly
47-
- IDA's `H` hotkey toggles integer display between hexadecimal and decimal. In Binary Ninja, `H` opens the Hex View and `0` toggles integer display between hexadecimal and decimal.
47+
- `0` toggles integer display between hexadecimal and decimal, which is `H` in IDA
4848

4949
## Cross-References
5050

docs/guide/types/basictypes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ the name of a type will take you to its definition.
112112
* **Type > Make 16-bit Integer** - Create `uint16_t` members in selection
113113
* **Type > Make 32-bit Integer** - Create `uint32_t` members in selection
114114
* **Type > Make 64-bit Integer** - Create `uint64_t` members in selection
115-
* **Type > Invert Integer Sign** - Toggle integer signedness, e.g. between `uint8_t` and `int8_t`
115+
* **Type > Toggle Integer Signedness** - Toggle integer signedness, e.g. between `uint8_t` and `int8_t`
116116
* **Type > Cycle Integer Size** - Change integer member size in order: `uint8_t`, `uint16_t`, `uint32_t`, `uint64_t`
117117
* **Type > Make 32-bit Float** - Create `float` members in selection
118118
* **Type > Make 64-bit Float** - Create `double` members in selection

rust/src/types.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,10 @@ impl TypeBuilder {
194194
unsafe { BNIsTypeBuilderSigned(self.handle).into() }
195195
}
196196

197+
pub fn integer_display_type(&self) -> IntegerDisplayType {
198+
self.finalize().integer_display_type()
199+
}
200+
197201
pub fn is_const(&self) -> Conf<bool> {
198202
unsafe { BNIsTypeBuilderConst(self.handle).into() }
199203
}

type.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1598,6 +1598,15 @@ Confidence<bool> TypeBuilder::IsVolatile() const
15981598
}
15991599

16001600

1601+
BNIntegerDisplayType TypeBuilder::GetIntegerTypeDisplayType() const
1602+
{
1603+
BNType* type = BNFinalizeTypeBuilder(m_object);
1604+
BNIntegerDisplayType result = BNGetIntegerTypeDisplayType(type);
1605+
BNFreeType(type);
1606+
return result;
1607+
}
1608+
1609+
16011610
void TypeBuilder::SetIntegerTypeDisplayType(BNIntegerDisplayType displayType)
16021611
{
16031612
BNSetIntegerTypeDisplayType(m_object, displayType);
@@ -3442,4 +3451,3 @@ fmt::format_context::iterator fmt::formatter<BinaryNinja::Type>::format(
34423451
return fmt::format_to(ctx.out(), "{}{}", obj.GetStringBeforeName(), obj.GetStringAfterName());
34433452
}
34443453
}
3445-

0 commit comments

Comments
 (0)