Browse Source

Swapped back slash for forward slash in PacRepack.py

master
surkeh 4 years ago
parent
commit
ae44adf6f8
  1. 16
      PacRepack.py

16
PacRepack.py

@ -1,3 +1,5 @@ @@ -1,3 +1,5 @@
#!/usr/bin/python
#! python2
#Pac Repacker
#Coded by James
@ -35,7 +37,7 @@ def getFilesPTX(index_file): @@ -35,7 +37,7 @@ def getFilesPTX(index_file):
def PTX(file, folder):
print "\nRepacking PTX Archive: %s" % file
try:
index_file = open("%s\\%s\\%s.index" % (folder, file, file), "r")
index_file = open("%s/%s/%s.index" % (folder, file, file), "r")
except:
print "Error Reading %s.index from PTX folder %s" % (file, file)
@ -43,13 +45,13 @@ def PTX(file, folder): @@ -43,13 +45,13 @@ def PTX(file, folder):
num_files = len(files)
header = pack("<I", num_files)
body = ""
trailer_open = open("%s\\%s.trail" % (folder, file), "rb")
trailer_open = open("%s/%s.trail" % (folder, file), "rb")
#trailer_open.seek(2048)
trailer = trailer_open.read(2160)
outfile = open("%s\\%s.ptx" % (folder, file), "wb")
outfile = open("%s/%s.ptx" % (folder, file), "wb")
for i in range(num_files):
bin_open = open("%s\\%s\\%s" % (folder, file, files[i]), "rb")
bin_open = open("%s/%s/%s" % (folder, file, files[i]), "rb")
bin_str = bin_open.read()
header += pack("<I", len(bin_str)/1024/2)
body += bin_str
@ -66,7 +68,7 @@ def MakeBody(files, folder): @@ -66,7 +68,7 @@ def MakeBody(files, folder):
num_files = len(files)
pointers = [0] #starting position
for i in range(num_files):
file_open = open("%s\\%s" % (folder, files[i]), "rb")
file_open = open("%s/%s" % (folder, files[i]), "rb")
body += file_open.read()
pointers.append(len(body))
del pointers[-1] #delete file size marker
@ -122,7 +124,7 @@ def main(): @@ -122,7 +124,7 @@ def main():
#if can't open, exit
print "Opening: %s.index" % folder
try:
index_file = open("%s\\%s.index" % (folder, folder), "r")
index_file = open("%s/%s.index" % (folder, folder), "r")
except:
print "Error Opening %s.index" % folder
return -1
@ -158,4 +160,4 @@ def main(): @@ -158,4 +160,4 @@ def main():
print "\nAll Done!"
return 0
main()
main()

Loading…
Cancel
Save