Skip to content

add a handful of features and some testing#46

Open
williballenthin wants to merge 50 commits intoidalib-rs:masterfrom
williballenthin:idalib-rs-capa-features
Open

add a handful of features and some testing#46
williballenthin wants to merge 50 commits intoidalib-rs:masterfrom
williballenthin:idalib-rs-capa-features

Conversation

@williballenthin
Copy link

This PR adds a handful of features that are useful for porting capa to Rust (local experiment).

Perhaps more interestingly, it proposes a testing mechanism. I found that using the default test harness didn't work with idalib-rs, because IDA has to be used from the main thread, and the test harness spawns tests on worker threads. But, with custom test binaries, we can still develop and run tests, with just a bit more effort. Let me know what you think.

@williballenthin williballenthin force-pushed the idalib-rs-capa-features branch 4 times, most recently from fd88c74 to 1019108 Compare September 9, 2025 09:00
@xorpse xorpse self-requested a review September 9, 2025 23:20
@xorpse xorpse added the v0.8.0 Feature part of v0.8.0 release label Sep 12, 2025
@williballenthin williballenthin force-pushed the idalib-rs-capa-features branch from ff72393 to ea48de4 Compare November 3, 2025 14:26
@williballenthin
Copy link
Author

@xorpse for my awareness, is this PR on track to be included in a future release? i'd like to write a few local utilities, and i'm not sure if i should prepare to keep using my fork, or the upstream crate.

unsafe { idalib_get_disasm_line(autocxx::c_ulonglong(self.inner.ea)) }
}

pub fn print_operand(&self, n: usize) -> String {
Copy link
Member

@xorpse xorpse Jan 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should ensure the index is valid, not just return a String for any index. In any case, let's move this to be a method on Operand itself, i.e., via Debug or Display, etc.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moving formatting into Display on Operand requires operand to gain a new field to track the ea, and therefore not transparent. does that work for you?

@williballenthin
Copy link
Author

thanks for the thorough review @xorpse! happy to address these comments and i'll ping you when they're handled.

@williballenthin
Copy link
Author

please take a look at 64ccba6 that adds Display for insn and operand. For operand, this requires adding a new ea field to the struct, which changes its layout. Does that work for you?

@xorpse
Copy link
Member

xorpse commented Feb 3, 2026

please take a look at 64ccba6 that adds Display for insn and operand. For operand, this requires adding a new ea field to the struct, which changes its layout. Does that work for you?

That sounds fine to me :), thanks for fixing everything--I think we'd also need to add make sure that Operand and Insn are scoped to the IDB as we do with other types, otherwise we'd be able to call idalib_get_disasm_line on a different or closed database

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v0.8.0 Feature part of v0.8.0 release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants