forked from y1shiny1shin/USBFlow_Soer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Add_profile.py
127 lines (105 loc) · 2.97 KB
/
Add_profile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
import yaml
from USBFlow_Soer import *
'''
添加设备的模板,注意:需要添加到对应的公司
如果列表中没有该公司,需要手动加公司的ID和Name,
如果时间紧急,可以直接将流量的压缩包发到[email protected]就行,谢谢师傅的支持
- Device_ID: ""
Device_Name: ""
Device_Type: ""
Device_DefName: ""
添加的时候请师傅注意大小写和缩进;
添加完成只需要工具目录下执行一次即可
如果是未添加过的Unknown的设备,如下是添加新设备的模版
"Company_ID":
Company_ID: ""
Device_ID: ""
Device_Type: ""
Device_DefName: ""
'''
des_dir = '''
Company_List:
- "0x046d": "LOG"
"0x056a": "WACOM"
"0x1532": "Razer"
"0x05ac": "Apple"
LOG:
- Company_ID: "0x046d"
Company_name: "Logitech, Inc."
- Device_ID: "0xc539"
Device_Name: "Lightspeed Receiver"
Device_Type: "Mouse"
Device_DefName: "LOG_Lightspeed_Reveiver"
- Device_ID: "0xc08b"
Device_Name: "Logitech G502 SE HERO Gaming Mouse"
Device_Type: "Mouse"
Device_DefName: "LOG_G502_MOUSE"
- Device_ID: "0xc077"
Device_Name: "Logitech Mouse"
Device_Type: "Mouse"
Device_DefName: "Mouse"
- Device_ID: "0xc341"
Device_Name: "Logitech Unknow Keyboard Type"
Device_Type: "KeyBoard"
Device_DefName: "Unknown_keyboard"
- Device_ID: "0xc53f"
Device_Name: "G304 Wireless"
Device_Type: "Mouse"
Device_DefName: "G304_Wireless"
- Device_ID: "0xc09d"
Device_Name: "G102 Wire"
Device_Type: "Mouse"
Device_DefName: "G102_Wire"
WACOM:
- Company_ID: "0x056a"
Company_name: "Wacom Co., Ltd"
- Device_ID: "0x030e"
Device_Name: "CTL-480 [Intuos Pen (S)]"
Device_Type: "wacom"
Device_DefName: "CTL_480"
- Device_ID: "0x0357"
Device_Name: "PTH-660 [Intuos Pro (M)]"
Device_Type: "wacom"
Device_DefName: "PTH_660"
Razer:
- Company_ID: "0x1532"
Company_name: "Razer USA, Ltd"
- Device_ID: "0x0083"
Device_Name: "RC30-0315, Gaming Mouse [Basilisk x HyperSpeed]"
Device_Type: "Mouse"
Device_DefName: "Basilisk_Mouse"
Apple:
- Company_ID: "0x05ac"
Company_name: "Apple, Inc."
- Device_ID: "0x024f"
Device_Name: "Aluminium Keyboard (ANSI)"
Device_Type: "KeyBoard"
Device_DefName: "ANSI"
Unknown:
"0x256c":
Company_ID: "0x256c"
Device_ID: "0x006d"
Device_Type: "Wacom Like"
Device_DefName: "Wacom_Like_1"
"0x093a":
Company_ID: "0x093a"
Device_ID: "0x2530"
Device_Type: "Mouse Like"
Device_DefName: "Mouse_Like_1"
"0x2341":
Company_ID: "0x2341"
Device_ID: "0x8036"
Device_Type: "Keyboard Like"
Device_DefName: "KeyBoard_Like_1"
Default:
- type: "Mouse"
datalen: 8
name: "Default Mouse"
- type: "KeyBoard"
datalen: 16
name: "Default KeyBoard"
'''
dict_var = yaml.safe_load(des_dir)
with open("./profile.yaml" ,"w" ,encoding="utf-8") as f:
yaml.dump(dict_var ,f ,default_flow_style=False)
print("OK")