PyFoxFile 0.28.2__tar.gz → 0.28.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyfoxfile-0.28.2 → pyfoxfile-0.28.4}/PKG-INFO +1 -1
- {pyfoxfile-0.28.2 → pyfoxfile-0.28.4}/PyFoxFile.egg-info/PKG-INFO +1 -1
- {pyfoxfile-0.28.2 → pyfoxfile-0.28.4}/foxfile.py +1 -1
- {pyfoxfile-0.28.2 → pyfoxfile-0.28.4}/foxfile_py3.py +1 -1
- {pyfoxfile-0.28.2 → pyfoxfile-0.28.4}/pyfoxfile.py +59 -21
- {pyfoxfile-0.28.2 → pyfoxfile-0.28.4}/pyfoxfile_py3.py +593 -195
- {pyfoxfile-0.28.2 → pyfoxfile-0.28.4}/pyproject.toml +1 -1
- {pyfoxfile-0.28.2 → pyfoxfile-0.28.4}/setup.py +1 -1
- {pyfoxfile-0.28.2 → pyfoxfile-0.28.4}/LICENSE +0 -0
- {pyfoxfile-0.28.2 → pyfoxfile-0.28.4}/PyFoxFile.egg-info/SOURCES.txt +0 -0
- {pyfoxfile-0.28.2 → pyfoxfile-0.28.4}/PyFoxFile.egg-info/dependency_links.txt +0 -0
- {pyfoxfile-0.28.2 → pyfoxfile-0.28.4}/PyFoxFile.egg-info/top_level.txt +0 -0
- {pyfoxfile-0.28.2 → pyfoxfile-0.28.4}/PyFoxFile.egg-info/zip-safe +0 -0
- {pyfoxfile-0.28.2 → pyfoxfile-0.28.4}/README.md +0 -0
- {pyfoxfile-0.28.2 → pyfoxfile-0.28.4}/setup.cfg +0 -0
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
Copyright 2018-2026 Game Maker 2k - http://intdb.sourceforge.net/
|
|
15
15
|
Copyright 2018-2026 Kazuki Przyborowski - https://github.com/KazukiPrzyborowski
|
|
16
16
|
|
|
17
|
-
$FileInfo: foxfile.py - Last Update: 2/
|
|
17
|
+
$FileInfo: foxfile.py - Last Update: 2/6/2026 Ver. 0.28.4 RC 1 - Author: cooldude2k $
|
|
18
18
|
'''
|
|
19
19
|
|
|
20
20
|
from __future__ import absolute_import, division, print_function, unicode_literals, generators, with_statement, nested_scopes
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
Copyright 2018-2026 Game Maker 2k - http://intdb.sourceforge.net/
|
|
14
14
|
Copyright 2018-2026 Kazuki Przyborowski - https://github.com/KazukiPrzyborowski
|
|
15
15
|
|
|
16
|
-
$FileInfo: foxfile_py3.py - Last Update: 2/
|
|
16
|
+
$FileInfo: foxfile_py3.py - Last Update: 2/6/2026 Ver. 0.28.4 RC 1 - Author: cooldude2k $
|
|
17
17
|
'''
|
|
18
18
|
|
|
19
19
|
from __future__ import annotations
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
Copyright 2018-2026 Game Maker 2k - http://intdb.sourceforge.net/
|
|
15
15
|
Copyright 2018-2026 Kazuki Przyborowski - https://github.com/KazukiPrzyborowski
|
|
16
16
|
|
|
17
|
-
$FileInfo: pyfoxfile.py - Last Update: 2/
|
|
17
|
+
$FileInfo: pyfoxfile.py - Last Update: 2/6/2026 Ver. 0.28.4 RC 1 - Author: cooldude2k $
|
|
18
18
|
'''
|
|
19
19
|
|
|
20
20
|
from __future__ import absolute_import, division, print_function, unicode_literals, generators, with_statement, nested_scopes
|
|
@@ -662,12 +662,12 @@ __project__ = __program_name__
|
|
|
662
662
|
__program_alt_name__ = __program_name__
|
|
663
663
|
__project_url__ = "https://github.com/GameMaker2k/PyFoxFile"
|
|
664
664
|
__project_release_url__ = __project_url__+"/releases/latest"
|
|
665
|
-
__version_info__ = (0, 28,
|
|
666
|
-
__version_date_info__ = (2026, 2,
|
|
665
|
+
__version_info__ = (0, 28, 4, "RC 1", 1)
|
|
666
|
+
__version_date_info__ = (2026, 2, 6, "RC 1", 1)
|
|
667
667
|
__version_date__ = str(__version_date_info__[0]) + "." + str(
|
|
668
668
|
__version_date_info__[1]).zfill(2) + "." + str(__version_date_info__[2]).zfill(2)
|
|
669
669
|
__revision__ = __version_info__[3]
|
|
670
|
-
__revision_id__ = "$Id:
|
|
670
|
+
__revision_id__ = "$Id: 085e0875c72d5a596b36394e09b88688e08236ef $"
|
|
671
671
|
if(__version_info__[4] is not None):
|
|
672
672
|
__version_date_plusrc__ = __version_date__ + \
|
|
673
673
|
"-" + str(__version_date_info__[4])
|
|
@@ -4647,7 +4647,7 @@ def ReadFileHeaderDataWoSize(fp, delimiter=_default_delim(None)):
|
|
|
4647
4647
|
return first_two + headerdata
|
|
4648
4648
|
|
|
4649
4649
|
|
|
4650
|
-
def ReadFileHeaderDataWithContent(fp, listonly=False, uncompress=True, skipchecksum=False, formatspecs=__file_format_dict__, saltkey=None):
|
|
4650
|
+
def ReadFileHeaderDataWithContent(fp, listonly=False, contentasfile=False, uncompress=True, skipchecksum=False, formatspecs=__file_format_dict__, saltkey=None):
|
|
4651
4651
|
if(not hasattr(fp, "read")):
|
|
4652
4652
|
return False
|
|
4653
4653
|
delimiter = formatspecs['format_delimiter']
|
|
@@ -4664,15 +4664,41 @@ def ReadFileHeaderDataWithContent(fp, listonly=False, uncompress=True, skipcheck
|
|
|
4664
4664
|
fcs = HeaderOut[-2].lower()
|
|
4665
4665
|
fccs = HeaderOut[-1].lower()
|
|
4666
4666
|
fsize = int(HeaderOut[7], 16)
|
|
4667
|
-
fcompression = HeaderOut[
|
|
4668
|
-
fcsize = int(HeaderOut[
|
|
4669
|
-
fseeknextfile = HeaderOut[
|
|
4670
|
-
fjsontype = HeaderOut[
|
|
4671
|
-
fjsonlen = int(HeaderOut[
|
|
4672
|
-
fjsonsize = int(HeaderOut[
|
|
4673
|
-
fjsonchecksumtype = HeaderOut[
|
|
4674
|
-
fjsonchecksum = HeaderOut[
|
|
4675
|
-
|
|
4667
|
+
fcompression = HeaderOut[17]
|
|
4668
|
+
fcsize = int(HeaderOut[18], 16)
|
|
4669
|
+
fseeknextfile = HeaderOut[28]
|
|
4670
|
+
fjsontype = HeaderOut[29]
|
|
4671
|
+
fjsonlen = int(HeaderOut[30], 16)
|
|
4672
|
+
fjsonsize = int(HeaderOut[31], 16)
|
|
4673
|
+
fjsonchecksumtype = HeaderOut[32]
|
|
4674
|
+
fjsonchecksum = HeaderOut[33]
|
|
4675
|
+
fextrasize = int(HeaderOut[34], 16)
|
|
4676
|
+
fextrafields = int(HeaderOut[35], 16)
|
|
4677
|
+
fextrafieldslist = []
|
|
4678
|
+
extrastart = 36
|
|
4679
|
+
extraend = extrastart + fextrafields
|
|
4680
|
+
while(extrastart < extraend):
|
|
4681
|
+
fextrafieldslist.append(HeaderOut[extrastart])
|
|
4682
|
+
extrastart = extrastart + 1
|
|
4683
|
+
fvendorfieldslist = []
|
|
4684
|
+
fvendorfields = 0;
|
|
4685
|
+
if((len(HeaderOut) - 4)>extraend):
|
|
4686
|
+
extrastart = extraend
|
|
4687
|
+
extraend = len(HeaderOut) - 4
|
|
4688
|
+
while(extrastart < extraend):
|
|
4689
|
+
fvendorfieldslist.append(HeaderOut[extrastart])
|
|
4690
|
+
extrastart = extrastart + 1
|
|
4691
|
+
fvendorfields = fvendorfields + 1
|
|
4692
|
+
if(fextrafields==1):
|
|
4693
|
+
try:
|
|
4694
|
+
fextrafieldslist = json.loads(base64.b64decode(fextrafieldslist[0]).decode("UTF-8"))
|
|
4695
|
+
fextrafields = len(fextrafieldslist)
|
|
4696
|
+
except (binascii.Error, json.decoder.JSONDecodeError, UnicodeDecodeError):
|
|
4697
|
+
try:
|
|
4698
|
+
fextrafieldslist = json.loads(fextrafieldslist[0])
|
|
4699
|
+
except (binascii.Error, json.decoder.JSONDecodeError, UnicodeDecodeError):
|
|
4700
|
+
pass
|
|
4701
|
+
fjstart = fp.tell()
|
|
4676
4702
|
if(fjsontype=="json"):
|
|
4677
4703
|
fjsoncontent = {}
|
|
4678
4704
|
fprejsoncontent = fp.read(fjsonsize).decode("UTF-8")
|
|
@@ -4739,31 +4765,37 @@ def ReadFileHeaderDataWithContent(fp, listonly=False, uncompress=True, skipcheck
|
|
|
4739
4765
|
except (binascii.Error, json.decoder.JSONDecodeError, UnicodeDecodeError):
|
|
4740
4766
|
pass
|
|
4741
4767
|
fp.seek(len(delimiter), 1)
|
|
4768
|
+
fjend = fp.tell() - 1
|
|
4742
4769
|
jsonfcs = GetFileChecksum(fprejsoncontent, fjsonchecksumtype, True, formatspecs, saltkey)
|
|
4743
4770
|
if(not CheckChecksums(fjsonchecksum, jsonfcs) and not skipchecksum):
|
|
4744
4771
|
VerbosePrintOut("File JSON Data Checksum Error with file " +
|
|
4745
4772
|
fname + " at offset " + str(fheaderstart))
|
|
4746
4773
|
VerbosePrintOut("'" + fjsonchecksum + "' != " + "'" + jsonfcs + "'")
|
|
4747
4774
|
return False
|
|
4748
|
-
|
|
4775
|
+
fcs = HeaderOut[-2].lower()
|
|
4776
|
+
fccs = HeaderOut[-1].lower()
|
|
4749
4777
|
newfcs = GetHeaderChecksum(HeaderOut[:-2], HeaderOut[-4].lower(), True, formatspecs, saltkey)
|
|
4750
|
-
HeaderOut.append(fjsoncontent)
|
|
4751
4778
|
if(fcs != newfcs and not skipchecksum):
|
|
4752
4779
|
VerbosePrintOut("File Header Checksum Error with file " +
|
|
4753
4780
|
fname + " at offset " + str(fheaderstart))
|
|
4754
4781
|
VerbosePrintOut("'" + fcs + "' != " + "'" + newfcs + "'")
|
|
4755
4782
|
return False
|
|
4783
|
+
fhend = fp.tell() - 1
|
|
4784
|
+
fcontentstart = fp.tell()
|
|
4756
4785
|
fcontents = MkTempFile()
|
|
4786
|
+
pyhascontents = False
|
|
4757
4787
|
if(fsize > 0 and not listonly):
|
|
4758
4788
|
if(fcompression == "none" or fcompression == "" or fcompression == "auto"):
|
|
4759
4789
|
fcontents.write(fp.read(fsize))
|
|
4760
4790
|
else:
|
|
4761
4791
|
fcontents.write(fp.read(fcsize))
|
|
4792
|
+
pyhascontents = True
|
|
4762
4793
|
elif(fsize > 0 and listonly):
|
|
4763
4794
|
if(fcompression == "none" or fcompression == "" or fcompression == "auto"):
|
|
4764
4795
|
fp.seek(fsize, 1)
|
|
4765
4796
|
else:
|
|
4766
4797
|
fp.seek(fcsize, 1)
|
|
4798
|
+
pyhascontents = False
|
|
4767
4799
|
fcontents.seek(0, 0)
|
|
4768
4800
|
newfccs = GetFileChecksum(fcontents, HeaderOut[-3].lower(), False, formatspecs, saltkey)
|
|
4769
4801
|
fcontents.seek(0, 0)
|
|
@@ -4777,12 +4809,15 @@ def ReadFileHeaderDataWithContent(fp, listonly=False, uncompress=True, skipcheck
|
|
|
4777
4809
|
else:
|
|
4778
4810
|
fcontents.seek(0, 0)
|
|
4779
4811
|
if(uncompress):
|
|
4780
|
-
cfcontents = UncompressFileAlt(
|
|
4812
|
+
cfcontents = UncompressFileAlt(
|
|
4813
|
+
fcontents, formatspecs)
|
|
4781
4814
|
cfcontents.seek(0, 0)
|
|
4782
4815
|
fcontents = MkTempFile()
|
|
4783
4816
|
shutil.copyfileobj(cfcontents, fcontents, length=__filebuff_size__)
|
|
4784
4817
|
cfcontents.close()
|
|
4785
4818
|
fcontents.seek(0, 0)
|
|
4819
|
+
fccs = GetFileChecksum(fcontents, HeaderOut[-3].lower(), False, formatspecs, saltkey)
|
|
4820
|
+
fcontentend = fp.tell()
|
|
4786
4821
|
if(re.findall("^\\+([0-9]+)", fseeknextfile)):
|
|
4787
4822
|
fseeknextasnum = int(fseeknextfile.replace("+", ""))
|
|
4788
4823
|
if(abs(fseeknextasnum) == 0):
|
|
@@ -4800,6 +4835,9 @@ def ReadFileHeaderDataWithContent(fp, listonly=False, uncompress=True, skipcheck
|
|
|
4800
4835
|
fp.seek(fseeknextasnum, 0)
|
|
4801
4836
|
else:
|
|
4802
4837
|
return False
|
|
4838
|
+
fcontents.seek(0, 0)
|
|
4839
|
+
if(not contentasfile):
|
|
4840
|
+
fcontents = fcontents.read()
|
|
4803
4841
|
HeaderOut.append(fcontents)
|
|
4804
4842
|
return HeaderOut
|
|
4805
4843
|
|
|
@@ -5248,7 +5286,7 @@ def ReadFileHeaderDataWithContentToList(fp, listonly=False, contentasfile=False,
|
|
|
5248
5286
|
return outlist
|
|
5249
5287
|
|
|
5250
5288
|
|
|
5251
|
-
def ReadFileDataWithContent(fp, filestart=0, listonly=False, uncompress=True, skipchecksum=False, formatspecs=__file_format_dict__, saltkey=None):
|
|
5289
|
+
def ReadFileDataWithContent(fp, filestart=0, listonly=False, contentasfile=False, uncompress=True, skipchecksum=False, formatspecs=__file_format_dict__, saltkey=None):
|
|
5252
5290
|
if(not hasattr(fp, "read")):
|
|
5253
5291
|
return False
|
|
5254
5292
|
delimiter = formatspecs['format_delimiter']
|
|
@@ -5286,8 +5324,8 @@ def ReadFileDataWithContent(fp, filestart=0, listonly=False, uncompress=True, sk
|
|
|
5286
5324
|
"'" + newfcs + "'")
|
|
5287
5325
|
return False
|
|
5288
5326
|
fnumfiles = int(inheader[8], 16)
|
|
5289
|
-
outfseeknextfile =
|
|
5290
|
-
fjsonsize = int(
|
|
5327
|
+
outfseeknextfile = inheader[9]
|
|
5328
|
+
fjsonsize = int(inheader[12], 16)
|
|
5291
5329
|
fjsonchecksumtype = inheader[13]
|
|
5292
5330
|
fjsonchecksum = inheader[14]
|
|
5293
5331
|
fp.read(fjsonsize)
|
|
@@ -5312,7 +5350,7 @@ def ReadFileDataWithContent(fp, filestart=0, listonly=False, uncompress=True, sk
|
|
|
5312
5350
|
countnum = 0
|
|
5313
5351
|
flist = []
|
|
5314
5352
|
while(countnum < fnumfiles):
|
|
5315
|
-
HeaderOut = ReadFileHeaderDataWithContent(fp, listonly, uncompress, skipchecksum, formatspecs, saltkey)
|
|
5353
|
+
HeaderOut = ReadFileHeaderDataWithContent(fp, listonly, contentasfile, uncompress, skipchecksum, formatspecs, saltkey)
|
|
5316
5354
|
if(len(HeaderOut) == 0):
|
|
5317
5355
|
break
|
|
5318
5356
|
flist.append(HeaderOut)
|