You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: rust/src/architecture.rs
+72-26Lines changed: 72 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -12,9 +12,12 @@
12
12
// See the License for the specific language governing permissions and
13
13
// limitations under the License.
14
14
15
-
//! Architectures provide disassembly, lifting, and associated metadata about a CPU to inform analysis and decompilation.
15
+
//! Architectures provide disassembly, lifting, and associated metadata about a CPU to inform
16
+
//! analysis and decompilation.
17
+
//!
18
+
//! For more information see the [`Architecture`] trait and the [`CoreArchitecture`] structure for
19
+
//! querying already registered architectures.
16
20
17
-
// container abstraction to avoid Vec<> (want CoreArchFlagList, CoreArchRegList)
18
21
// RegisterInfo purge
19
22
use binaryninjacore_sys::*;
20
23
use std::fmt::{Debug,Formatter};
@@ -91,6 +94,16 @@ macro_rules! new_id_type {
91
94
};
92
95
}
93
96
97
+
/// The [`Architecture`] trait is the backbone of Binary Ninja's analysis capabilities. It tells the
98
+
/// core how to interpret the machine code into LLIL, a generic intermediate representation for
99
+
/// program analysis.
100
+
///
101
+
/// To add support for a new Instruction Set Architecture (ISA), you must implement this trait and
102
+
/// register it. The core analysis loop relies on your implementation for three critical stages:
103
+
///
104
+
/// 1. **Disassembly ([`Architecture::instruction_text`])**: Machine code into human-readable text (e.g., `55` -> `push rbp`).
105
+
/// 2. **Control Flow Analysis ([`Architecture::instruction_info`])**: Identifying where execution goes next (e.g., "This is a `call` instruction, it targets address `0x401000`").
106
+
/// 3. **Lifting ([`Architecture::instruction_llil`])**: Translating machine code into **Low Level Intermediate Language (LLIL)**, which enables decompilation and automated analysis.
0 commit comments