Commit Graph
11 Commits
Author SHA1 Message Date
Erwan 2dca4cd116 feat(wifi): implement macOS Tahoe WorkQueue and FaultReporter for IO80211Controller
### Breakthroughs & Rétro-ingénierie (macOS Tahoe 26.7.1 / IO80211Family 1200.13.1)
1. WorkQueue Invariants (Slots 395 & 397):
   - Analyse de `IO80211Controller::start(provider)` et `IONetworkController::start(provider)`.
   - `createWorkLoop()` appelle directement le slot 395 `createWorkQueue()` (offset 0xc58), dont la classe de base renvoie `false`.
   - `getWorkLoop()` appelle le slot 397 `getWorkQueue()` (offset 0xc68), dont la classe de base renvoie `nullptr`.
   - Si non surchargés, `start()` échoue immédiatement avant l'allocation du timer.
   - Broadcom (`AppleBCMWLANCore`) alloue `IO80211WorkQueue::workQueue()` (`__ZN16IO80211WorkQueue9workQueueEv`).
   - Implémenté dans QualcommWifi avec `fWorkQueue` dérivé de `IOWorkLoop`.

2. Prévention du Kernel Panic dans `findAndAttachToFaultReporter` (Slot 432):
   - `IO80211Controller::findAndAttachToFaultReporter` appelle le slot 432 `getFaultReporterFromDriver()` (offset 0xd80).
   - Si `getFaultReporterFromDriver()` renvoie `nullptr` et que `ivars->_faultReporter` (offset 0x58) est nul, le kernel déclenche `panic("\"No ivars->_faultReporter\" @IO80211Controller.cpp:2877")`.
   - Création de la classe `QualcommFaultReporter` (dérivée d'`OSObject`), instanciée et renvoyée par `getFaultReporterFromDriver()`, satisfaisant l'invariant sans panique.

### Modifications apportées
- `QualcommWireless/include/IOKit/80211/IO80211WorkQueue.h`:
  - Déclaration de `IO80211WorkQueue` (dérivée d'`IOWorkLoop`) avec sa méthode statique `workQueue()`.
- `QualcommWireless/include/IOKit/80211/IO80211Controller.h`:
  - Inclusion de `IO80211WorkQueue.h`.
- `QualcommWifi/QualcommWifi.hpp`:
  - Déclaration de `QualcommFaultReporter : public OSObject`.
  - Ajout des membres `fWorkQueue` et `fFaultReporter`.
  - Déclaration des overrides `createWorkQueue()`, `getWorkQueue()` et `getFaultReporterFromDriver()`.
- `QualcommWifi/QualcommWifi.cpp`:
  - Implémentation de `createWorkQueue()`, `getWorkQueue()` et `getFaultReporterFromDriver()`.
  - Initialisation dans `init()` et libération dans `free()`.
  - Sécurisation du prologue de `QualcommWifi::start()` avant `super::start(provider)`.
- `QualcommWifi/Info.plist`:
  - Déclaration propre du kext Wi-Fi PCIe (`0x110717cb`), probe score 20000, et dépendances `IO80211Family`, `IONetworkingFamily`, `IOPCIFamily`.
- `build_wifi.sh`:
  - Script automatisé de compilation, assemblage firmware radio WCN7850, linkage et validation `kmutil`.

### Validation
- Compilation réussie avec `clang++` (-target x86_64-apple-macos15.0).
- Validation `kmutil libraries` réussie à 100% avec code retour 0 contre `/System/Library/KernelCollections/BootKernelExtensions.kc`.
- Aucune régression sur le Bluetooth (`QualcommWireless.kext`), testé et validé via `xcodebuild`.
2026-10-16 09:50:54 +02:00
Erwan 493c0989a1 chore(agents): add AGENTS.md rule for automatic detailed commits and push
Modifications:
- AGENTS.md: Enforce systematic git commit with comprehensive technical messages (breakthroughs, reverse-engineering findings, per-file changes, and build/EFI validation) followed by immediate git push to origin/main after every modification set.
2026-10-16 02:44:57 +02:00
Erwan a10e097a7e feat(tahoe): port QualcommWireless & QualcommWifi to macOS Tahoe 26.x (Darwin 25)
Breakthroughs & Reverse Engineering (macOS Tahoe 26.7.1 / Darwin 25.6.0):
- Reconstructed the complete 463-slot Skywalk vtable and class layout (0x128 / 296 bytes) of IO80211Controller (__ZTV17IO80211Controller at 0xffffff8002461148) and AppleBCMWLANCore from BootKernelExtensions.kc (IO80211Family 1200.13.1, source 1566.5).
- Verified IOUSBHostDevice::deviceRequest vtable slot in Tahoe's BootKernelExtensions.kc (__ZTV15IOUSBHostDevice at 0xffffff8002e72720): confirmed exact match at slot 374 (0x176, byte offset 0xbb0).
- Disassembled Tahoe's /usr/sbin/bluetoothd (FindTransportType at 0x10014c700, Found_USB_Dongle at 0x1000e9559, GetProductAndVendorID at 0x1000edf2a) confirming USB transport matching on 'Bluetooth USB Host Controller' and CSR 0x0a12 descriptor spoofing.

Code & Build Modifications (v1.1.0):
- IO80211Controller.h: Add full 463-slot Tahoe Skywalk vtable declaration (slots 394..462, offsets 0xc50..0xe70) and exact 0x80 filler size when __IO80211_TARGET >= 260000 while preserving legacy compatibility.
- QualcommWifi.hpp/.cpp: Implement Tahoe IO80211Controller pure virtual methods (isCommandProhibited, handleCardSpecific, getDRIVER_VERSION, getHARDWARE_VERSION, getCARD_CAPABILITIES, getPOWER, setPOWER, getCOUNTRY_CODE, setCOUNTRY_CODE, setGET_DEBUG_INFO, getLogger, getFaultReporterFromDriver) and guard un-reserved IONetworkController slots 6..7 on SDK 26.5.
- QualcommWireless.cpp: Add non-null vtable slot sanity check prior to installing the shadow vtable hook on IOUSBHostDevice::deviceRequest.
- project.pbxproj & Info.plist: Upgrade to Xcode 26.6 (MacOSX26.5.sdk), MACOSX_DEPLOYMENT_TARGET = 26.0, __IO80211_TARGET = 260000, and bump version to 1.1.0.
- docs & README: Document macOS Tahoe (Darwin 25) architecture, bluetoothd offsets, and Skywalk IO80211Controller ABI.
2026-10-16 02:41:25 +02:00
nawrhehe 820154e54b feat(bt): intercept LE_SET_SCAN_PARAM via shadow vtable to inject random address on the fly 2026-10-15 23:00:43 +02:00
nawrhehe 88c0dccd79 fix(bt): configure static LE random address to resolve status 718 scan crash 2026-10-15 22:47:48 +02:00
nawrhehe 2656af7975 fix(bt): enforce USB transport matching and isolate Bluetooth driver dependencies 2026-10-15 22:18:47 +02:00
nawrhehe 9423c21da0 fix(kext): prune unused dependencies from OSBundleLibraries 2026-10-15 21:34:44 +02:00
nawrhehe 192d7355c2 feat(wifi): expand wireless capabilities and channel configuration 2026-10-15 21:24:38 +02:00
nawrhehe 3b2ffcdf15 feat(wifi): add Apple80211 IOCTL handlers and explicit PCIe probe validation 2026-10-15 21:23:21 +02:00
nawrhehe 5f28381754 Added : README.md for general comprehension 2026-10-15 21:11:02 +02:00
nawrhehe b03b6c8197 premier push 2026-10-15 18:07:10 +02:00