2019-09-25 08:50:53 +08:00
|
|
|
#!/usr/bin/env python3
|
2022-05-12 20:22:58 +08:00
|
|
|
# type: ignore
|
2018-02-25 10:33:52 +08:00
|
|
|
from panda import Panda
|
|
|
|
from hexdump import hexdump
|
|
|
|
|
|
|
|
DEBUG = False
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
p = Panda()
|
|
|
|
|
2020-06-03 07:27:07 +08:00
|
|
|
length = p._handle.controlRead(Panda.REQUEST_IN, 0x06, 3 << 8 | 238, 0, 1)
|
2019-09-25 09:02:15 +08:00
|
|
|
print('Microsoft OS String Descriptor')
|
2020-06-03 07:27:07 +08:00
|
|
|
dat = p._handle.controlRead(Panda.REQUEST_IN, 0x06, 3 << 8 | 238, 0, length[0])
|
2020-06-01 16:49:26 +08:00
|
|
|
if DEBUG:
|
2024-02-25 05:56:28 +08:00
|
|
|
print(f'LEN: {hex(length[0])}')
|
2018-02-25 10:33:52 +08:00
|
|
|
hexdump("".join(map(chr, dat)))
|
|
|
|
|
|
|
|
ms_vendor_code = dat[16]
|
2020-06-01 16:49:26 +08:00
|
|
|
if DEBUG:
|
2024-02-25 05:56:28 +08:00
|
|
|
print(f'MS_VENDOR_CODE: {hex(length[0])}')
|
2018-02-25 10:33:52 +08:00
|
|
|
|
2019-09-25 09:02:15 +08:00
|
|
|
print('\nMicrosoft Compatible ID Feature Descriptor')
|
2020-06-03 07:27:07 +08:00
|
|
|
length = p._handle.controlRead(Panda.REQUEST_IN, ms_vendor_code, 0, 4, 1)
|
2020-06-01 16:49:26 +08:00
|
|
|
if DEBUG:
|
2024-02-25 05:56:28 +08:00
|
|
|
print(f'LEN: {hex(length[0])}')
|
2020-06-03 07:27:07 +08:00
|
|
|
dat = p._handle.controlRead(Panda.REQUEST_IN, ms_vendor_code, 0, 4, length[0])
|
2018-02-25 10:33:52 +08:00
|
|
|
hexdump("".join(map(chr, dat)))
|
|
|
|
|
2019-09-25 09:02:15 +08:00
|
|
|
print('\nMicrosoft Extended Properties Feature Descriptor')
|
2020-06-03 07:27:07 +08:00
|
|
|
length = p._handle.controlRead(Panda.REQUEST_IN, ms_vendor_code, 0, 5, 1)
|
2020-06-01 16:49:26 +08:00
|
|
|
if DEBUG:
|
2024-02-25 05:56:28 +08:00
|
|
|
print(f'LEN: {hex(length[0])}')
|
2020-06-03 07:27:07 +08:00
|
|
|
dat = p._handle.controlRead(Panda.REQUEST_IN, ms_vendor_code, 0, 5, length[0])
|
2018-02-25 10:33:52 +08:00
|
|
|
hexdump("".join(map(chr, dat)))
|