# leondante-ctrl/bullymate architecture

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

- Interactive diagram: https://gitdiagram.com/leondante-ctrl/bullymate
- Repository: https://github.com/leondante-ctrl/bullymate

## Overview

Bully is a command-line WPS PIN attack tool for monitor-mode wireless interfaces. Its main workflow takes target and search options, discovers or reacquires the access point, then tests pins through wireless exchanges and reports results; randomized pins and session state support resuming. Separate capabilities include pin generation, Pixie-Dust attempts, channel hopping, Lua scripting, and test mode. The README documents these behaviors, but the excerpts do not show most runtime call sites, so uncertain internal links are dashed and uncited.

Main entry points: [`bully-kali-master/src/bully.c`](https://github.com/leondante-ctrl/bullymate/blob/master/bully-kali-master/src/bully.c) (CLI and attack), [`bully-kali-master/src/80211.c`](https://github.com/leondante-ctrl/bullymate/blob/master/bully-kali-master/src/80211.c) (802.11 frames), [`bully-kali-master/src/wps/wps_registrar.c`](https://github.com/leondante-ctrl/bullymate/blob/master/bully-kali-master/src/wps/wps_registrar.c) (WPS registrar), [`bully-kali-master/src/iface.c`](https://github.com/leondante-ctrl/bullymate/blob/master/bully-kali-master/src/iface.c) (Interface control)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_attack["Attack control"]
  node_cli["CLI and attack<br/>[bully.c]"]
  node_pinsearch["PIN search<br/>[bully.c]"]
  node_sessionfiles["Session files<br/>[bully.c]"]
  node_pin_generator["PIN generator<br/>[pingen.c]"]
  node_lua["Lua scripting<br/>[luaclib.c]"]
end

subgraph group_wireless["Wireless exchange"]
  node_interface["Interface control<br/>[iface.c]"]
  node_frames["802.11 frames<br/>[80211.c]"]
  node_frame_format["Frame encoding<br/>[frame.c]"]
end

subgraph group_wps["WPS capabilities"]
  node_wps_protocol["WPS registrar<br/>[wps_registrar.c]"]
  node_wps_attrs["WPS attributes<br/>[wps_attr_parse.c]"]
  node_pixie["Pixie-Dust<br/>[pixie.h]"]
end

subgraph group_support["Runtime support"]
  node_timer["Timing and retries<br/>[timer.c]"]
  node_crypto["Crypto primitives<br/>[crypto.h]"]
  node_eventloop["Event loop<br/>[eloop.c]"]
  node_common["Common utilities<br/>[common.c]"]
end

node_user(("Operator"))
node_ap(("Access point"))

node_user -->|"sets options"| node_cli
node_cli -.->|"opens interface"| node_interface
node_cli -.->|"starts search"| node_pinsearch
node_cli -->|"resumes state"| node_sessionfiles
node_cli -.->|"selects generator"| node_pin_generator
node_cli -.->|"loads script"| node_lua
node_cli -->|"enables attempt"| node_pixie
node_pinsearch -->|"saves progress"| node_sessionfiles
node_pinsearch -.->|"tests PINs"| node_frames
node_interface -.->|"provides interface"| node_frames
node_frames -->|"uses encoding"| node_frame_format
node_frames -->|"exchanges frames"| node_ap
node_ap -->|"returns frames"| node_frames
node_frames -.->|"handles WPS"| node_wps_protocol
node_wps_protocol -.->|"parses attributes"| node_wps_attrs
node_pinsearch -.->|"delays retries"| node_timer
node_wps_protocol -.->|"uses cryptography"| node_crypto
node_wps_protocol -.->|"schedules events"| node_eventloop
node_cli -.->|"uses utilities"| node_common

click node_cli "https://github.com/leondante-ctrl/bullymate/blob/master/bully-kali-master/src/bully.c"
click node_pinsearch "https://github.com/leondante-ctrl/bullymate/blob/master/bully-kali-master/src/bully.c"
click node_sessionfiles "https://github.com/leondante-ctrl/bullymate/blob/master/bully-kali-master/src/bully.c"
click node_pin_generator "https://github.com/leondante-ctrl/bullymate/blob/master/bully-kali-master/src/pingen.c"
click node_lua "https://github.com/leondante-ctrl/bullymate/blob/master/bully-kali-master/src/luaclib.c"
click node_interface "https://github.com/leondante-ctrl/bullymate/blob/master/bully-kali-master/src/iface.c"
click node_frames "https://github.com/leondante-ctrl/bullymate/blob/master/bully-kali-master/src/80211.c"
click node_frame_format "https://github.com/leondante-ctrl/bullymate/blob/master/bully-kali-master/src/frame.c"
click node_wps_protocol "https://github.com/leondante-ctrl/bullymate/blob/master/bully-kali-master/src/wps/wps_registrar.c"
click node_wps_attrs "https://github.com/leondante-ctrl/bullymate/blob/master/bully-kali-master/src/wps/wps_attr_parse.c"
click node_pixie "https://github.com/leondante-ctrl/bullymate/blob/master/bully-kali-master/src/pixie.h"
click node_timer "https://github.com/leondante-ctrl/bullymate/blob/master/bully-kali-master/src/timer.c"
click node_crypto "https://github.com/leondante-ctrl/bullymate/blob/master/bully-kali-master/src/crypto/crypto.h"
click node_eventloop "https://github.com/leondante-ctrl/bullymate/blob/master/bully-kali-master/src/utils/eloop.c"
click node_common "https://github.com/leondante-ctrl/bullymate/blob/master/bully-kali-master/src/utils/common.c"

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_cli,node_pinsearch,node_sessionfiles,node_pin_generator,node_lua toneBlue
class node_interface,node_frames,node_frame_format toneAmber
class node_wps_protocol,node_wps_attrs,node_pixie toneMint
class node_timer,node_crypto,node_eventloop,node_common toneRose
class node_user,node_ap toneIndigo
```

## Components

### Attack control

- [CLI and attack](https://github.com/leondante-ctrl/bullymate/blob/master/bully-kali-master/src/bully.c): `bully-kali-master/src/bully.c`
- [PIN search](https://github.com/leondante-ctrl/bullymate/blob/master/bully-kali-master/src/bully.c): `bully-kali-master/src/bully.c`
- [Session files](https://github.com/leondante-ctrl/bullymate/blob/master/bully-kali-master/src/bully.c): `bully-kali-master/src/bully.c`
- [PIN generator](https://github.com/leondante-ctrl/bullymate/blob/master/bully-kali-master/src/pingen.c): `bully-kali-master/src/pingen.c`
- [Lua scripting](https://github.com/leondante-ctrl/bullymate/blob/master/bully-kali-master/src/luaclib.c): `bully-kali-master/src/luaclib.c`

### Wireless exchange

- [Interface control](https://github.com/leondante-ctrl/bullymate/blob/master/bully-kali-master/src/iface.c): `bully-kali-master/src/iface.c`
- [802.11 frames](https://github.com/leondante-ctrl/bullymate/blob/master/bully-kali-master/src/80211.c): `bully-kali-master/src/80211.c`
- [Frame encoding](https://github.com/leondante-ctrl/bullymate/blob/master/bully-kali-master/src/frame.c): `bully-kali-master/src/frame.c`

### WPS capabilities

- [WPS registrar](https://github.com/leondante-ctrl/bullymate/blob/master/bully-kali-master/src/wps/wps_registrar.c): `bully-kali-master/src/wps/wps_registrar.c`
- [WPS attributes](https://github.com/leondante-ctrl/bullymate/blob/master/bully-kali-master/src/wps/wps_attr_parse.c): `bully-kali-master/src/wps/wps_attr_parse.c`
- [Pixie-Dust](https://github.com/leondante-ctrl/bullymate/blob/master/bully-kali-master/src/pixie.h): `bully-kali-master/src/pixie.h`

### Runtime support

- [Timing and retries](https://github.com/leondante-ctrl/bullymate/blob/master/bully-kali-master/src/timer.c): `bully-kali-master/src/timer.c`
- [Crypto primitives](https://github.com/leondante-ctrl/bullymate/blob/master/bully-kali-master/src/crypto/crypto.h): `bully-kali-master/src/crypto/crypto.h`
- [Event loop](https://github.com/leondante-ctrl/bullymate/blob/master/bully-kali-master/src/utils/eloop.c): `bully-kali-master/src/utils/eloop.c`
- [Common utilities](https://github.com/leondante-ctrl/bullymate/blob/master/bully-kali-master/src/utils/common.c): `bully-kali-master/src/utils/common.c`

### Other components

- **Operator**
- **Access point**

## Connections

- Operator → CLI and attack: sets options
- CLI and attack → Interface control: opens interface (evidence: `bully-kali-master/src/bully.c`)
- CLI and attack → PIN search: starts search (evidence: `bully-kali-master/src/bully.c`)
- CLI and attack → Session files: resumes state (evidence: `bully-kali-master/src/bully.c`)
- CLI and attack → PIN generator: selects generator
- CLI and attack → Lua scripting: loads script
- CLI and attack → Pixie-Dust: enables attempt (evidence: `bully-kali-master/src/bully.c`)
- PIN search → Session files: saves progress (evidence: `bully-kali-master/src/bully.c`)
- PIN search → 802.11 frames: tests PINs (evidence: `bully-kali-master/src/bully.c`)
- Interface control → 802.11 frames: provides interface
- 802.11 frames → Frame encoding: uses encoding (evidence: `bully-kali-master/src/80211.c`)
- 802.11 frames → Access point: exchanges frames
- Access point → 802.11 frames: returns frames
- 802.11 frames → WPS registrar: handles WPS
- WPS registrar → WPS attributes: parses attributes
- PIN search → Timing and retries: delays retries (evidence: `bully-kali-master/src/bully.c`)
- WPS registrar → Crypto primitives: uses cryptography (evidence: `bully-kali-master/src/wps/wps_registrar.c`)
- WPS registrar → Event loop: schedules events
- CLI and attack → Common utilities: uses utilities (evidence: `bully-kali-master/src/bully.c`)
