Skip to content

Commit

Permalink
Special color for exported symbols
Browse files Browse the repository at this point in the history
Imports have their own color, so exports can too
  • Loading branch information
CouleeApps committed Nov 17, 2023
1 parent c798413 commit 7259170
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions binaryninjacore.h
Original file line number Diff line number Diff line change
Expand Up @@ -1798,6 +1798,7 @@ extern "C"
DataSymbolColor,
StackVariableColor,
ImportColor,
ExportColor,
InstructionHighlightColor,
RelatedInstructionHighlightColor,
TokenHighlightColor,
Expand Down
2 changes: 2 additions & 0 deletions examples/triage/exports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ QVariant GenericExportsModel::data(const QModelIndex& index, int role) const
case Qt::ForegroundRole:
if (index.column() == AddressColumn)
return getThemeColor(AddressColor);
if (index.column() == NameColumn)
return getThemeColor(ExportColor);
break;
default:
break;
Expand Down
2 changes: 2 additions & 0 deletions examples/triage/imports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ QVariant GenericImportsModel::data(const QModelIndex& index, int role) const
case Qt::ForegroundRole:
if (index.column() == 0)
return getThemeColor(AddressColor);
if (index.column() == m_nameCol)
return getThemeColor(ImportColor);
break;
default:
break;
Expand Down
1 change: 1 addition & 0 deletions themes/dark-blue.theme
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
"dataSymbolColor": "cyan",
"stackVariableColor": ["+", "green", "content"],
"importColor": "orange",
"exportColor": "magenta",
"instructionHighlightColor": "selectionLight",
"tokenHighlightColor": "red",
"annotationColor": "magenta",
Expand Down
1 change: 1 addition & 0 deletions themes/high-contrast.theme
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
"dataSymbolColor": "cyan",
"stackVariableColor": ["+", "green", "content"],
"importColor": "orange",
"exportColor": "magenta",
"instructionHighlightColor": "selectionLight",
"tokenHighlightColor": "red",
"annotationColor": "red",
Expand Down
1 change: 1 addition & 0 deletions themes/solarized-dark.theme
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"dataSymbolColor": "cyan",
"stackVariableColor": "violet",
"importColor": "orange",
"exportColor": "magenta",
"instructionHighlightColor": "secondary",
"tokenHighlightColor": ["+", "secondary", "orange"],
"annotationColor": "magenta",
Expand Down
1 change: 1 addition & 0 deletions themes/solarized-light.theme
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"dataSymbolColor": "cyan",
"stackVariableColor": "violet",
"importColor": "orange",
"exportColor": "violet",
"instructionHighlightColor": "secondary",
"tokenHighlightColor": ["+", "secondary", "orange"],
"annotationColor": "magenta",
Expand Down
2 changes: 2 additions & 0 deletions ui/theme.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ void BINARYNINJAUIAPI addJsonTheme(const char* json);
QColor BINARYNINJAUIAPI getThemeColor(BNThemeColor color);
QColor BINARYNINJAUIAPI getTokenColor(QWidget* widget, BNInstructionTextTokenType token);
QColor BINARYNINJAUIAPI getTypeClassColor(const QWidget* widget, BNTypeClass typeClass);
std::optional<QColor> BINARYNINJAUIAPI getSymbolColor(SymbolRef symbol);
std::optional<QColor> BINARYNINJAUIAPI getSymbolColor(BNSymbolType type, BNSymbolBinding binding);

QColor BINARYNINJAUIAPI avgColor(QColor a, QColor b);
QColor BINARYNINJAUIAPI mixColor(QColor a, QColor b, uint8_t mix);
Expand Down

0 comments on commit 7259170

Please sign in to comment.