feat: allow MAC spoofing in Bluetooth stack, show paired devices in Bluetooth app

This commit is contained in:
daniel committed 2026-06-16 08:49:06 +02:00
1 parent 2bcc19f0fc
commit b6ac5ac994
13 files changed
+700 -44

No files matched your search

+34
View File
@@ -56,6 +56,40 @@ namespace Montauk {
return (int64_t)Drivers::USB::Bluetooth::Disconnect(bdAddr);
}
static int64_t Sys_BtSetAddr(const uint8_t* bdAddr) {
if (!bdAddr) return -1;
if (!Drivers::USB::Bluetooth::IsInitialized()) return -1;
// bdAddr is a 6-byte buffer, addr[0] = least-significant octet.
return Drivers::USB::Bluetooth::SetAddress(bdAddr) ? 0 : -1;
}
static int64_t Sys_BtBonds(BtBondInfo* buf, int maxCount) {
if (!buf || maxCount <= 0) return 0;
if (!Drivers::USB::Bluetooth::IsInitialized()) return 0;
Drivers::USB::Bluetooth::Hci::BondInfo tmpBuf[8];
int kMax = maxCount;
if (kMax > 8) kMax = 8;
int count = Drivers::USB::Bluetooth::ListBonded(tmpBuf, kMax);
for (int i = 0; i < count; i++) {
memcpy(buf[i].bdAddr, tmpBuf[i].Addr, 6);
buf[i]._pad[0] = 0;
buf[i]._pad[1] = 0;
}
return (int64_t)count;
}
static int64_t Sys_BtForget(const uint8_t* bdAddr) {
if (!bdAddr) return -1;
if (!Drivers::USB::Bluetooth::IsInitialized()) return -1;
return (int64_t)Drivers::USB::Bluetooth::ForgetDevice(bdAddr);
}
static int64_t Sys_BtList(BtDevInfo* buf, int maxCount) {
if (!buf || maxCount <= 0) return 0;
if (!Drivers::USB::Bluetooth::IsInitialized()) return 0;