Rust plugin
The binaries produced by the Rust compiler have some peculiarities which make them difficult to analyze, such as:
- non-standard calling conventions
- non-terminated string literals
- unusual name mangling schemeBy default, the Rust plugin is enabled when IDA detects a Rust binary. Detection doesn't need DWARF debug information and also works on stripped binaries. The plugin is enabled if one of the following is true:
an address is named
rust_begin_unwindorrust_eh_personalitythe
rustc-markers are found in read-only data. If the.rodatasegment exists, the search is limited to this segment.names use the legacy or v0 Rust mangling scheme
Calling convention
The Rust plugin sets __rust as the default calling convention of a Rust binary. For details on __rust, see Rust calling convention.
String literal analysis
Rust plugin walks to all addresses in segment with name ending in "__const", ".rodata" or ".rdata" and creates string literals on xref
- on dref, the string literal is set up to the next dref
- on cref, Rust tries to retrieve length from nearby instructions
Arm, Risc-V and pc proc module benefit from thisTo force the string literal detection:
Demangling name
Rust plugin also offers the possibility to configure a demangler library for rust. By default the plugin will use the librustdemangle library that is shipped with IDA. You can disable this feature in 'Edit>Plugin>Rust language helper' or specify another library to use.
See cfg/rust.cfg for the possible options
List of '-Orust' options
Example
This disable the plugin for this session of IDA.
Last updated
Was this helpful?
