23-06-2015, 05:54 AM
Lol, think of '@' andy, or 0xc0 etc..? Or the possibility that cpe access is disabled to flash.. meanwhile, re: BIOS script, that MAY be of use in newer secure bios's..
import zlib
from glob import glob
def zipstreams(filename):
"""Return all zip streams and their positions in file."""
with open(filename, 'rb') as fh:
data = fh.read()
i = 0
while i < len(data):
try:
zo = zlib.decompressobj()
yield i, zo.decompress(data[i:])
i += len(data[i:]) - len(zo.unused_data)
except zlib.error:
i += 1
for filename in glob('*.ROM'): #change to meet your file extension
print(filename)
for i, data in zipstreams(filename):
print (i, len(data))
Now if this could be modified for firmware's, it would save all a shit load of hassle
import zlib
from glob import glob
def zipstreams(filename):
"""Return all zip streams and their positions in file."""
with open(filename, 'rb') as fh:
data = fh.read()
i = 0
while i < len(data):
try:
zo = zlib.decompressobj()
yield i, zo.decompress(data[i:])
i += len(data[i:]) - len(zo.unused_data)
except zlib.error:
i += 1
for filename in glob('*.ROM'): #change to meet your file extension
print(filename)
for i, data in zipstreams(filename):
print (i, len(data))
Now if this could be modified for firmware's, it would save all a shit load of hassle