summaryrefslogtreecommitdiffstats
path: root/h.py
diff options
context:
space:
mode:
authorZoRo <dos21h@gmail.com>2019-07-31 21:55:59 +0100
committerZoRo <dos21h@gmail.com>2019-07-31 21:55:59 +0100
commit1a1e39cc91c350e2cd7b0aca5100527059ab23bb (patch)
treef06acc2eda263394246c2d01c5502f6de6586086 /h.py
downloadwebusb-1a1e39cc91c350e2cd7b0aca5100527059ab23bb.tar.gz
webusb-1a1e39cc91c350e2cd7b0aca5100527059ab23bb.zip
Dirty commit
Diffstat (limited to 'h.py')
-rw-r--r--h.py40
1 files changed, 40 insertions, 0 deletions
diff --git a/h.py b/h.py
new file mode 100644
index 0000000..ba7d487
--- /dev/null
+++ b/h.py
@@ -0,0 +1,40 @@
+
+import sys
+
+i = int(sys.argv[1],16)
+print(i)
+d1 = i&0x1f
+print("Recepient "+str(d1)),
+if d1 == 0:
+ print(" device")
+elif d1 == 1:
+ print(" interface")
+elif d1 == 2:
+ print(" endpoint")
+elif d1 == 3:
+ print(" other")
+else:
+ print(" Unknown")
+
+d2 = ((i>>5)&0x3)
+print("Request type "+str(d2)),
+if d2 == 0:
+ print(" standart")
+elif d2 == 1:
+ print(" class")
+elif d2 == 2:
+ print(" vendor")
+elif d2 == 3:
+ print(" reserved")
+else:
+ print(" Unknown")
+
+d3 = ((i>>7)&0x1)
+print("Direction "+str(d3)),
+if d3 == 0:
+ print(" Out")
+elif d3 == 1:
+ print(" In")
+else:
+ print(" Unknown")
+