Skip to content

Instantly share code, notes, and snippets.

Avatar
🎮

Jacques Gagnon darthcloud

🎮
View GitHub Profile
View hid_report_stats.py
#!/usr/bin/env python
import sys
from scapy.utils import rdpcap
from scapy.packet import Raw
from scapy.layers.bluetooth import L2CAP_Hdr
from statistics import mean, stdev
def get_hid_pkt_intervals(packets):
prev = 0
@darthcloud
darthcloud / xb1_adaptive_hid_descriptor
Created Jun 21, 2020
Xbox One adaptive controller HID descriptor
View xb1_adaptive_hid_descriptor
0x05, 0x01, // Usage Page (Generic Desktop Ctrls)
0x09, 0x05, // Usage (Game Pad)
0xA1, 0x01, // Collection (Application)
0x85, 0x01, // Report ID (1)
0x09, 0x01, // Usage (Pointer)
0xA1, 0x00, // Collection (Physical)
0x09, 0x30, // Usage (X)
0x09, 0x31, // Usage (Y)
0x15, 0x00, // Logical Minimum (0)
0x27, 0xFF, 0xFF, 0x00, 0x00, // Logical Maximum (65534)
@darthcloud
darthcloud / blueretro_log_wiiupro_page.txt
Created May 30, 2020
BlueRetro log with H4 packet dump WiiU Pro controller
View blueretro_log_wiiupro_page.txt
# bt_hci_cmd_reset
O 000000 01 03 0C 00
I 000000 04 0E 04 05 03 0C 00
# BT_HCI_EVT_CMD_COMPLETE
# bt_hci_cmd_read_local_features
O 000000 01 03 10 00
I 000000 04 0E 0C 05 03 10 00 BF EE CD FE DB FF 7B 87
# BT_HCI_EVT_CMD_COMPLETE
# bt_hci_cmd_read_local_version_info
O 000000 01 01 10 00
@darthcloud
darthcloud / h4bin2txt.py
Created May 29, 2020
Bluetooth H4 raw binary trace to Wireshark's text2pcap
View h4bin2txt.py
#!/usr/bin/env python3
import sys
with open(sys.argv[1], "rb") as f:
byte = f.read(1)
while byte:
if int(byte[0]) == 0x01:
byte += f.read(3)
byte += f.read(int(byte[3]))
View monthly_balance.sh
#!/bin/bash
exec > >(column -t)
file="${1:-data.bean}"
from="${2:-1000-01-01}"
to="${3:-9999-12-31}"
aex='account ~ "Expenses"'
alo='account ~ "Liabilities:Loans"'
ain='account ~ "Income"'