' Распаковка PAK-файла Chromium Option Explicit Dim fso, f1, f2, f3, s, ch, path, i, j, iCount, rc, currpos, nextpos Dim A(400000) Set fso = CreateObject("Scripting.FileSystemObject") path = "c:\Opera Next\15.0.1147.24\localization\" Set f1 = fso.OpenTextFile(path + "ru.pak",1, False, 0) Set f2 = fso.OpenTextFile(path + "ru.unp",2,True) Set f3 = fso.OpenTextFile(path + "ru.id",2,True) iCount = fso.GetFile(path + "ru.pak").Size - 1 For i = 0 To iCount s = f1.Read(1) A(i) = Asc(s) next rc = Read4(4) currpos = 9 nextpos = currpos + 6 For i = 1 To rc s = "" For j = read4(currpos +2) To read4(nextpos +2) - 1 ch = A(j) Select Case ch Case 13: s = s + Chr(8) Case 10: s = s + Chr(7) Case else s = s + Chr(A(j)) End select next f2.WriteLine s f3.WriteLine CStr(A(currpos) + A(currpos + 1) * 256) currpos = nextpos nextpos = currpos + 6 Next f1.Close f2.Close f3.Close Function Read4(offset)' Возврашает 4-байтовое число Dim n n = A(offset) + A(offset + 1) * 256 + A(offset + 2) * 256 * 256 + A(offset + 3) * 256 * 256 * 256 Read4 = n End Function |