@@ -197,7 +197,7 @@ def do_utime(targetname, atime, mtime):
197
197
# Using utime() on directories is not allowed on Win32 according to
198
198
# msdn.microsoft.com
199
199
os .utime (targetname ,
200
- (time .mktime (mstime (atime )), time .mktime (mstime (mtime ))))
200
+ (time .mktime (mstime (atime )), time .mktime (mstime (mtime ))))
201
201
202
202
###############################################################################
203
203
@@ -246,7 +246,7 @@ def get_cluster(startclust, offset):
246
246
###############################################################################
247
247
248
248
def fill_directory (infile , txtfile , contents , firstclust , makedir , start ,
249
- offset ):
249
+ offset ):
250
250
"""Fill the directory structure with the files contained in the archive.
251
251
252
252
@param infile pointer to the archive
@@ -262,9 +262,9 @@ def fill_directory(infile, txtfile, contents, firstclust, makedir, start,
262
262
263
263
# dictionary which holds the directory structure,
264
264
# patch 0xFFFF is the 'root' directory.
265
- paths = {0xFFFF :"" }
265
+ paths = {0xFFFF : "" }
266
266
267
- oldpathind = 0xFFFF # initial path, speed up file/dir creation
267
+ oldpathind = 0xFFFF # initial path, speed up file/dir creation
268
268
269
269
for i in xrange (0x1000 * firstclust // 64 ):
270
270
cur = contents [i * 64 :(i + 1 ) * 64 ]
@@ -286,7 +286,7 @@ def fill_directory(infile, txtfile, contents, firstclust, makedir, start,
286
286
if nlen < 1 or nlen > 40 :
287
287
print "Filename length (%i) out of range, skipping file." % nlen
288
288
continue
289
- outname = outname [0 :nlen ] # strip trailing 0x00 from filename
289
+ outname = outname [0 :nlen ] # strip trailing 0x00 from filename
290
290
291
291
if txtfile != None :
292
292
if namelen & 0x80 == 0x80 :
@@ -312,7 +312,7 @@ def fill_directory(infile, txtfile, contents, firstclust, makedir, start,
312
312
if pathind != oldpathind :
313
313
# working directory changed
314
314
for _ in xrange (paths [oldpathind ].count ("/" )):
315
- os .chdir (".." ) # go back to root directory
315
+ os .chdir (".." ) # go back to root directory
316
316
os .chdir (paths [pathind ])
317
317
oldpathind = pathind
318
318
if namelen & 0x80 == 0x80 :
@@ -358,8 +358,9 @@ def write_common_part(infile, txtfile, png2stop, start):
358
358
"""
359
359
360
360
infile .seek (0x32C )
361
- mhash = infile .read (20 ) # xbox180 : SHA1 hash of 0x0344-0xB000,
362
- # CON : 0x0344 - 0xA000 (i.e. png2stop)
361
+ # xbox180 : SHA1 hash of 0x0344-0xB000,
362
+ # CON : 0x0344 - 0xA000 (i.e. png2stop)
363
+ mhash = infile .read (20 )
363
364
(mentry_id , content_type ) = struct .unpack (">LL" , infile .read (8 ))
364
365
365
366
if txtfile != None :
@@ -488,14 +489,14 @@ def handle_live_pirs(infile, fsize):
488
489
print >> txtfile , hex (ord (i )),
489
490
print >> txtfile
490
491
491
- ### BEGIN wxPirs ###
492
- infile .seek (0xC032 ) # originally 4 bytes at 0xC030
492
+ # BEGIN wxPirs
493
+ infile .seek (0xC032 ) # originally 4 bytes at 0xC030
493
494
(pathind , ) = struct .unpack (">H" , infile .read (2 ))
494
495
if pathind == 0xFFFF :
495
- start = 0xC000
496
+ start = 0xC000
496
497
else :
497
- start = 0xD000
498
- ### END wxPirs ###
498
+ start = 0xD000
499
+ # END wxPirs
499
500
write_common_part (infile , txtfile , 0xB000 , start )
500
501
501
502
###############################################################################
@@ -535,7 +536,7 @@ def extractPirsFromZip(systemupdate):
535
536
print "Extracting $SystemUpdate/FFFE07DF00000001 from system update file..."
536
537
updatefile = StringIO .StringIO (systemupdate )
537
538
z = zipfile .ZipFile (updatefile )
538
- #print z.namelist()
539
+ # print z.namelist()
539
540
pirs = z .open ("$SystemUpdate/FFFE07DF00000001" ).read ()
540
541
print "done."
541
542
return pirs
@@ -555,7 +556,7 @@ def extractPirsFromZip(systemupdate):
555
556
basename = "FFFE07DF00000001"
556
557
sio .name = basename
557
558
pwd = os .getcwd ()
558
- handle_live_pirs (sio , len (pirs )- 4 )
559
+ handle_live_pirs (sio , len (pirs ) - 4 )
559
560
560
561
os .chdir (pwd )
561
562
print "Moving audios.bin to current folder"
0 commit comments