Skip to main content

idakit_sys/
lib.rs

1//! Raw FFI bindings to IDA's idalib runtime and the idakit C++ facade.
2//!
3//! The declarations are split into per-domain source modules (`runtime`, `function`, `bytes`,
4//! `hexrays`, ...) that mirror the facade's translation units, but every item is re-exported
5//! flat at the crate root, so the public surface is a single namespace
6//! (`idakit_sys::idakit_get_bytes`, `idakit_sys::EmitVtbl`), not a module hierarchy. There are
7//! no safe wrappers here; those belong in `idakit`.
8//!
9//! # Buffer conventions
10//!
11//! Functions that accept `(*mut c_char, cap: usize)` copy the value into the
12//! caller-supplied buffer and NUL-terminate within `cap` bytes. The return value
13//! is the full source length, which may exceed `cap` when the output was
14//! truncated. A negative return value means the query failed (missing symbol,
15//! null handle, etc.).
16//!
17//! # Owned handles
18//!
19//! `idakit_binpat_compile` returns an opaque `*mut c_void` handle owned by the caller,
20//! released with its matching `idakit_binpat_free`. Passing a handle to any other function
21//! after release is undefined behaviour.
22#![deny(
23    rustdoc::broken_intra_doc_links,
24    rustdoc::private_intra_doc_links,
25    rustdoc::invalid_codeblock_attributes,
26    rustdoc::invalid_html_tags,
27    rustdoc::invalid_rust_codeblocks,
28    rustdoc::bare_urls,
29    rustdoc::unescaped_backticks,
30    rustdoc::redundant_explicit_links
31)]
32
33/// IDA's effective address (`ea_t`), compiled `__EA64__`.
34pub type Address = u64;
35/// The invalid-address sentinel (`BADADDR`); every `Address`-returning facade call uses it for
36/// "no address".
37pub const BADADDR: Address = u64::MAX;
38
39mod bridge_cfg2;
40#[cfg(feature = "test-shims")]
41mod bridge_cfunc;
42mod bridge_gen;
43#[cfg(feature = "test-shims")]
44mod bridge_probe;
45#[cfg(feature = "test-shims")]
46mod bridge_probe_ext;
47mod bridge_qvec;
48mod bridge_typewalk;
49mod bytes;
50mod cfg;
51mod frame;
52mod function;
53mod hexrays;
54mod instruction;
55mod name;
56mod runtime;
57mod segment;
58mod strings;
59mod ty;
60mod ty_build;
61
62pub use bridge_cfg2::*;
63#[cfg(feature = "test-shims")]
64pub use bridge_cfunc::*;
65pub use bridge_gen::*;
66#[cfg(feature = "test-shims")]
67pub use bridge_probe::*;
68#[cfg(feature = "test-shims")]
69pub use bridge_probe_ext::*;
70pub use bridge_qvec::*;
71pub use bridge_typewalk::*;
72pub use bytes::*;
73pub use cfg::*;
74pub use frame::*;
75pub use function::*;
76pub use hexrays::*;
77pub use instruction::*;
78pub use name::*;
79pub use runtime::*;
80pub use segment::*;
81pub use strings::*;
82pub use ty::*;
83pub use ty_build::*;