# natimerry/glazier architecture

> Architecture diagram of the GitHub repository natimerry/glazier, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/natimerry/glazier
- Repository: https://github.com/natimerry/glazier

## Overview

Glazier is an experimental Windows PE analysis and process-interaction library. A user can parse a PE from disk or inspect a running process: static parsing exposes headers, sections, imports, and exports, while runtime helpers inspect processes, memory, and loaded-module exports. Separate capabilities support pattern scanning and hooks, hardware breakpoints, dynamically resolved APIs, and direct syscalls. The graph reflects README-described capabilities where source excerpts were unavailable; links for those unsampled implementations are limited to paths supported by the tree and README.

Main entry points: [`crates/runtime/src/runtime/pe64_runtime.rs`](https://github.com/natimerry/glazier/blob/master/crates/runtime/src/runtime/pe64_runtime.rs) (Runtime PE), [`crates/runtime/src/lib.rs`](https://github.com/natimerry/glazier/blob/master/crates/runtime/src/lib.rs) (Runtime Helpers), [`src/hooking/mod.rs`](https://github.com/natimerry/glazier/blob/master/src/hooking/mod.rs) (Hooking Support), [`crates/runtime/src/runtime/process.rs`](https://github.com/natimerry/glazier/blob/master/crates/runtime/src/runtime/process.rs) (Process Inspection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pe["PE Analysis"]
  node_static_pe["Static PE Parser<br/>[pe64_static.rs]"]
  node_pe_structures["PE Structures"]
end

subgraph group_runtime["Runtime Inspection"]
  node_runtime_entry["Runtime Helpers<br/>[lib.rs]"]
  node_process["Process Inspection<br/>[process.rs]"]
  node_memory["Memory Access<br/>[memory.rs]"]
  node_runtime_pe["Runtime PE<br/>[pe64_runtime.rs]"]
  node_runtime_exports["Export Walking<br/>[exports.rs]"]
end

subgraph group_instrument["Code Instrumentation"]
  node_pattern["Pattern Scanning<br/>[pattern.rs]"]
  node_hooking["Hooking Support<br/>[mod.rs]"]
  node_instruction_trace["Instruction Tracing"]
  node_hardware_breakpoints["Hardware Breakpoints"]
end

subgraph group_api["API Access"]
  node_raw_bindings["Raw API Bindings<br/>[lib.rs]"]
  node_api_resolver["Dynamic Resolution<br/>[resolver.rs]"]
  node_winapi_wrappers["Win32 NT Wrappers<br/>[lib.rs]"]
  node_syscall["Direct Syscalls<br/>[lib.rs]"]
end

node_user(("Library User"))
node_os(("Windows System"))
node_pe_file["PE File"]
node_target_process(("Target Process"))

node_user -->|"parses"| node_static_pe
node_pe_file -->|"reads"| node_static_pe
node_static_pe -->|"parses headers"| node_pe_structures
node_user -->|"uses"| node_runtime_entry
node_runtime_entry -->|"exposes"| node_process
node_runtime_entry -->|"exposes"| node_memory
node_runtime_entry -->|"exposes"| node_runtime_pe
node_process -->|"queries"| node_os
node_memory -->|"reads and writes"| node_os
node_runtime_pe -->|"reads"| node_memory
node_runtime_pe -->|"inspects"| node_process
node_runtime_pe -->|"walks exports"| node_runtime_exports
node_target_process -->|"is inspected"| node_process
node_user -->|"scans"| node_pattern
node_user -->|"installs hooks"| node_hooking
node_hooking -->|"patches"| node_memory
node_hooking -->|"locates targets"| node_pattern
node_hooking -.->|"uses tracing"| node_instruction_trace
node_user -->|"sets breakpoints"| node_hardware_breakpoints
node_hardware_breakpoints -->|"configures"| node_os
node_raw_bindings -->|"declares APIs"| node_os
node_user -->|"calls APIs"| node_winapi_wrappers
node_winapi_wrappers -.->|"resolves dynamically"| node_api_resolver
node_api_resolver -.->|"locates APIs"| node_os
node_user -->|"invokes"| node_syscall
node_syscall -->|"issues syscall"| node_os
node_runtime_pe -.->|"reads syscall numbers"| node_syscall

click node_static_pe "https://github.com/natimerry/glazier/blob/master/crates/pe/src/pe/pe64_static.rs"
click node_pe_structures "https://github.com/natimerry/glazier/tree/master/crates/pe/src/pe"
click node_runtime_entry "https://github.com/natimerry/glazier/blob/master/crates/runtime/src/lib.rs"
click node_process "https://github.com/natimerry/glazier/blob/master/crates/runtime/src/runtime/process.rs"
click node_memory "https://github.com/natimerry/glazier/blob/master/crates/runtime/src/runtime/memory.rs"
click node_runtime_pe "https://github.com/natimerry/glazier/blob/master/crates/runtime/src/runtime/pe64_runtime.rs"
click node_runtime_exports "https://github.com/natimerry/glazier/blob/master/crates/runtime/src/runtime/exports.rs"
click node_pattern "https://github.com/natimerry/glazier/blob/master/src/hooking/pattern.rs"
click node_hooking "https://github.com/natimerry/glazier/blob/master/src/hooking/mod.rs"
click node_instruction_trace "https://github.com/natimerry/glazier/blob/master/src/hooking/trace_instructions.rs"
click node_hardware_breakpoints "https://github.com/natimerry/glazier/blob/master/src/hardware_breakpoint.rs"
click node_raw_bindings "https://github.com/natimerry/glazier/blob/master/crates/bindings/src/lib.rs"
click node_api_resolver "https://github.com/natimerry/glazier/blob/master/crates/winapi/src/resolver.rs"
click node_winapi_wrappers "https://github.com/natimerry/glazier/blob/master/crates/winapi/src/lib.rs"
click node_syscall "https://github.com/natimerry/glazier/blob/master/crates/winapi/src/lib.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_static_pe,node_pe_structures,node_user toneBlue
class node_runtime_entry,node_process,node_memory,node_runtime_pe,node_runtime_exports toneAmber
class node_pattern,node_hooking,node_instruction_trace,node_hardware_breakpoints toneMint
class node_raw_bindings,node_api_resolver,node_winapi_wrappers,node_syscall toneRose
class node_os,node_pe_file,node_target_process toneIndigo
```

## Components

### PE Analysis

- [Static PE Parser](https://github.com/natimerry/glazier/blob/master/crates/pe/src/pe/pe64_static.rs): `crates/pe/src/pe/pe64_static.rs`
- [PE Structures](https://github.com/natimerry/glazier/tree/master/crates/pe/src/pe): `crates/pe/src/pe`

### Runtime Inspection

- [Runtime Helpers](https://github.com/natimerry/glazier/blob/master/crates/runtime/src/lib.rs): `crates/runtime/src/lib.rs`
- [Process Inspection](https://github.com/natimerry/glazier/blob/master/crates/runtime/src/runtime/process.rs): `crates/runtime/src/runtime/process.rs`
- [Memory Access](https://github.com/natimerry/glazier/blob/master/crates/runtime/src/runtime/memory.rs): `crates/runtime/src/runtime/memory.rs`
- [Runtime PE](https://github.com/natimerry/glazier/blob/master/crates/runtime/src/runtime/pe64_runtime.rs): `crates/runtime/src/runtime/pe64_runtime.rs`
- [Export Walking](https://github.com/natimerry/glazier/blob/master/crates/runtime/src/runtime/exports.rs): `crates/runtime/src/runtime/exports.rs`

### Code Instrumentation

- [Pattern Scanning](https://github.com/natimerry/glazier/blob/master/src/hooking/pattern.rs): `src/hooking/pattern.rs`
- [Hooking Support](https://github.com/natimerry/glazier/blob/master/src/hooking/mod.rs): `src/hooking/mod.rs`
- [Instruction Tracing](https://github.com/natimerry/glazier/blob/master/src/hooking/trace_instructions.rs): `src/hooking/trace_instructions.rs`
- [Hardware Breakpoints](https://github.com/natimerry/glazier/blob/master/src/hardware_breakpoint.rs): `src/hardware_breakpoint.rs`

### API Access

- [Raw API Bindings](https://github.com/natimerry/glazier/blob/master/crates/bindings/src/lib.rs): `crates/bindings/src/lib.rs`
- [Dynamic Resolution](https://github.com/natimerry/glazier/blob/master/crates/winapi/src/resolver.rs): `crates/winapi/src/resolver.rs`
- [Win32 NT Wrappers](https://github.com/natimerry/glazier/blob/master/crates/winapi/src/lib.rs): `crates/winapi/src/lib.rs`
- [Direct Syscalls](https://github.com/natimerry/glazier/blob/master/crates/winapi/src/lib.rs): `crates/winapi/src/lib.rs`

### Other components

- **Library User**
- **Windows System**
- **PE File**
- **Target Process**

## Connections

- Library User → Static PE Parser: parses
- PE File → Static PE Parser: reads
- Static PE Parser → PE Structures: parses headers
- Library User → Runtime Helpers: uses
- Runtime Helpers → Process Inspection: exposes
- Runtime Helpers → Memory Access: exposes
- Runtime Helpers → Runtime PE: exposes
- Process Inspection → Windows System: queries
- Memory Access → Windows System: reads and writes
- Runtime PE → Memory Access: reads
- Runtime PE → Process Inspection: inspects
- Runtime PE → Export Walking: walks exports
- Target Process → Process Inspection: is inspected
- Library User → Pattern Scanning: scans
- Library User → Hooking Support: installs hooks
- Hooking Support → Memory Access: patches
- Hooking Support → Pattern Scanning: locates targets
- Hooking Support → Instruction Tracing: uses tracing
- Library User → Hardware Breakpoints: sets breakpoints
- Hardware Breakpoints → Windows System: configures
- Raw API Bindings → Windows System: declares APIs
- Library User → Win32 NT Wrappers: calls APIs
- Win32 NT Wrappers → Dynamic Resolution: resolves dynamically
- Dynamic Resolution → Windows System: locates APIs
- Library User → Direct Syscalls: invokes
- Direct Syscalls → Windows System: issues syscall
- Runtime PE → Direct Syscalls: reads syscall numbers
