Skip to content

Instantly share code, notes, and snippets.

View marcnewlin's full-sized avatar

Marc Newlin marcnewlin

  • Santa Monica, CA
View GitHub Profile
#!/usr/bin/env python3
import bluetooth
import re
import struct
import sys
if __name__ == "__main__":
if len(sys.argv) < 2:
#!/usr/bin/env python3
import usb.core
import struct
from collections import namedtuple
APPLE_VID = 0x05ac
Target = namedtuple("Target", ["vid", "pid", "name", "model", "total_size"])
@marcnewlin
marcnewlin / extract-firmware.py
Created December 11, 2023 04:33
script to extract firmware images from Alienware AW920K update tools
#!/usr/bin/env python3
'''
Firmware updates for the Alienware AW920K keyboard (and dongle) are encrypted
using a key derived from the size of the update.
This tool extracts the unencrypted firmware images from the update packages.
Instructions:
Internal error: Oops: 5 [#1] PREEMPT SMP ARM
Modules linked in: wportal(O) init_addr( (null) - (null)), core_addr(bfa7c000 - bfa7d8bc)
domain_redirect(O) init_addr( (null) - (null)), core_addr(bfa77000 - bfa77d08)
domain_dns(O) init_addr( (null) - (null)), core_addr(bfa73000 - bfa739cc)
wl(P) init_addr( (null) - (null)), core_addr(bf3cc000 - bf6be5c4)
bcmvlan(P) init_addr( (null) - (null)), core_addr(bf3af000 - bf3bca8c)
bcm_enet init_addr( (null) - (null)), core_addr(bf389000 - bf39ccc8)
domain_libs(O) init_addr( (null) - (null)), core_addr(bf385000 - bf3853d4)
br_filter(O) init_addr( (null) - (null)), core_addr(bf381000 - bf381610)
nf_conntrack_netlink init_addr( (null) - (null)), core_addr(bf378000 - bf37c500)
Internal error: Oops: 5 [#1] PREEMPT SMP ARM
Modules linked in: wportal(O) init_addr( (null) - (null)), core_addr(bfa7c000 - bfa7d8bc)
domain_redirect(O) init_addr( (null) - (null)), core_addr(bfa77000 - bfa77d08)
domain_dns(O) init_addr( (null) - (null)), core_addr(bfa73000 - bfa739cc)
wl(P) init_addr( (null) - (null)), core_addr(bf3cc000 - bf6be5c4)
bcmvlan(P) init_addr( (null) - (null)), core_addr(bf3af000 - bf3bca8c)
bcm_enet init_addr( (null) - (null)), core_addr(bf389000 - bf39ccc8)
domain_libs(O) init_addr( (null) - (null)), core_addr(bf385000 - bf3853d4)
br_filter(O) init_addr( (null) - (null)), core_addr(bf381000 - bf381610)
nf_conntrack_netlink init_addr( (null) - (null)), core_addr(bf378000 - bf37c500)
@marcnewlin
marcnewlin / logitech.py
Created May 23, 2020 13:52
script to label ~most of the nRF24LU1P registers/mem-regions in Ghidra
# 0. place this script in your ghidra_script directory
# 1. open the target nRF24LU1P binary in Ghidra
# 2. open the python shell in Ghidra
# 3. `import logitech; l = logitech.logitech(currentProgram); l.do_it()
import ghidra
from ghidra.program.model.symbol import SourceType
class logitech(object):
def __init__(self, currentProgram):
@marcnewlin
marcnewlin / dump-fw.py
Created May 23, 2020 03:10
unifying dongle firmware readout - tested on CU0007 with FW rev RQR12.11
#!/usr/bin/env python
# sorry this is Python 2 -- the bootloader trigger breaks with Python 3 and I was too lazy to debug
import usb, time, struct
# Logitech Unifying dongle
class unifying_dongle:
# constructor

Keybase proof

I hereby claim:

  • I am marcnewlin on github.
  • I am marcnewlin (https://keybase.io/marcnewlin) on keybase.
  • I have a public key ASAYVg2XbgHV-IGvrI7yQJk9Lh9W9F6BzZMOM47PDlS_Nwo

To claim this, I am signing this object: