-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
1,388 additions
and
106 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
/play.ps3/dev_hdd0/PS3ISO/Marvel.Vs.Capcom.3[BLUS30410].iso | ||
/play.ps3/dev_hdd0/PS3ISO/This Is The Iso Filename.iso |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
GET /play.ps3/dev_hdd0/PS3ISO/Marvel.Vs.Capcom.3%5BBLUS30410%5D.iso HTTP/1.0 | ||
GET /play.ps3/dev_hdd0/PS3ISO/This%20Is%20The%20Iso%20Filename.iso HTTP/1.0 |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{ | ||
"title":"Marvel vs. Capcom 3: Fate of Two Worlds", | ||
"iso_filepath":"/dev_hdd0/PS3ISO/Marvel.Vs.Capcom.3[BLUS30410].iso", | ||
"title_id":"SLUS30411", | ||
"title":"This Is The Game Title Shown On XMB", | ||
"iso_filepath":"/dev_hdd0/PS3ISO/This Is The Iso Filename.iso", | ||
"title_id":"WCUS12345", | ||
"game_type":"", | ||
"iso_filename":"", | ||
"device_type":"", | ||
"content_id":"UP0001-SLUS30411_00-0000000000000000" | ||
"content_id":"UP0001-WCUS12345_00-0000000000000000" | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Copyright (c) 2011 PSL1GHT Development Team | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,282 @@ | ||
import struct, sys | ||
|
||
class SstructType(tuple): | ||
def __getitem__(self, value): | ||
return [self] * value | ||
def __call__(self, value, endian='<'): | ||
if isinstance(value, str): | ||
return struct.unpack(endian + tuple.__getitem__(self, 0), value[:tuple.__getitem__(self, 1)])[0] | ||
else: | ||
return struct.pack(endian + tuple.__getitem__(self, 0), value) | ||
|
||
class SstructException(Exception): | ||
pass | ||
|
||
class Sstruct(object): | ||
__slots__ = ('__attrs__', '__baked__', '__defs__', '__endian__', '__next__', '__sizes__', '__values__') | ||
int8 = SstructType(('b', 1)) | ||
uint8 = SstructType(('B', 1)) | ||
|
||
int16 = SstructType(('h', 2)) | ||
uint16 = SstructType(('H', 2)) | ||
|
||
int32 = SstructType(('l', 4)) | ||
uint32 = SstructType(('L', 4)) | ||
|
||
int64 = SstructType(('q', 8)) | ||
uint64 = SstructType(('Q', 8)) | ||
|
||
float = SstructType(('f', 4)) | ||
|
||
def string(cls, len, offset=0, encoding=None, stripNulls=False, value=''): | ||
return SstructType(('string', (len, offset, encoding, stripNulls, value))) | ||
string = classmethod(string) | ||
|
||
LE = '<' | ||
BE = '>' | ||
__endian__ = '<' | ||
|
||
def __init__(self, func=None, unpack=None, **kwargs): | ||
self.__defs__ = [] | ||
self.__sizes__ = [] | ||
self.__attrs__ = [] | ||
self.__values__ = {} | ||
self.__next__ = True | ||
self.__baked__ = False | ||
|
||
if func == None: | ||
self.__format__() | ||
else: | ||
sys.settrace(self.__trace__) | ||
func() | ||
for name in func.func_code.co_varnames: | ||
value = self.__frame__.f_locals[name] | ||
self.__setattr__(name, value) | ||
|
||
self.__baked__ = True | ||
|
||
if unpack != None: | ||
if isinstance(unpack, tuple): | ||
self.unpack(*unpack) | ||
else: | ||
self.unpack(unpack) | ||
|
||
if len(kwargs): | ||
for name in kwargs: | ||
self.__values__[name] = kwargs[name] | ||
|
||
def __trace__(self, frame, event, arg): | ||
self.__frame__ = frame | ||
sys.settrace(None) | ||
|
||
def __setattr__(self, name, value): | ||
if name in self.__slots__: | ||
return object.__setattr__(self, name, value) | ||
|
||
if self.__baked__ == False: | ||
if not isinstance(value, list): | ||
value = [value] | ||
attrname = name | ||
else: | ||
attrname = '*' + name | ||
|
||
self.__values__[name] = None | ||
|
||
for sub in value: | ||
if isinstance(sub, Sstruct): | ||
sub = sub.__class__ | ||
try: | ||
if issubclass(sub, Sstruct): | ||
sub = ('struct', sub) | ||
except TypeError: | ||
pass | ||
type_, size = tuple(sub) | ||
if type_ == 'string': | ||
self.__defs__.append(Sstruct.string) | ||
self.__sizes__.append(size) | ||
self.__attrs__.append(attrname) | ||
self.__next__ = True | ||
|
||
if attrname[0] != '*': | ||
self.__values__[name] = size[3] | ||
elif self.__values__[name] == None: | ||
self.__values__[name] = [size[3] for val in value] | ||
elif type_ == 'struct': | ||
self.__defs__.append(Sstruct) | ||
self.__sizes__.append(size) | ||
self.__attrs__.append(attrname) | ||
self.__next__ = True | ||
|
||
if attrname[0] != '*': | ||
self.__values__[name] = size() | ||
elif self.__values__[name] == None: | ||
self.__values__[name] = [size() for val in value] | ||
else: | ||
if self.__next__: | ||
self.__defs__.append('') | ||
self.__sizes__.append(0) | ||
self.__attrs__.append([]) | ||
self.__next__ = False | ||
|
||
self.__defs__[-1] += type_ | ||
self.__sizes__[-1] += size | ||
self.__attrs__[-1].append(attrname) | ||
|
||
if attrname[0] != '*': | ||
self.__values__[name] = 0 | ||
elif self.__values__[name] == None: | ||
self.__values__[name] = [0 for val in value] | ||
else: | ||
try: | ||
self.__values__[name] = value | ||
except KeyError: | ||
raise AttributeError(name) | ||
|
||
def __getattr__(self, name): | ||
if self.__baked__ == False: | ||
return name | ||
else: | ||
try: | ||
return self.__values__[name] | ||
except KeyError: | ||
raise AttributeError(name) | ||
|
||
def __len__(self): | ||
ret = 0 | ||
arraypos, arrayname = None, None | ||
|
||
for i in range(len(self.__defs__)): | ||
sdef, size, attrs = self.__defs__[i], self.__sizes__[i], self.__attrs__[i] | ||
|
||
if sdef == Sstruct.string: | ||
size, offset, encoding, stripNulls, value = size | ||
if isinstance(size, str): | ||
size = self.__values__[size] + offset | ||
elif sdef == Sstruct: | ||
if attrs[0] == '*': | ||
if arrayname != attrs: | ||
arrayname = attrs | ||
arraypos = 0 | ||
size = len(self.__values__[attrs[1:]][arraypos]) | ||
size = len(self.__values__[attrs]) | ||
|
||
ret += size | ||
|
||
return ret | ||
|
||
def unpack(self, data, pos=0): | ||
for name in self.__values__: | ||
if not isinstance(self.__values__[name], Sstruct): | ||
self.__values__[name] = None | ||
elif self.__values__[name].__class__ == list and len(self.__values__[name]) != 0: | ||
if not isinstance(self.__values__[name][0], Sstruct): | ||
self.__values__[name] = None | ||
|
||
arraypos, arrayname = None, None | ||
|
||
for i in range(len(self.__defs__)): | ||
sdef, size, attrs = self.__defs__[i], self.__sizes__[i], self.__attrs__[i] | ||
|
||
if sdef == Sstruct.string: | ||
size, offset, encoding, stripNulls, value = size | ||
if isinstance(size, str): | ||
size = self.__values__[size] + offset | ||
|
||
temp = data[pos:pos+size] | ||
if len(temp) != size: | ||
raise SstructException('Expected %i byte string, got %i' % (size, len(temp))) | ||
|
||
if encoding != None: | ||
temp = temp.decode(encoding) | ||
|
||
if stripNulls: | ||
temp = temp.rstrip('\0') | ||
|
||
if attrs[0] == '*': | ||
name = attrs[1:] | ||
if self.__values__[name] == None: | ||
self.__values__[name] = [] | ||
self.__values__[name].append(temp) | ||
else: | ||
self.__values__[attrs] = temp | ||
pos += size | ||
elif sdef == Sstruct: | ||
if attrs[0] == '*': | ||
if arrayname != attrs: | ||
arrayname = attrs | ||
arraypos = 0 | ||
name = attrs[1:] | ||
self.__values__[attrs][arraypos].unpack(data, pos) | ||
pos += len(self.__values__[attrs][arraypos]) | ||
arraypos += 1 | ||
else: | ||
self.__values__[attrs].unpack(data, pos) | ||
pos += len(self.__values__[attrs]) | ||
else: | ||
values = struct.unpack(self.__endian__+sdef, data[pos:pos+size]) | ||
pos += size | ||
j = 0 | ||
for name in attrs: | ||
if name[0] == '*': | ||
name = name[1:] | ||
if self.__values__[name] == None: | ||
self.__values__[name] = [] | ||
self.__values__[name].append(values[j]) | ||
else: | ||
self.__values__[name] = values[j] | ||
j += 1 | ||
|
||
return self | ||
|
||
def pack(self): | ||
arraypos, arrayname = None, None | ||
|
||
ret = '' | ||
for i in range(len(self.__defs__)): | ||
sdef, size, attrs = self.__defs__[i], self.__sizes__[i], self.__attrs__[i] | ||
|
||
if sdef == Sstruct.string: | ||
size, offset, encoding, stripNulls, value = size | ||
if isinstance(size, str): | ||
size = self.__values__[size]+offset | ||
|
||
if attrs[0] == '*': | ||
if arrayname != attrs: | ||
arraypos = 0 | ||
arrayname = attrs | ||
temp = self.__values__[attrs[1:]][arraypos] | ||
arraypos += 1 | ||
else: | ||
temp = self.__values__[attrs] | ||
|
||
if encoding != None: | ||
temp = temp.encode(encoding) | ||
|
||
temp = temp[:size] | ||
ret += temp + ('\0' * (size - len(temp))) | ||
elif sdef == Sstruct: | ||
if attrs[0] == '*': | ||
if arrayname != attrs: | ||
arraypos = 0 | ||
arrayname = attrs | ||
ret += self.__values__[attrs[1:]][arraypos].pack() | ||
arraypos += 1 | ||
else: | ||
ret += self.__values__[attrs].pack() | ||
else: | ||
values = [] | ||
for name in attrs: | ||
if name[0] == '*': | ||
if arrayname != name: | ||
arraypos = 0 | ||
arrayname = name | ||
values.append(self.__values__[name[1:]][arraypos]) | ||
arraypos += 1 | ||
else: | ||
values.append(self.__values__[name]) | ||
|
||
ret += struct.pack(self.__endian__+sdef, *values) | ||
return ret | ||
|
||
def __getitem__(self, value): | ||
return [('struct', self.__class__)] * value |
Oops, something went wrong.