How parksnoopy/sgb_unlimiter works
Project type and purpose
• From the README (“사지방 제한 해제 프로그램”) and platform support (x86_64 Windows), this is a small Rust-based CLI/tool that lifts or bypasses certain system-level restrictions (likely Windows process or privilege restrictions). It is not a full-stack web app but a system utility.
File structure
• Top-level:
• Cargo.toml / .cargo/ / build.rs — Rust project configuration and custom build script
• src/ — all core logic
• src modules:
• config.rs — reading/parsing configuration
• decode.rs — decoding input or encoded policies
• error.rs — unified error types & handling
• privilige.rs — (privilege) Windows privilege elevation logic
• process.rs — process enumeration or manipulation
• state.rs — internal state machine or execution state
• main.rs — orchestrates the above modules
• assets/ — any static payloads or resource files used at runtime
README for additional insights
• Minimal README; no explicit architecture notes beyond purpose. No external services.
a. Main components:
1. CLI Entrypoint (main.rs)
2. Config Loader (config.rs)
3. Decoder (decode.rs)
4. Privilege Manager (privilige.rs)
5. Process Controller (process.rs)
6. State Manager (state.rs)
7. Error Handler (error.rs)
8. External OS APIs (Windows Kernel APIs)
9. Assets (assets/)
b. Relationships & data flow:
1. User invokes binary → CLI Entrypoint module
2. Entrypoint calls Config Loader → yields configuration struct
3. Config passed to Decoder → produces decoded settings or rules
4. Entrypoint invokes Privilege Manager → requests elevated rights
5. With elevated rights, Process Controller enumerates/attaches to target processes
6. State Manager tracks current progress and transitions between “unlocked” vs. “locked” states
7. All modules propagate errors to Error Handler → final error reporting/exit code
8. Asset files read by Config Loader or Decoder as needed
9. All OS calls go through Windows API boundary
c. Architectural patterns / design principles:
• Modular decomposition: each major concern isolated in its own module
• Single responsibility per module (config, decode, privilege, etc.)
• Central error-handling abstraction
• Pipeline / sequential flow managed by main.rs
d. Key technologies & libraries:
• Rust (stable channel), Cargo build system
• build.rs for any compile-time codegen or embedding assets
• Windows-specific FFI (winapi or windows-rs crate)
2. Below it, in a vertical pipeline, arrange: Config Loader → Decoder → Privilege Manager → Process Controller → State Manager.