diff options
| author | Rusty Wagner <rusty.wagner@gmail.com> | 2024-01-04 10:55:56 -0700 |
|---|---|---|
| committer | Rusty Wagner <rusty.wagner@gmail.com> | 2024-01-04 12:42:14 -0700 |
| commit | e27a7226a23f0276360542a69570e58b0edc9747 (patch) | |
| tree | ae2a49a42a7a05aa2c4ef4e58d4de9d00e1164b1 | |
| parent | 5a2d058c381a5fa0889464772b7399df2f39ebe8 (diff) | |
Add local label symbol type to always prioritize normal local symbols over compiler generated labels
| -rw-r--r-- | binaryninjaapi.h | 1 | ||||
| -rw-r--r-- | binaryninjacore.h | 3 | ||||
| -rw-r--r-- | docs/dev/annotation.md | 1 | ||||
| -rw-r--r-- | python/binaryview.py | 2 | ||||
| -rw-r--r-- | python/types.py | 1 | ||||
| -rw-r--r-- | rust/src/symbol.rs | 3 |
6 files changed, 9 insertions, 2 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 10a9b556..9200b3c1 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -3302,6 +3302,7 @@ namespace BinaryNinja { ExternalSymbol Symbols for data and code that reside outside the BinaryView LibraryFunctionSymbol Symbols for functions identified as belonging to a shared library SymbolicFunctionSymbol Symbols for functions without a concrete implementation or which have been abstractly represented + LocalLabelSymbol Symbol for a local label in the current binary =========================== ================================================================= \return Symbol type diff --git a/binaryninjacore.h b/binaryninjacore.h index 4b5ce20f..1c790796 100644 --- a/binaryninjacore.h +++ b/binaryninjacore.h @@ -432,7 +432,8 @@ extern "C" ImportedDataSymbol = 4, ExternalSymbol = 5, LibraryFunctionSymbol = 6, - SymbolicFunctionSymbol = 7 + SymbolicFunctionSymbol = 7, + LocalLabelSymbol = 8, } BNSymbolType; typedef enum BNSymbolBinding diff --git a/docs/dev/annotation.md b/docs/dev/annotation.md index 0f22de4c..d952baa6 100644 --- a/docs/dev/annotation.md +++ b/docs/dev/annotation.md @@ -43,6 +43,7 @@ Valid symbol types [include](https://api.binary.ninja/binaryninja.enums.SymbolTy | ExternalSymbol | Symbols for data and code that reside outside the BinaryView | | LibraryFunctionSymbol | Symbols for functions identified as belonging to a shared library | | SymbolicFunctionSymbol | Symbols for functions without a concrete implementation or which have been abstractly represented| +| LocalLabelSymbol | Symbol for a local label in the current binary | ## Tags diff --git a/python/binaryview.py b/python/binaryview.py index 79204942..8d72d94e 100644 --- a/python/binaryview.py +++ b/python/binaryview.py @@ -5293,7 +5293,7 @@ class BinaryView: ordered_filter = [ SymbolType.FunctionSymbol, SymbolType.ImportedFunctionSymbol, SymbolType.LibraryFunctionSymbol, SymbolType.SymbolicFunctionSymbol, SymbolType.DataSymbol, SymbolType.ImportedDataSymbol, SymbolType.ImportAddressSymbol, - SymbolType.ExternalSymbol + SymbolType.ExternalSymbol, SymbolType.LocalLabelSymbol ] _namespace = _types.NameSpace.get_core_struct(namespace) diff --git a/python/types.py b/python/types.py index 87e092bb..3aea1fca 100644 --- a/python/types.py +++ b/python/types.py @@ -398,6 +398,7 @@ class Symbol(CoreSymbol): ExternalSymbol Symbols for data and code that reside outside the BinaryView LibraryFunctionSymbol Symbols for functions identified as belonging to a shared library SymbolicFunctionSymbol Symbols for functions without a concrete implementation or which have been abstractly represented + LocalLabelSymbol Symbol for a local label in the current binary =========================== ================================================================= """ def __init__( diff --git a/rust/src/symbol.rs b/rust/src/symbol.rs index bb9d157e..c2b1fd4c 100644 --- a/rust/src/symbol.rs +++ b/rust/src/symbol.rs @@ -33,6 +33,7 @@ pub enum SymbolType { ImportedData, External, Symbolic, + LocalLabel, } impl From<BNSymbolType> for SymbolType { @@ -48,6 +49,7 @@ impl From<BNSymbolType> for SymbolType { ImportedDataSymbol => SymbolType::ImportedData, ExternalSymbol => SymbolType::External, SymbolicFunctionSymbol => SymbolType::Symbolic, + LocalLabelSymbol => SymbolType::LocalLabel, } } } @@ -65,6 +67,7 @@ impl From<SymbolType> for BNSymbolType { SymbolType::ImportedData => ImportedDataSymbol, SymbolType::External => ExternalSymbol, SymbolType::Symbolic => SymbolicFunctionSymbol, + SymbolType::LocalLabel => LocalLabelSymbol, } } } |
