Added files
This commit is contained in:
parent
33034d2d8d
commit
932288da0e
3 changed files with 268 additions and 0 deletions
37
scanner.py
Executable file
37
scanner.py
Executable file
|
|
@ -0,0 +1,37 @@
|
|||
|
||||
def parse(arrg:str):
|
||||
"""
|
||||
i: Any raw string from scanner
|
||||
o: (cat, bat) A tuple containing the catalog and batch info,
|
||||
filling None as needed.
|
||||
"""
|
||||
if "" == arrg:
|
||||
pass
|
||||
elif "[)>" in arrg[0:3]: #These may need to be shifted up or down 1 based on how the application handles [rs][eot]and [gs]
|
||||
cat = arrg[arrg.index("+H")+5:arrg.index("Q1")-2]
|
||||
bat = arrg[arrg.index("$")+1:arrg.index("14D2")-1]
|
||||
return (cat, bat) #This should instead return an implant.
|
||||
elif "+H" in arrg[0:2]:
|
||||
cat = arrg[5:-2]
|
||||
return (cat, None)
|
||||
elif "+$" in arrg[0:2]:
|
||||
maxleggy = len(arrg)
|
||||
backstrip = maxleggy - 2
|
||||
bat = arrg[2:backstrip]
|
||||
return (None, bat)
|
||||
elif "01" in arrg[0:2]:
|
||||
#print("triggered modbar")
|
||||
lenth = len(arrg)
|
||||
bat = arrg[26:lenth]
|
||||
return (None, bat)
|
||||
elif "|" in arrg:
|
||||
dance = arrg.rsplit("|")
|
||||
cat = dance[0]
|
||||
bat = dance[1]
|
||||
return (cat, bat)
|
||||
elif "+H12" in arrg:
|
||||
cat = arrg[5:16]
|
||||
bat = arrg[23:31]
|
||||
return (cat, bat)
|
||||
else:
|
||||
return (arrg, None)
|
||||
Loading…
Add table
Add a link
Reference in a new issue