Meaning of Rust ABI / CM_CC_RUST / __rust

I noticed that in the last few releases of IDA, there’s been mention in the release notes of a “Rust ABI”

However, I couldn’t find a description in the IDA docs of how this calling convention works. I am curious about it, as I would like to evaluate using IDA for reversing Rust binaries. Also, as far as I understand it, the primary issue with Rust binaries is that Rust to Rust code doesn’t have a stable ABI, and the current implementation of the ABI in the Rust compiler isn’t really documented or guaranteed. This is in contrast to Go, which has an ABI that is technically unstable, but which is versioned and documented (i.e. if ABIInternal ever changes, they will freeze the current implementation of ABIInternal and call it something different, as they did with ABI0).

What is the definition of the CM_CC_RUST / __rust calling convention right now? Thanks in advance.

Hi, you’re right: Rust has no stable ABI, and we don’t have a written definition of __rust at the moment. We support the Rust calling convention based on a subset that covers most cases and doesn’t change significantly from version to version, although it still changes.

Ideally, we should detect the Rust version more precisely and take it into account when applying the calling convention to functions, so this is a possible area for improvement.

Which parts of the CC are most relevant to your evaluation? We’ll pass them on to the team.

Thanks for bringing this up!