Functions | |
| def | check_sha1 (sha1, entry, infile, start, end) |
| def | check_size (fsize, minsize) |
| def | do_mkdir (dirname) |
| def | do_utime (targetname, atime, mtime) |
| def | dump_info (infile, txtfile, what) |
| def | dump_png (infile, pnglen, maxlen, pngid) |
| def | extractPirsFromZip (systemupdate) |
| def | fill_directory (infile, txtfile, contents, firstclust, makedir, start, offset) |
| def | get_cluster (startclust, offset) |
| def | getFileOrURL (filename, url) |
| def | handle_live_pirs (infile, fsize) |
| def | mstime (intime) |
| def | nice_open_dir (dirname) |
| def | nice_open_file (filename) |
| def | open_info_file (infile) |
| def | strip_blanks (instring) |
| def | write_common_part (infile, txtfile, png2stop, start) |
Variables | |
| string | basename = "FFFE07DF00000001" |
| fw = getFileOrURL("SystemUpdate.zip", "http://www.xbox.com/system-update-usb") | |
| list | lang |
| name | |
| pirs = extractPirsFromZip(fw) | |
| pwd = os.getcwd() | |
| sio = StringIO.StringIO(pirs) | |
| string | target = "audios.bin" |
| def fwfetcher.check_sha1 | ( | sha1, | |
| entry, | |||
| infile, | |||
| start, | |||
| end | |||
| ) |
Check the SHA1 value of the specified range of the input file. @param sha1 the reported SHA1 value @param entry the id of the hash @param infile the input file to check @param start the start position @param end the end position @return string reporting if the hash is correct
Definition at line 204 of file fwfetcher.py.
| def fwfetcher.check_size | ( | fsize, | |
| minsize | |||
| ) |
Ensure that the filesize is at least minsize bytes. @param fsize the filesize @param minsize the minimal file size @return fsize >= minsize
Definition at line 30 of file fwfetcher.py.
| def fwfetcher.do_mkdir | ( | dirname | ) |
Version of os.mkdir() which does not throw an exception if the directory already exists. @param dirname name of the directory to create
Definition at line 80 of file fwfetcher.py.
| def fwfetcher.do_utime | ( | targetname, | |
| atime, | |||
| mtime | |||
| ) |
Set the access and update date/time of the target. Taken from tarfile.py (builtin lib) @param targetname name of the target @param atime the desired access date/time @param mtime the desired update date/time
Definition at line 185 of file fwfetcher.py.
| def fwfetcher.dump_info | ( | infile, | |
| txtfile, | |||
| what | |||
| ) |
Dumps the 9 information strings from the input file.
@param infile pointer to the input file
@param txtfile pointer to the resulting text file
@param what indicates if the information consists of titles or
descriptions
Definition at line 151 of file fwfetcher.py.
| def fwfetcher.dump_png | ( | infile, | |
| pnglen, | |||
| maxlen, | |||
| pngid | |||
| ) |
Dump the embedded PNG file from the archive file to an output file. @param infile pointer to the archive file @param pnglen size of the PNG file in bytes @param maxlen maximum size of the PNG file in bytes @param pngid indicates if this is the first or second PNG file.
Definition at line 127 of file fwfetcher.py.
| def fwfetcher.extractPirsFromZip | ( | systemupdate | ) |
Definition at line 533 of file fwfetcher.py.
| def fwfetcher.fill_directory | ( | infile, | |
| txtfile, | |||
| contents, | |||
| firstclust, | |||
| makedir, | |||
| start, | |||
| offset | |||
| ) |
Fill the directory structure with the files contained in the archive.
@param infile pointer to the archive
@param txtfile pointer to the resulting information text file
@param contents contains the directory information
@param firstclust address of the starting cluster of the first file in
infile (in 4kB blocks, minus start bytes)
@param makedir flag if directory should be filled, useful if only return
is wanted
@param start start of directory data
@param offset increment for calculating real starting cluster
Definition at line 249 of file fwfetcher.py.
| def fwfetcher.get_cluster | ( | startclust, | |
| offset | |||
| ) |
get the real starting cluster
Definition at line 236 of file fwfetcher.py.
| def fwfetcher.getFileOrURL | ( | filename, | |
| url | |||
| ) |
Definition at line 505 of file fwfetcher.py.
| def fwfetcher.handle_live_pirs | ( | infile, | |
| fsize | |||
| ) |
LIVE and PIRS files are archive files. They contain a certificate, payload, SHA1 checksums, 2 icons, textual information, and the files themselves. @param infile pointer to the archive file @param fsize size of infile
Definition at line 464 of file fwfetcher.py.
| def fwfetcher.mstime | ( | intime | ) |
Convert the time given in Microsoft format to a normal time tuple. @param intime the time in Microsoft format @return the time tuple
Definition at line 168 of file fwfetcher.py.
| def fwfetcher.nice_open_dir | ( | dirname | ) |
Checks if the output directory with the given name already exists, and if so, asks for overwrite permission. This means that any file in that directory might be overwritten. @param dirname name of the output directory to open @return overwrite permission
Definition at line 62 of file fwfetcher.py.
| def fwfetcher.nice_open_file | ( | filename | ) |
Checks if the output file with the given name already exists, and if so, asks for overwrite permission. @param filename name of the output file to open @return overwrite permission
Definition at line 45 of file fwfetcher.py.
| def fwfetcher.open_info_file | ( | infile | ) |
Open the informational text file.
The name is based on that of the input file.
@param infile pointer to the input file
@return pointer to the informational text file or None if there was no
overwrite permission
Definition at line 108 of file fwfetcher.py.
| def fwfetcher.strip_blanks | ( | instring | ) |
Strip the leading and trailing blanks from the input string. Blanks are: 0x00 (only trailing) space \t \n \r \v \f 0xFF @param instring the input string @return stripped version of instring
Definition at line 95 of file fwfetcher.py.
| def fwfetcher.write_common_part | ( | infile, | |
| txtfile, | |||
| png2stop, | |||
| start | |||
| ) |
Writes out the common part of PIRS/LIVE and CON files.
@param infile pointer to the PIRS/LIVE or CON file
@param txtfile pointer to the resulting text file
@param png2stop location where the second PNG image stops
(PIRS/LIVE : 0xB000, CON : 0xA000)
@param start start of directory data, from wxPirs
Definition at line 350 of file fwfetcher.py.
| string fwfetcher.basename = "FFFE07DF00000001" |
Definition at line 553 of file fwfetcher.py.
| fwfetcher.fw = getFileOrURL("SystemUpdate.zip", "http://www.xbox.com/system-update-usb") |
Definition at line 547 of file fwfetcher.py.
| list fwfetcher.lang |
Definition at line 550 of file fwfetcher.py.
| fwfetcher.name |
Definition at line 554 of file fwfetcher.py.
| fwfetcher.pirs = extractPirsFromZip(fw) |
Definition at line 548 of file fwfetcher.py.
| fwfetcher.pwd = os.getcwd() |
Definition at line 555 of file fwfetcher.py.
| fwfetcher.sio = StringIO.StringIO(pirs) |
Definition at line 552 of file fwfetcher.py.
| fwfetcher.target = "audios.bin" |
Definition at line 543 of file fwfetcher.py.