# palmoff/fm_dylib_checker architecture

> Architecture diagram of the GitHub repository palmoff/fm_dylib_checker, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/palmoff/fm_dylib_checker
- Repository: https://github.com/palmoff/fm_dylib_checker

## Overview

##### Project Type and Purpose
- This is a native macOS desktop application built with Xcode (Swift, Cocoa/AppKit).
- Purpose: scan installed FileMaker Pro runtimes/versions on the user’s Mac to detect known dylib hijack vulnerabilities and present the results in a GUI table.

##### File Structure
- Top-level Xcode project: `FM_dylib_checker.xcodeproj` contains build settings, schemes, workspace data.
- Source directory `FM_dylib_checker/`:
- AppDelegate.swift – application lifecycle
- ViewController.swift – main UI logic for scanning and displaying results
- Main.storyboard – UI layout (buttons, table view for output)
- FM_dylib_checker.entitlements – sandbox or file-access entitlements
- Release artifacts under `release/` (built `.dmg`).

##### Additional Insights from README
- No external back-end: all scanning is done locally.
- Vulnerability rules are likely encoded in code (e.g., known version ranges, dylib names).
- User workflow: launch App → click “Scan” → see list of FileMaker installations and vulnerability status.

a. Main Components to Model
1. User Interface (ViewController, Storyboard)
2. Application Core / Scan Manager (Swift classes that enumerate FileMaker installs, apply vulnerability rules)
3. File System Access Layer (API calls to locate installed apps, read Info.plist or binary metadata)
4. Vulnerability Rules Module (hard-coded CVE logic or configuration resource)
6. (Optional) Logging/Error Handler
b. Relationships & Data Flow
- User clicks “Scan” (UI) → invokes Scan Manager
- Scan Manager queries File System Access Layer to locate installed FileMaker applications
- For each discovered app, pass its version and dylib list into the Vulnerability Rules Module
- Rules Module returns safe/unsafe status
- Scan Manager aggregates results and hands them to the Output Renderer
- UI displays the results; errors funnel back into a Logger/Error Handler and optionally to a popup alert
c. Architectural Patterns & Principles
- MVC (ViewController = Controller, Storyboard = View, Swift model classes = Model)
- Single monolithic desktop application (no microservices)
- Layered separation: UI layer, business logic layer, data access (file system) layer
d. Key Technologies & Frameworks
- Swift / Cocoa (AppKit)
- Foundation APIs for FileManager and Bundle inspection
- Storyboard and TableView (UI)
- macOS Sandbox entitlements (for file system access)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Application Boundary
    subgraph "macOS Application" 
        direction TB

        %% UI Layer
        subgraph "UI Layer"
            direction TB
            AD["AppDelegate"]:::ui
            VC["ViewController"]:::ui
            SB["Main.storyboard"]:::ui
            AS["Assets.xcassets"]:::ui
            ENT["Entitlements"]:::ui
        end

        %% Business Logic Layer
        subgraph "Business Logic"
            direction TB
            SM["Scan Manager"]:::business
            RE["Rules Engine"]:::business
        end

        %% Data Access Layer
        subgraph "File System Layer"
            direction TB
            FS["File System Access"]:::data
        end

        %% Output Renderer
        subgraph "Output Renderer"
            direction TB
            TV["TableView Renderer"]:::business
        end

        %% Utilities
        subgraph "Utilities"
            direction TB
            LG["Logger/Error Handler"]:::util
        end
    end

    %% Release Artifact outside boundary
    RA["Release Artifact (.dmg)"]:::util

    %% Relationships
    AD -->|"initializes UI"| VC
    VC -->|"triggers Scan"| SM
    SM -->|"discover apps"| FS
    FS -->|"returns apps metadata"| SM
    SM -->|"passes each app to"| RE
    RE -->|"status results"| SM
    SM -->|"aggregates results"| TV
    TV -->|"updates UI TableView"| VC
    SM -->|"errors"| LG
    LG -->|"optionally alerts"| VC
    RA -.->|"built from"| FMProj[/"FM_dylib_checker.xcodeproj"/]:::util

    %% Legend
    subgraph Legend
        direction TB
        UI["UI Components"]:::ui
        BUS["Business Logic"]:::business
        DA["Data Access"]:::data
        UT["Utilities"]:::util
    end

    %% Click Events
    click FMProj "https://github.com/palmoff/fm_dylib_checker/blob/main/FM_dylib_checker.xcodeproj"
    click AD "https://github.com/palmoff/fm_dylib_checker/blob/main/FM_dylib_checker/AppDelegate.swift"
    click VC "https://github.com/palmoff/fm_dylib_checker/blob/main/FM_dylib_checker/ViewController.swift"
    click SB "https://github.com/palmoff/fm_dylib_checker/blob/main/FM_dylib_checker/Base.lproj/Main.storyboard"
    click AS "https://github.com/palmoff/fm_dylib_checker/blob/main/FM_dylib_checker/Assets.xcassets"
    click ENT "https://github.com/palmoff/fm_dylib_checker/blob/main/FM_dylib_checker/FM_dylib_checker.entitlements"
    click SM "https://github.com/palmoff/fm_dylib_checker/blob/main/FM_dylib_checker/ViewController.swift"
    click TV "https://github.com/palmoff/fm_dylib_checker/blob/main/FM_dylib_checker/Base.lproj/Main.storyboard"
    click RA "https://github.com/palmoff/fm_dylib_checker/blob/main/release/FM_dylib_checker.dmg"

    %% Styles
    classDef ui fill:#bbdefb,stroke:#0d47a1,color:#0d47a1,stroke-width:1px
    classDef business fill:#c8e6c9,stroke:#1b5e20,color:#1b5e20,stroke-width:1px
    classDef data fill:#ffe0b2,stroke:#e65100,color:#e65100,stroke-width:1px
    classDef util fill:#e0e0e0,stroke:#424242,color:#424242,stroke-width:1px
    classDef fmproj fill:#ffffff,stroke:#000000
    class FMProj fmproj
```
