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;
40mod bridge_cfunc;
41mod bridge_gen;
42mod bridge_probe;
43mod bridge_probe_ext;
44mod bridge_qvec;
45mod bridge_typewalk;
46mod bytes;
47mod cfg;
48mod frame;
49mod function;
50mod hexrays;
51mod instruction;
52mod name;
53mod runtime;
54mod segment;
55mod strings;
56mod ty;
57mod ty_build;
58
59pub use bridge_cfg2::*;
60#[doc(hidden)]
61pub use bridge_cfunc::*;
62pub use bridge_gen::*;
63#[doc(hidden)]
64pub use bridge_probe::*;
65#[doc(hidden)]
66pub use bridge_probe_ext::*;
67pub use bridge_qvec::*;
68pub use bridge_typewalk::*;
69pub use bytes::*;
70pub use cfg::*;
71pub use frame::*;
72pub use function::*;
73pub use hexrays::*;
74pub use instruction::*;
75pub use name::*;
76pub use runtime::*;
77pub use segment::*;
78pub use strings::*;
79pub use ty::*;
80pub use ty_build::*;