Skip to content

Instantly share code, notes, and snippets.

@dogtopus
Created November 4, 2020 06:23
Show Gist options
  • Save dogtopus/bd09996da47dfa1def2bb270678e1396 to your computer and use it in GitHub Desktop.
Save dogtopus/bd09996da47dfa1def2bb270678e1396 to your computer and use it in GitHub Desktop.
DualSense output report fuzzer
#!/usr/bin/env python3
import hid
import os
import contextlib
import time
if __name__ == '__main__':
with contextlib.closing(hid.device()) as dev:
dev.open(0x054c, 0x0ce6)
#print(hid.enumerate())
#exit()
#dev.open_path(b'0001:002a:00')
flags = bytes.fromhex('0f00')
data = bytes.fromhex('ffff00000000000006ff010000000000000000230f080000000000000000000000000000000000000000000000')
for i in range(len(data)):
print(f'Zeroing out {i} bytes in payload')
data_actual = flags + b'\x00' * i + data[i:]
print(data_actual.hex())
dev.write([0x02] + list(data_actual))
input('Press Enter to zero out 1 byte...')
#!/usr/bin/env python3
import hid
import os
import contextlib
import time
if __name__ == '__main__':
with contextlib.closing(hid.device()) as dev:
dev.open(0x054c, 0x0ce6)
while True:
data = os.urandom(47)
print(data.hex())
dev.write([0x02] + list(data))
time.sleep(0.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment