1
Инструменты / [DC][PS1][PS2][GC] Плагин к 7-zip для распаковки CHD, RVZ и AFS
« : Сегодня в 06:04:54 »
Просто линк оставить в профильной на эту тему, откровенно плагин удобный для некоторых моментов.
В этом разделе можно просмотреть все сообщения, сделанные этим пользователем.
распаковщик с помощья чата с Алиса ИИ создать удалосьЦитата: kazetrigger post_id=203387 time=1785010755 user_id=22355I made my own custom tool that incorporates the functionality found in the following projects:
https://github.com/VincentNLOBJ/pvr2image
https://github.com/VincentNLOBJ/PyPVR
You can probably get by with PyPVR for most cases. In the case of deSpiria, it has .CPR files which are LZSS compressed. You'll need to decompress them to PVR first. I found an algorithm to handle that and incorporated that.
The python code for it is as follows (Please note that this code assumes other parts of code are present such as PvrError, so you'll have to tweak the code a bit to get it work. This assumes you have some programming knowledge. If you don't want to raise that custom error, you can raise a standard error or just replace it with print() statements):Код: [Выделить]def lzss_decompress(data: bytes) -> bytes:
if len(data) < 5:
raise PvrError("LZSS input is too short")
target_size = struct.unpack_from("<I", data, 0)[0]
if target_size <= 0:
raise PvrError(f"invalid LZSS decompressed size: {target_size}")
ring = bytearray(4096)
ring_pos = 0xFEE
src_pos = 4
out = bytearray()
while src_pos < len(data) and len(out) < target_size:
flags = data[src_pos]
src_pos += 1
for bit in range(8):
if flags & (1 << bit):
# Literal byte
if src_pos >= len(data):
raise PvrError("truncated LZSS literal")
value = data[src_pos]
src_pos += 1
out.append(value)
ring[ring_pos] = value
ring_pos = (ring_pos + 1) & 0xFFF
else:
# Two-byte back-reference
if src_pos + 1 >= len(data):
raise PvrError("truncated LZSS back-reference")
b0 = data[src_pos]
b1 = data[src_pos + 1]
src_pos += 2
offset = b0 | ((b1 & 0xF0) << 4)
length = (b1 & 0x0F) + 3
for i in range(length):
value = ring[(offset + i) & 0xFFF]
out.append(value)
ring[ring_pos] = value
ring_pos = (ring_pos + 1) & 0xFFF
if len(out) >= target_size:
break
if len(out) >= target_size:
break
if len(out) != target_size:
raise PvrError(
f"LZSS stream ended at {len(out):,} bytes; "
f"expected {target_size:,}"
)
return bytes(out)
Input a CPR's data as bytes and get the bytes out which you can then export to a file.
import struct
import sys
def lzss_decompress(data: bytes) -> bytes:
print(" [LZSS] Checking input length...")
if len(data) < 5:
raise ValueError("LZSS input is too short")
target_size = struct.unpack_from("<I", data, 0)[0]
print(f" [LZSS] Target size from header: {target_size} bytes")
if target_size <= 0:
raise ValueError(f"Invalid LZSS decompressed size: {target_size}")
ring = bytearray(4096)
ring_pos = 0xFEE
src_pos = 4
out = bytearray()
print(" [LZSS] Starting decompression loop...")
while src_pos < len(data) and len(out) < target_size:
flags = data[src_pos]
src_pos += 1
for bit in range(8):
if flags & (1 << bit):
# Literal byte
if src_pos >= len(data):
raise ValueError("Truncated LZSS literal")
value = data[src_pos]
src_pos += 1
out.append(value)
ring[ring_pos] = value
ring_pos = (ring_pos + 1) & 0xFFF
else:
# Two-byte back-reference
if src_pos + 1 >= len(data):
raise ValueError("Truncated LZSS back-reference")
b0 = data[src_pos]
b1 = data[src_pos + 1]
src_pos += 2
offset = b0 | ((b1 & 0xF0) << 4)
length = (b1 & 0x0F) + 3
for i in range(length):
value = ring[(offset + i) & 0xFFF]
out.append(value)
ring[ring_pos] = value
ring_pos = (ring_pos + 1) & 0xFFF
if len(out) >= target_size:
break
if len(out) >= target_size:
break
if len(out) != target_size:
raise ValueError(
f"LZSS stream ended at {len(out):,} bytes; expected {target_size:,}"
)
return bytes(out)
def main():
print("=== LZSS Decompressor started ===")
if len(sys.argv) < 3:
print("Usage: python lzss_decompress.py <input.cpr> <output.bin>")
sys.exit(1)
input_path = sys.argv[1]
output_path = sys.argv[2]
print(f"[MAIN] Input: {input_path}")
print(f"[MAIN] Output: {output_path}")
try:
with open(input_path, "rb") as f:
data = f.read()
print(f"[MAIN] Read {len(data)} bytes from input file")
except FileNotFoundError:
print(f"ERROR: Input file not found: {input_path}", file=sys.stderr)
sys.exit(1)
except Exception as e:
print(f"ERROR reading file: {e}", file=sys.stderr)
sys.exit(1)
try:
decompressed = lzss_decompress(data)
print(f"[MAIN] Decompressed to {len(decompressed)} bytes")
except ValueError as e:
print(f"LZSS decompression error: {e}", file=sys.stderr)
sys.exit(1)
except Exception as e:
print(f"Unexpected error during decompression: {e}", file=sys.stderr)
sys.exit(1)
try:
with open(output_path, "wb") as f:
f.write(decompressed)
print(f"[MAIN] Wrote {len(decompressed)} bytes to output file")
print("=== Done ===")
except Exception as e:
print(f"Error writing output file: {e}", file=sys.stderr)
sys.exit(1)
if __name__ == "__main__":
main()неудается упаковать полученный *.pvr обратно, помогите если не сложно с реализациейhttps://rutube.ru/video/821dd85a6ff938816e108f706670c024/
Любопытно.проверено это скам какой-то, функционал ограничен
VAGp..........\А..]АЖvяяXў.4™Ю..PSX.AIFF.
Ё не будет?все буквы в наличии
А почему строчные Е и Ё и Ь с Ъ отличаются друг от друга? Ограничение по высоте какое-то или просто на скорую руку нарисованы?оригинальный шрифт из игры, из строчных не хватало только А
Например, Industrial Spy: Operation Espionage.Спасибо что напомнил. Есть там шрифт с кирилицей, но к сожалению мне пока не понятно каким образом это реализовать, прогать я ничего не смогу(будем реалистами), процесс самого перевода с нуля даже с английского(круптар мне неудобен и непонятен) для меня душнина... В общем все против этих игр))))
что то я погорячился японская кодировка это дичь лютая 
А кто-нибудь ковырял Omikron: The Nomad Soul на возможность востановления? Да я знаю что уже есть версия с востановленными роликами и музыкой, но перевод почему-то выбрали с нечитаемым шрифтом.UP подниму обсуждение
magnet:?xt=urn:btih:FCC9672F3081AEDA7492F843B7D3017176E0B08F&dn=DragonRiders%20-%20Chronicles%20of%20Pern%20v1.002%20%282001%29%28Ubi%20Soft%29%28US%29%5b%21%5d&tr=http%3a%2f%2fbt.t-ru.org%2fann&tr=http%3a%2f%2fretracker.local%2fannounce&tr=wss%3a%2f%2ftracker.btorrent.xyz&tr=http%3a%2f%2fre.good73.net%3a2710%2fannounce