# Empty `[workspace]` table marks this crate as the root of its own
# (single-crate) workspace, isolating it from any parent workspace it
# might happen to live inside during development. When copied out to a
# standalone repo this line becomes a harmless no-op — no edits needed.
[workspace]

[package]
name = "pe-sigscan"
version = "0.3.0"
edition = "2021"
rust-version = "1.70"
authors = ["H0llyW00dzZ"]
description = "Fast in-process byte-pattern (signature) scanning over the .text and other executable sections of a loaded PE module on Windows. Supports IDA-style wildcard patterns."
license = "MIT OR Apache-2.0"
repository = "https://github.com/H0llyW00dzZ/pe-sigscan"
documentation = "https://docs.rs/pe-sigscan"
readme = "README.md"
keywords = ["pe", "signature", "windows", "reverse-engineering", "ida"]
categories = ["os::windows-apis", "memory-management", "no-std"]

[lib]
# Pure-Rust library, no special crate-type. Consumers can pull this into
# both `dylib`s (game-mod cdylibs) and regular `bin`s (offline analysers).

[features]
# Default: opt into `std` for `std::error::Error` on `ParsePatternError`.
# Disable with `default-features = false` to keep the crate fully `no_std`
# (the only API loss is the `Error` trait impl; the error type itself
# still implements `Display` via `core::fmt`).
default = ["std"]
std = []

# Optional: use the `memchr` crate for SIMD-accelerated first-byte search.
# Without this feature the scanner falls back to a portable SWAR (8-byte
# chunked) search written in pure no_std Rust. Both paths are correct;
# `memchr` is just faster on hot paths in benchmarks.
memchr = ["dep:memchr"]

# Optional: section-targeted scanners. Pure-additive on top of the
# always-available scanning APIs.
#
# Adds these public items at the crate root:
#   - `find_in_section(module_base, section_name, pattern)`
#   - `count_in_section(module_base, section_name, pattern)`
#   - `iter_in_section(module_base, section_name, pattern)`
#
# Same shape as the headline `find_in_text` / `find_in_exec_sections`
# / `count_*` / `iter_*` family but takes a section name as a
# parameter, letting callers scan inside `.rdata`, `.pdata`,
# `.text$mn`, etc. Internally the section lookup goes through the
# crate-private `crate::pe::find_section` helper — no new walking
# logic, just a section name parameter on the existing scanners.
#
# Off by default so callers who only need the four headline scanners
# aren't compiling code they don't use. Enabling this feature does
# not alter any always-available code path.
#
# Note: `module_size` (useful for cross-module rel32 range checks)
# is always available and not tied to this feature.
section-info = []

[dependencies]
# Intentionally none by default. PE header parsing + byte search are pure
# compute. Keeping the crate's MSRV low and footprint minimal — the entire
# library compiles in well under a second on any platform.
#
# `memchr` is gated behind the optional `memchr` feature: enabling it gives
# a SIMD-accelerated first-byte search on x86_64 and aarch64 when the
# scanner is run against a `&[u8]` slice (the in-process raw-pointer path
# always uses the portable SWAR fallback).
memchr = { version = "2", default-features = false, features = ["alloc"], optional = true }

[dev-dependencies]
# Only required for `cargo bench` — the test suite uses the standard
# library's built-in test harness and does not need criterion.
# Note: dev-deps are not resolved by `cargo build`/`cargo check`, so
# they do not affect the crate's MSRV (1.70).
criterion = { version = "0.8.2", features = ["html_reports"] }

[[bench]]
name = "scan"
harness = false

[lints.clippy]
# Library code targets a wider audience than `cs2_internal`, so we keep
# clippy at default-deny for `pedantic` items the rest of the workspace
# allows. None active right now; placeholder for future tightening.
