개인이 프로그래밍한 .py 프로그램을 사용하여 iso를 bin으로 압축시키면 모든 일이 다 끝나는데,
py를 실행하기 위해 파이선 2.7을 설치한 뒤 클릭하였으나 CUI가 떴다 바로 사라집니다.
압축하고자 하는 파일을 파이썬 프로그램 위에 끌어다놓고 실행하였더니, python.exe의 CUI에 아무 글자도 안 뜨고 검은 화면만 뜨더니 곧 창이 사라졌고, 시스템 용량은 변하지 않았습니다.
"Anyways let's get to the last part, the data tracks. If you followed everything you should now have one or two .iso files which bincuetool.exe outputted. You should compress them to compatible .bin files, use the attached comp.py file to compress the .iso files to .bin files. Then rename them according to the .hcd file you created."
이걸 어떻게 써야만 하는 건지 궁금합니다. exe가 아닌 파이썬이라 CMD로 여는 건 효과가 없더라고요.
프로그램은 이겁니다.
#!/usr/bin/env python -u
import os, struct, sys, zlib
fd = open(sys.argv[1], 'rb')
fd.seek(0, 2)
fdsize = fd.tell()
fd.seek(0)
entries = fdsize / 0x40000
if fdsize - (entries * 0x40000) > 0:
entries += 1
dst = open('compressed.bin', 'wb')
dst.write(struct.pack('<I', entries))
for i in xrange(entries):
dst.write(struct.pack('<I', 0))
dst.write(struct.pack('<I', 0))
dst.close()
dst = open('compressed.bin', 'r+b')
dst.seek(0, 2)
for i in xrange(entries):
offset = dst.tell()
data = fd.read(0x40000)
datacomp = zlib.compress(data, 9)
size = len(datacomp)
sizealigned = (size + 3) & -4
dst.write(datacomp)
dst.seek((i * 8) + 4)
dst.write(struct.pack('<I', offset))
dst.write(struct.pack('<I', sizealigned))
dst.seek(0, 2)
for i in xrange(sizealigned - size):
dst.write(chr(0))
dst.close()
fd.close()
아래 댓글대로 모두 해 보았지만 불가능합니다. 살려주세요.
python comp.py input_iso_file.iso
다만 해당 파일은 문법이 파이썬2 문법이므로 참고하시고, 파이썬 설치경로가 path에 올바로 포함되어 있어야 합니다.