-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path_SidParser.py
More file actions
35 lines (25 loc) · 904 Bytes
/
Copy path_SidParser.py
File metadata and controls
35 lines (25 loc) · 904 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
34
35
import os
import sys
import struct
import re
from GoObj import *
pattern = r'.'*0x3c+("\xff"*4)+".."+("\xff"*6)+".."
vpattern = r'..'+"\x00\x00"+'.'*0x38+"\xff"*4+".."+"\xff"*6+".."
class SidParser:
def __init__(self):
self.gos = []
def returnGos(self):
return self.gos
def parseSid(self,fname):
self.gos = []
file = open(fname,"rb")
data = file.read()
file.close()
#use this flag couse python sometimes is not so cool
results = re.findall(pattern,data,re.DOTALL)
for r in results:
go = GoObj()
go.parentIprf = None
go.parentOffset = go.parentOffset2 = None
go.blob = r
self.gos.append(go)