3 #http://blog.rchapman.org/post/36801038863/linux-system-call-table-for-x86-64
6 ff = open('syscalltable.txt','r')
7 soup = bs4.BeautifulSoup(ff.read())
9 ff = open('sys_fd_arr.h','w')
11 len_list = len(list(soup.find_all('tr')))
12 ff.write('int sys_pointer_arr[323] = {\n')
13 for (i,row) in enumerate(list(soup.find_all('tr'))):
14 print str(row.find('td'))[4:len(str(row.find('td')))-5]
16 if len(list(row.find_all('td')))>0:
18 for (j,ele) in enumerate(list(row.find_all('td'))[2::]):
19 inner = str(ele)[4:len(str(ele))-5]
20 inner_split = inner.split()
21 for inn in inner_split:
26 ff.write(str(candidate)+'\n')
28 ff.write(str(candidate)+',\n')
34 ff = open('syscalltable.txt','r')
35 soup = bs4.BeautifulSoup(ff.read())
37 ff = open('sys_point_arr.h','w')
39 len_list = len(list(soup.find_all('tr')))
40 ff.write('int sys_pointer_arr[323] = {\n')
41 for (i,row) in enumerate(list(soup.find_all('tr'))):
42 print str(row.find('td'))[4:len(str(row.find('td')))-5]
44 if len(list(row.find_all('td')))>0:
45 for ele in list(row.find_all('td'))[2::]:
46 inner = str(ele)[4:len(str(ele))-5]
55 print int(bit_vec[::-1],2)
57 ff.write(str(int(bit_vec[::-1],2))+'\n')
59 ff.write(str(int(bit_vec[::-1],2))+',\n')
65 if __name__ == "__main__":