forked from ThatEidolon/Python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathioctl_dump.py
More file actions
33 lines (23 loc) · 828 Bytes
/
Copy pathioctl_dump.py
File metadata and controls
33 lines (23 loc) · 828 Bytes
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
import pickle
import driverlib
from immlib import *
def main( args ):
ioctl_list = []
device_list = []
dbg = Debugger()
driver = driverlib.Driver()
# Grab the list of IOCTL codes and device names
ioctl_list = driver.getIOCTLCodes()
if not len(ioctl_list):
return "[*] ERROR! Couldn't find any IOCTL codes."
device_list = driver.getDeviceNames()
if not len(device_list):
return "[*] ERROR! Couldn't find any device names."
# Now create a keyed dictionary and pickle it to a file
master_list = {}
master_list["ioctl_list"] = ioctl_list
master_list["device_list"] = device_list
fd = open( args[0], "wb")
pickle.dump( master_list, fd )
fd.close()
return "[*] SUCCESS! Saved IOCTL codes and device names to %s" % args[0]