First off, thank you for considering contributing to ProcessGhosting! 🎉
- Code of Conduct
- How Can I Contribute?
- Development Setup
- Pull Request Process
- Coding Standards
- Commit Guidelines
- Testing
- Documentation
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to the repository maintainers.
Key Principles:
- Be respectful and inclusive
- Focus on security research and education
- Use this tool only for legal, authorized purposes
- No malicious use or encouraging illegal activities
Before creating bug reports, please check existing issues. When creating a bug report, include:
- Use a clear title that describes the issue
- Describe exact steps to reproduce the problem
- Provide specific examples including code samples
- Describe the behavior you observed and expected
- Include system details (Windows version, architecture, Rust version)
Use the bug report template in GitHub Issues.
Feature suggestions are welcome! Please:
- Check existing feature requests first
- Provide a clear use case for the feature
- Explain how it aligns with the project goals
- Consider security implications
Use the feature request template in GitHub Issues.
Documentation improvements are always appreciated:
- Fix typos or grammar
- Clarify unclear explanations
- Add missing information
- Improve code examples
- Update outdated information
We welcome code contributions! See the sections below for details.
- Rust 1.70.0 or later
- Windows OS (required for testing)
- Git
- Visual Studio Build Tools (for Windows)
# Clone the repository
git clone https://github.com/BlackTechX011/ProcessGhosting-rs.git
cd ProcessGhosting-rs/ProcessGhosting
# Build
cargo build
# Run tests
cargo test
# Run examples
cargo run --example basic_usage
# Build documentation
cargo doc --openProcessGhosting-rs/
├── .github/ # GitHub configuration
│ ├── workflows/ # CI/CD workflows
│ └── ISSUE_TEMPLATE/ # Issue templates
├── ProcessGhosting/ # Main Rust project
│ ├── src/ # Source code
│ │ ├── lib.rs # Library entry point
│ │ ├── ntapi.rs # NT API bindings
│ │ └── ghosting.rs # Core implementation
│ ├── examples/ # Example code
│ ├── Cargo.toml # Package manifest
│ └── README.md # Documentation
└── README.md # Root readme
- Create an issue first to discuss major changes
- Fork the repository
- Create a feature branch from
main - Keep changes focused - one feature/fix per PR
# Create a feature branch
git checkout -b feature/your-feature-name
# Make your changes
# ... edit files ...
# Format code
cargo fmt
# Check for issues
cargo clippy
# Run tests
cargo test
# Build examples
cargo build --examples
# Commit with clear messages
git commit -m "feat: add new feature"
# Push to your fork
git push origin feature/your-feature-name- Fill out the PR template completely
- Link related issues using keywords (Fixes #123)
- Add tests for new functionality
- Update documentation as needed
- Ensure CI passes before requesting review
- Maintainers will review within 3-5 business days
- Address feedback in new commits
- Once approved, maintainers will merge
- Your contribution will be credited
Follow the official Rust Style Guide.
Key Points:
- Use
cargo fmtfor formatting - Run
cargo clippyand fix all warnings - Use meaningful variable and function names
- Add doc comments for public APIs
- Keep functions focused and small
// 1. Imports
use std::fs;
use process_ghosting::GhostingBuilder;
// 2. Constants
const MAX_SIZE: usize = 1024;
// 3. Types/Structs
pub struct MyStruct {
field: String,
}
// 4. Implementations
impl MyStruct {
pub fn new() -> Self {
// ...
}
}
// 5. Functions
pub fn my_function() {
// ...
}All public APIs must have documentation:
/// Brief description of the function
///
/// More detailed explanation if needed.
///
/// # Arguments
///
/// * `arg1` - Description of arg1
/// * `arg2` - Description of arg2
///
/// # Returns
///
/// Description of return value
///
/// # Errors
///
/// When this function returns an error
///
/// # Examples
///
/// ```
/// use process_ghosting::my_function;
///
/// let result = my_function(arg1, arg2);
/// ```
pub fn my_function(arg1: &str, arg2: usize) -> Result<(), String> {
// implementation
}- Use
Result<T, String>for operations that can fail - Provide descriptive error messages
- Don't panic in library code (except for truly unrecoverable errors)
// Good
if payload.is_empty() {
return Err("Payload cannot be empty".to_string());
}
// Avoid
assert!(!payload.is_empty(), "Payload empty!"); // Don't panic- Minimize use of
unsafecode - Document all
unsafeblocks with safety comments - Ensure memory safety around FFI calls
unsafe {
// SAFETY: ptr is guaranteed to be valid because...
std::ptr::write(ptr, value);
}Use conventional commits format:
type(scope): subject
body (optional)
footer (optional)
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting)refactor: Code refactoringperf: Performance improvementstest: Adding or updating testsbuild: Build system changesci: CI configuration changeschore: Other changes (dependencies, etc.)
# Good commit messages
feat(api): add support for ARM64 architecture
fix(ghosting): handle empty payload error correctly
docs(readme): update installation instructions
test(builder): add tests for hex parsing
# Bad commit messages (avoid these)
fix bug
update stuff
WIP
asdfasdf- Keep commits atomic (one logical change per commit)
- Write clear, descriptive messages
- Reference issues in commit messages
- Use present tense ("add feature" not "added feature")
# Run all tests
cargo test
# Run specific test
cargo test test_name
# Run with output
cargo test -- --nocapture
# Run with backtrace
RUST_BACKTRACE=1 cargo test#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_feature() {
let result = my_function();
assert!(result.is_ok());
}
#[test]
fn test_error_case() {
let result = my_function_with_error();
assert!(result.is_err());
}
}- Add tests for new features
- Update tests when changing behavior
- Aim for good test coverage
- Test both success and failure cases
- Test edge cases and boundary conditions
-
API Documentation (in code)
- Use
///for doc comments - Include examples in doc tests
- Document all public items
- Use
-
README
- Keep up-to-date with features
- Include clear examples
- Update installation instructions
-
Examples
- Provide working code samples
- Include comments explaining steps
- Keep examples simple and focused
-
CHANGELOG
- Document all changes
- Follow Keep a Changelog format
- Update with each release
# Build and open docs
cargo doc --open
# Check for doc warnings
cargo doc --no-deps 2>&1 | grep warning- Questions? Open a GitHub Discussion
- Found a bug? Create an issue
- Need clarification? Comment on relevant issues/PRs
- Want to chat? Reach out to maintainers
Contributors will be:
- Listed in CHANGELOG.md
- Mentioned in release notes
- Added to GitHub contributors list
Important: This project is for educational and authorized security research only.
By contributing, you agree:
- ✅ Your contributions are for legal purposes
- ✅ You will not add features that facilitate malicious use
- ✅ You have the right to submit your code
- ✅ Your code is licensed under MIT
- ✅ You follow responsible disclosure for security issues
Prohibited Contributions:
- ❌ Features designed for malicious use
- ❌ Code that enables unauthorized access
- ❌ Bypassing security without disclosure
- ❌ Anything illegal or unethical
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to ProcessGhosting! 🙏
Questions? Feel free to ask in issues or discussions.
BlackTechX