-
Rust toolchain (1.70+)
# Install rustup from https://rustup.rs rustup install stable rustup default stable
-
Python (3.8+) - for bindings
# Check Python version python --version
-
Git
git --version
-
Clone the repository:
git clone https://github.com/nodasys/inspectra.git cd inspectra
-
Build the core:
cargo build
-
Run tests:
cargo test
-
Run examples:
cargo run --example list_processes
inspectra/
├── core/ # Core Rust library
│ ├── src/
│ │ ├── lib.rs # Main library entry
│ │ ├── error.rs # Error types
│ │ ├── types.rs # Common types
│ │ ├── process/ # Process management
│ │ ├── memory/ # Memory operations
│ │ ├── scanner/ # Memory scanning
│ │ ├── pointer/ # Pointer analysis
│ │ ├── debugger/ # Debugging & patching
│ │ └── platform/ # Platform-specific code
│ └── examples/ # Usage examples
│
├── bindings/
│ └── python/ # Python bindings
│ ├── src/ # Rust FFI code
│ ├── inspectra/ # Python package
│ └── examples/ # Python examples
│
├── tests/ # Integration tests
├── docs/ # Documentation
├── scripts/ # Build scripts
└── .github/workflows/ # CI/CD
git checkout -b feat/your-featureEdit code in your IDE (VS Code recommended with rust-analyzer).
cargo fmtcargo clippy --all-targets --all-features -- -D warningscargo test --all# Debug build
cargo build
# Release build
cargo build --releasecargo run --example list_processes
cargo run --example memory_scanner
cargo run --example pattern_scancd bindings/python
pip install maturin# Build and install in development mode
maturin develop
# Test
python examples/list_processes.pymaturin build --release# Run all tests
cargo test
# Run specific test
cargo test test_process_listing
# Run with output
cargo test -- --nocapturecargo test --test integration_tests# Install tarpaulin
cargo install cargo-tarpaulin
# Generate coverage
cargo tarpaulin --verbose --all-features --workspaceUse VS Code with rust-analyzer:
- Set breakpoints in code
- F5 to start debugging
Enable logging:
$env:RUST_LOG="debug"
cargo run --example list_processes- Create file in
core/src/your_module.rs - Add
pub mod your_module;tolib.rs - Export public items in
lib.rs - Write tests
- Update documentation
# Check for outdated dependencies
cargo outdated
# Update dependencies
cargo update# Install cargo-audit
cargo install cargo-audit
# Run audit
cargo auditcargo benchUse tools like:
- Windows: Visual Studio Profiler, Windows Performance Analyzer
- Linux: perf, valgrind
- Cross-platform: cargo-flamegraph
cargo doc --no-deps --openUse Rust doc comments:
/// This function does something
///
/// # Examples
///
/// ```
/// use inspectra_core::example;
/// example();
/// ```
pub fn example() {
// ...
}GitHub Actions automatically:
- Runs tests on Windows, Linux, macOS
- Checks formatting
- Runs Clippy
- Generates coverage report
View results in the Actions tab on GitHub.
- Use
cargo checkfor fast compilation checks - Use
cargo watchfor continuous compilation - Enable all Clippy lints during development
- Write tests first (TDD)
- Document public APIs thoroughly
- Handle errors properly - don't panic!
Make sure to run with administrator privileges:
# Run PowerShell as Administrator
Start-Process powershell -Verb runAsUse ptrace permissions:
echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scopeReinstall in development mode:
cd bindings/python
pip uninstall inspectra
maturin develop --release