-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwwivsubs
More file actions
executable file
·113 lines (102 loc) · 3.44 KB
/
wwivsubs
File metadata and controls
executable file
·113 lines (102 loc) · 3.44 KB
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
#!/usr/bin/env python
from struct import *
#from time import *
#from binascii import *
#import sys
# Processing SUBS.XTR
print "Processing SUBS.XTR"
strfile="/home/xenos/alcove/C:/WWIV/DATA/subs.xtr"
subs_xtr=open(strfile,"r")
for line in subs_xtr:
if line[0]=="!":
print("\nSub No. %s" % line[1:-1])
if line[0]=="@":
print("Description: %s" % line[1:-1])
if line[0]=="#":
print("Flags: %s" % line[1:-1])
if line[0]=="$":
network_info=line[1:-1].split(" ")
network=network_info[0]
subtype=network_info[1]
flags=network_info[2]
host=network_info[3]
category=network_info[4]
print("Network: %s" % network)
if host == "0":
print("Host : HERE")
else:
print("Host : %s" % host)
print("Subtype: %s" % subtype)
print("Category: %s" % category)
# Processing SUBS.DAT
print "Processing SUBS.DAT"
strfile="/home/xenos/alcove/C:/WWIV/DATA/subs.dat"
subs_dat=open(strfile,"rb")
subs=subs_dat.read()
number_subs=int(len(subs)/63)
print("Size of SUBS.DAT: %d" % len(subs))
print("Number of subs: %d" % number_subs)
for i in range(0,number_subs):
s=subs[i*63:(i*63)+63]
print("%d:%d" % (i*63,(i*63)+62))
name=str(s[0:40].partition(b'\0')[0])
filename=str(s[41:49].partition(b'\0')[0])
key=str(s[50])
readsl=unpack("B",s[51])
postsl=unpack("B",s[52])
anony= unpack("B",s[53])
age=unpack("B",s[54])
maxmsgs=unpack("H",s[55:57])
ar=unpack("H",s[57:59])
storage_type=unpack("H",s[59:61])
type=unpack("H",s[61:63])
print("Sub # %i" % i)
print("Name: %s" % name)
print("Filename: %s" % filename)
print("Key: %s" % key)
print("Read SL: %d" % readsl)
print("Post SL: %d" % postsl)
print("Anony : %d" % anony)
print("Age : %d" % age)
print("Max Msgs: %d" % maxmsgs)
print("AR: %d" % ar)
print("Storage Type: %d" % storage_type)
print("Type: %d" % type)
def get_host(subname):
strfile="/home/xenos/alcove/C:/WWIV/DATA/subs.xtr"
subs_xtr=open(strfile,"r")
for line in subs_xtr:
if line[0]=="$":
network_info=line[1:-1].split(" ")
network=network_info[0]
subtype=network_info[1]
flags=network_info[2]
host=network_info[3]
category=network_info[4]
if subtype==subname:
return host
print("AAGEN is hosted by:")
print(get_host("AAGEN"))
print("NETTEST is hosted by:")
print(get_host("NETTEST"))
print("WWIVSYS is hosted by:")
print(get_host("WWIVSYS"))
print("FSX_GEN is hosted by:")
print(get_host("FSX_GEN"))
#print(str(subs[i*63:i*63+62]))
# from vardec.h subboardrec
#struct subboardrec {
# char name[41], // board name
# filename[9], // board database filename
# key; // board special key
#
# uint8_t readsl, // sl required to read
# postsl, // sl required to post
# anony, // anonymous board?
# age; // minimum age for sub
#
# uint16_t maxmsgs, // max # of msgs
# ar, // AR for sub-board
# storage_type, // how messages are stored
# type; // 4 digit board type
#};