Привет всем. Сегодня я хочу поделится с вами тем что нашла по поводу resource tool. Возможно кому-нубить это покажется интересным и он продолжит самостоятельно писать его. Я представлю вам код на трех различных языках.
Imports Fesersoft.Hashing
Imports System
Imports System.Collections.Generic
Imports System.IO
Imports System.Linq
Imports System.Runtime.InteropServices
Imports System.Text
Imports System.Windows.Forms
Namespace S4LResourceLib
Public Class ZipFolder
' Methods
Public Sub New(ByVal filename As String)
Me.fileName = filename
If File.Exists(filename) Then
Dim buffer As Byte()
If Not Directory.Exists("S4Resource.backup") Then
Directory.CreateDirectory("S4Resource.backup")
End If
Me.workingPath = Directory.GetParent(Application.ExecutablePath).FullName
Directory.SetCurrentDirectory(Me.workingPath)
Try
buffer = File.ReadAllBytes(filename)
Catch exception As Exception
MessageBox.Show(("Can not open file " & filename & ChrW(10) & "Exception: " & exception.Message))
Return
End Try
If (buffer.Length >= 8) Then
Me.fileReader = New BinaryReader(New MemoryStream(buffer))
If (Me.fileReader.ReadInt32 <> 1) Then
MessageBox.Show("File format has changed!")
Else
Me.numberOfFiles = Me.fileReader.ReadInt32
Me.initialized = True
Me.decryptHeaders
End If
Else
MessageBox.Show("File too small!")
End If
End If
End Sub
<DllImport("lzo.dll")> _
Private Shared Function __lzo_init3() As Integer
End Function
Public Sub clean()
If (Directory.Exists("_resources") AndAlso Not Directory.Exists("_resources.bkp")) Then
Directory.SetCurrentDirectory(Me.workingPath)
Directory.Move("_resources", "_resources.bkp")
Directory.CreateDirectory("_resources")
Dim header As FileHeader
For Each header In Me.fileHeaders.Values.ToList(Of FileHeader)()
If File.Exists(("_resources.bkp\" & header.CRC.ToString("X"))) Then
File.Move(("_resources.bkp\" & header.CRC.ToString("X")), ("_resources\" & header.CRC.ToString("X")))
End If
Next
MessageBox.Show("You can delete the folder _resources.bkp now.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)
End If
End Sub
Public Function Compress(ByVal src As Byte()) As Byte()
Try
Dim dst As Byte() = New Byte(((((src.Length + (src.Length / &H40)) + &H10) + 3) + 4) - 1) {}
Dim num As Integer = 0
ZipFolder.lzo1x_1_compress(src, src.Length, dst, (num), Me._workMemory)
Dim destinationArray As Byte() = New Byte(num - 1) {}
Array.Copy(dst, 0, destinationArray, 0, num)
Return destinationArray
Catch exception1 As Exception
Return New Byte(1 - 1) {}
End Try
End Function
Public Function Decompress(ByVal src As Byte(), ByVal size As Integer) As Byte()
Try
Dim num As Integer = size
Dim dst As Byte() = New Byte(num - 1) {}
Dim num2 As Integer = num
ZipFolder.lzo1x_decompress(src, (src.Length - 4), dst, (num2), Me._workMemory)
Return dst
Catch exception1 As Exception
Return New Byte(1 - 1) {}
End Try
End Function
Private Sub decryptCapped256(ByRef data As Byte(), ByVal size As Integer)
Try
Dim num As Integer
Dim index As Integer = 0
If (size >= &H100) Then
num = &H100
Else
num = size
End If
Do While (index < num)
data(index) = CByte((((data(index) >> 1) And &H7F) Or ((data(index) And 1) << 7)))
data(index) = CByte((data(index) Xor ZipFolder.Key((index Mod &H20))))
index += 1
Loop
Catch exception1 As Exception
End Try
End Sub
Private Sub decryptHeaders()
If Me.initialized Then
Me.fileHeaders = New Dictionary(Of String, FileHeader)(Me.numberOfFiles)
Dim numberOfFiles As Integer = Me.numberOfFiles
Do While (numberOfFiles > 0)
Try
Dim count As Integer = Me.fileReader.ReadInt32
Dim data As Byte() = Me.fileReader.ReadBytes(count)
Me.decryptCapped256((data), &H110)
Dim reader As New BinaryReader(New MemoryStream(data))
Dim header As New FileHeader { _
.FileName = Encoding.ASCII.GetString(reader.ReadBytes(&H100)).Trim(ZipFolder.trimChars), _
.CRC = reader.ReadInt64, _
.FileSize = reader.ReadInt32, _
.Unknown = reader.ReadInt32 _
}
Me.fileHeaders.Add(header.FileName, header)
numberOfFiles -= 1
Continue Do
Catch exception1 As Exception
Continue Do
End Try
Loop
Me.decrypted = True
End If
End Sub
Private Sub encryptCapped256(ByRef data As Byte(), ByVal size As Integer)
Dim num As Integer
Dim index As Integer = 0
If (size >= &H100) Then
num = &H100
Else
num = size
End If
Do While (index < num)
data(index) = CByte((data(index) Xor ZipFolder.Key((index Mod &H20))))
data(index) = CByte((((data(index) And &H7F) << 1) Or ((data(index) And &H80) >> 7)))
index += 1
Loop
End Sub
Public Function exportFile(ByVal fullPath As String, ByVal save As String) As String
Try
Directory.SetCurrentDirectory(Me.workingPath)
Dim header As FileHeader = Me.fileHeaders.Item(fullPath)
If (header.FileName Is Nothing) Then
Return Nothing
End If
Dim data As Byte() = File.ReadAllBytes(("_resources\" & header.CRC.ToString("X")))
Me.swapBytes((data), data.Length)
Dim buffer2 As Byte() = Me.Decompress(data, header.FileSize)
Dim fileSize As Integer = header.FileSize
Me.decryptCapped256((buffer2), fileSize)
If fullPath.EndsWith(".x7") Then
Return Nothing
End If
File.WriteAllBytes(save, buffer2)
Return ("Exported from: _resources\" & header.CRC.ToString("X"))
Catch exception As Exception
MessageBox.Show(("Exception: " & exception.Message), "Error!", MessageBoxButtons.OK, MessageBoxIcon.Hand)
Return Nothing
End Try
End Function
Public Function GenerateCRC(ByVal fullPath As String, ByRef fileData As Byte()) As Long
Dim crc As New crc32
Dim num As Long = crc.CRC(fileData)
Dim num2 As Long = crc.CRC(Encoding.ASCII.GetBytes(fullPath))
Dim num3 As Long = (num Or (num2 << &H20))
Dim buffer As Byte() = New Byte(8 - 1) {}
New BinaryWriter(New MemoryStream(buffer, True)).Write(num3)
Me.encryptCapped256((buffer), 8)
Dim reader As New BinaryReader(New MemoryStream(buffer))
Return reader.ReadInt64
End Function
Public Function getFileNames() As List(Of String)
If (Me.initialized AndAlso Me.decrypted) Then
Return Me.fileHeaders.Keys.ToList(Of String)()
End If
Return New List(Of String)
End Function
<DllImport("lzo.dll")> _
Private Shared Function lzo_version_date() As String
End Function
<DllImport("lzo.dll")> _
Private Shared Function lzo_version_string() As String
End Function
<DllImport("lzo.dll")> _
Private Shared Function lzo1x_1_compress(ByVal src As Byte(), ByVal src_len As Integer, ByVal dst As Byte(), ByRef dst_len As Integer, ByVal wrkmem As Byte()) As Integer
End Function
<DllImport("lzo.dll")> _
Private Shared Function lzo1x_decompress(ByVal src As Byte(), ByVal src_len As Integer, ByVal dst As Byte(), ByRef dst_len As Integer, ByVal wrkmem As Byte()) As Integer
End Function
Public Function replaceFile(ByVal fullPath As String, ByRef fileData As Byte(), ByVal correctCRC As Boolean) As String
If (Not Me.initialized OrElse Not Me.decrypted) Then
Return Nothing
End If
Directory.SetCurrentDirectory(Me.workingPath)
Dim header As FileHeader = Me.fileHeaders.Item(fullPath)
Dim buffer As Byte() = fileData
If fullPath.EndsWith(".x7") Then
Return Nothing
End If
If (header.FileName Is Nothing) Then
header.FileName = fullPath
header.CRC = Me.GenerateCRC(fullPath, (buffer))
header.FileSize = fileData.Length
header.Unknown = 0
Me.fileHeaders.Add(header.FileName, header)
Else
header.FileSize = buffer.Length
If correctCRC Then
header.CRC = Me.GenerateCRC(header.FileName, (buffer))
End If
End If
If File.Exists(("_resources\" & header.CRC.ToString("X"))) Then
File.Copy(("_resources\" & header.CRC.ToString("X")), String.Concat(New Object() { "S4Resource.backup\", DateTime.Now.Day, "-", DateTime.Now.Month, "-", DateTime.Now.Year, "_", DateTime.Now.Hour, "-", DateTime.Now.Minute, "-", DateTime.Now.Second, "_", header.CRC.ToString("X") }))
End If
Me.saveEncryptedFile(header, (buffer))
Me.saveFolder
MessageBox.Show("Import successfully!", "successfully!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)
Return ("Saved to: _resources\" & header.CRC.ToString("X"))
End Function
Private Sub saveEncryptedFile(ByVal fileHeader As FileHeader, ByRef fileData As Byte())
If (Me.initialized AndAlso Me.decrypted) Then
Me.encryptCapped256((fileData), fileData.Length)
Dim data As Byte() = Me.Compress(fileData)
Me.swapBytes((data), data.Length)
File.WriteAllBytes(("_resources\" & fileHeader.CRC.ToString("X")), data)
End If
End Sub
Private Sub saveFolder()
File.Copy("resource.s4hd", String.Concat(New Object() { "S4Resource.backup\", DateTime.Now.Day, "-", DateTime.Now.Month, "-", DateTime.Now.Year, "_", DateTime.Now.Hour, "-", DateTime.Now.Minute, "-", DateTime.Now.Second, "__resource.s4hd" }))
Dim writer As New BinaryWriter(New FileStream(Me.fileName, FileMode.OpenOrCreate))
writer.Write(1)
Dim list As List(Of FileHeader) = Me.fileHeaders.Values.ToList(Of FileHeader)()
writer.Write(list.Count)
Dim header As FileHeader
For Each header In list
Dim buffer As Byte() = New Byte(&H110 - 1) {}
Dim writer2 As New BinaryWriter(New MemoryStream(buffer, True))
Dim bytes As Byte() = Encoding.ASCII.GetBytes(header.FileName)
If (bytes.Length <= &H100) Then
Dim array As Byte() = New Byte(&H100 - 1) {}
bytes.CopyTo(array, 0)
writer2.Write(array)
writer2.Write(header.CRC)
writer2.Write(header.FileSize)
writer2.Write(header.Unknown)
writer2.Close
Me.encryptCapped256((buffer), buffer.Length)
writer.Write(buffer.Length)
writer.Write(buffer)
End If
Next
writer.Close
End Sub
Private Sub swapBytes(ByRef data As Byte(), ByVal size As Integer)
Try
Dim num As Integer
Dim index As Integer = 0
If (size >= &H80) Then
num = &H80
Else
num = size
End If
Do While (index < (num / 2))
Dim num4 As Integer = ((size - 1) - index)
Dim num3 As Byte = data(num4)
data(num4) = data(index)
data(index++) = num3
Loop
Catch exception1 As Exception
End Try
End Sub
' Fields
Private _workMemory As Byte() = New Byte(&H10000 - 1) {}
Private decrypted As Boolean
Private fileHeaders As Dictionary(Of String, FileHeader)
Private fileName As String
Private fileReader As BinaryReader
Private initialized As Boolean
Private Shared Key As Byte() = New Byte() { 130, &H53, &H43, &H4C, &H2B, 13, &H37, &HD7, &HD9, &HD8, &H1B, &H6D, 160, &HC3, &H2B, &HEE, &H45, &H88, &H1A, &HA6, &H18, &H1D, &H9D, &H38, &H2A, &H55, 3, &H1D, &HCD, &HA6, &H73, 7, &HED, &H8D, &HC5, &HDB, &HA3, &HBD, &HB6, &HD5 }
Private numberOfFiles As Integer
Private Shared trimChars As Char() = New Char(1 - 1) {}
Private workingPath As String
' Nested Types
Private Class FileHeader
' Fields
Public CRC As Long
Public FileName As String
Public FileSize As Integer
Public Unknown As Integer
End Class
End Class
End Namespace
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using Fesersoft.Hashing;
namespace S4Resource
{
class ZipFolder
{
#region Dll-Imports
[DllImport("lzo.dll")]
private static extern int __lzo_init3();
[DllImport("lzo.dll")]
private static extern string lzo_version_string();
[DllImport("lzo.dll")]
private static extern string lzo_version_date();
[DllImport("lzo.dll")]
private static extern int lzo1x_1_compress(
byte[] src,
int src_len,
byte[] dst,
ref int dst_len,
byte[] wrkmem
);
[DllImport("lzo.dll")]
private static extern int lzo1x_decompress(
byte[] src,
int src_len,
byte[] dst,
ref int dst_len,
byte[] wrkmem);
#endregion
private byte[] _workMemory = new byte[16384L * 4];
private class FileHeader
{
public string FileName;
public long CRC;
public int FileSize;
public int Unknown;
}
private bool initialized = false;
private bool decrypted = false;
private BinaryReader fileReader;
private String fileName;
private int numberOfFiles;
private Dictionary<String, FileHeader> fileHeaders;
private static byte[] Key = { // Only the first 40 keys copied from S4
0x82, 0x53, 0x43, 0x4C, 0x2B, 0x0D, 0x37, 0xD7,
0xD9, 0xD8, 0x1B, 0x6D, 0xA0, 0xC3, 0x2B, 0xEE,
0x45, 0x88, 0x1A, 0xA6, 0x18, 0x1D, 0x9D, 0x38,
0x2A, 0x55, 0x03, 0x1D, 0xCD, 0xA6, 0x73, 0x07,
0xED, 0x8D, 0xC5, 0xDB, 0xA3, 0xBD, 0xB6, 0xD5
};
private static char[] trimChars = { '\0' };
private string workingPath;
public ZipFolder(string filename)
{
int init = __lzo_init3();
if (init != 0)
{
throw new Exception("Initialization of LZO-Compressor failed !");
}
this.fileName = filename;
if (!File.Exists(filename)) return;
if (!Directory.Exists("S4Resource.backup"))
{
Directory.CreateDirectory("S4Resource.backup");
}
workingPath = Directory.GetParent(Application.ExecutablePath).FullName;
Directory.SetCurrentDirectory(workingPath);
byte[] data;
try
{
data = File.ReadAllBytes(filename);
}
catch (Exception e)
{
MessageBox.Show("Can not open file " + filename + "\nException: " + e.Message);
return;
}
if (data.Length < 8)
{
MessageBox.Show("File too small!");
return;
}
fileReader = new BinaryReader(new MemoryStream(data));
int fileVersion = fileReader.ReadInt32();
if (fileVersion != 1)
{
MessageBox.Show("File format has changed!");
return;
}
numberOfFiles = fileReader.ReadInt32();
initialized = true;
decryptHeaders();
}
private void decryptHeaders()
{
if (!initialized) return;
fileHeaders = new Dictionary<String, FileHeader>(numberOfFiles);
int fileCounter = numberOfFiles;
while (fileCounter > 0)
{
int blockSize = fileReader.ReadInt32();
byte[] header = fileReader.ReadBytes(blockSize);
decryptCapped256(ref header, header.Length);
swapBytes(ref header, header.Length);
header = Decompress(header,272);
decryptCapped256(ref header, 272);
swapBytes(ref header, 272);
BinaryReader headerReader = new BinaryReader(new MemoryStream(header));
FileHeader realHeader = new FileHeader();
realHeader.FileName = Encoding.ASCII.GetString(headerReader.ReadBytes(256)).Trim(trimChars);
realHeader.CRC = headerReader.ReadInt64();
realHeader.FileSize = headerReader.ReadInt32();
realHeader.Unknown = headerReader.ReadInt32();
fileHeaders.Add(realHeader.FileName, realHeader);
fileCounter--;
}
decrypted = true;
}
public List<String> getFileNames()
{
if (!initialized || !decrypted) return new List<String>();
return fileHeaders.Keys.ToList<String>();
}
private void swapBytes(ref byte[] data, int size)
{
int sizeCapped;
int i = 0;
byte swap;
int j;
if (size >= 128)
sizeCapped = 128;
else
sizeCapped = size;
while (i < sizeCapped / 2)
{
j = size - 1 - i;
swap = data[j];
data[j] = data[i];
data[i++] = swap;
}
}
private void decryptCapped256(ref byte[] data, int size)
{
int sizeCapped;
int i = 0;
if (size >= 256)
sizeCapped = 256;
else
sizeCapped = size;
while (i < sizeCapped)
{
data[i] = (byte)(((data[i] >> 1) & 0x7F) | ((data[i] & 1) << 7));
data[i] ^= Key[i % 32];
i++;
}
}
private void encryptCapped256(ref byte[] data, int size)
{
int sizeCapped;
int i = 0;
if (size >= 256)
sizeCapped = 256;
else
sizeCapped = size;
while (i < sizeCapped)
{
data[i] ^= Key[i % 32];
data[i] = (byte)(((data[i] & 0x7F) << 1) | ((data[i] & 0x80) >> 7));
i++;
}
}
internal void replaceFile(String fullPath, ref byte[] fileData, bool correctCRC)
{
if (!initialized || !decrypted) return;
Directory.SetCurrentDirectory(workingPath);
FileHeader fileHeader = fileHeaders[fullPath];
byte[] data = fileData;
if (fullPath.EndsWith(".x4"))
{
data = encryptX4(fileData);
}
if (fileHeader.FileName == null)
{
fileHeader.FileName = fullPath;
fileHeader.CRC = GenerateCRC(fullPath, ref data);
fileHeader.FileSize = fileData.Length;
fileHeader.Unknown = 0;
fileHeaders.Add(fileHeader.FileName, fileHeader);
}
else
{
fileHeader.FileSize = data.Length;
if (correctCRC)
{
fileHeader.CRC = GenerateCRC(fileHeader.FileName, ref data);
}
}
if (File.Exists("_resources\\" + fileHeader.CRC.ToString("X")))
{
File.Copy("_resources\\" + fileHeader.CRC.ToString("X"), "S4Resource.backup\\" + DateTime.Now.Year + "-" + DateTime.Now.Month + "-" + DateTime.Now.Day + "_" + +DateTime.Now.Hour + "-" + DateTime.Now.Minute + "-" + DateTime.Now.Second + "_" + fileHeader.CRC.ToString("X"));
}
saveEncryptedFile(fileHeader, ref data);
saveFolder();
}
private byte[] encryptX4(byte[] fileData)
{
byte[] compressed = Compress(fileData);
encrypt(ref compressed, compressed.Length);
byte[] final = new byte[compressed.Length + 4];
BinaryWriter br = new BinaryWriter(new MemoryStream(final));
br.Write(fileData.Length);
br.Write(compressed);
br.Close();
return final;
}
private void encrypt(ref byte[] data, int size)
{
int i = 0;
while (i < size)
{
data[i] ^= Key[i % 40];
data[i] = (byte)(((data[i] & 0x7F) << 1) | ((data[i] & 0x80) >> 7));
++i;
}
}
private void decrypt(ref byte[] data, int size)
{
int i = 0;
while (i < size)
{
data[i] = (byte)(((data[i] >> 1) & 0x7F) | ((data[i] & 1) << 7));
data[i] ^= Key[i % 40];
++i;
}
}
private void saveEncryptedFile(FileHeader fileHeader, ref byte[] fileData)
{
if (!initialized || !decrypted) return;
encryptCapped256(ref fileData, fileData.Length);
byte[] compressed = Compress(fileData);
swapBytes(ref compressed, compressed.Length);
File.WriteAllBytes("_resources\\" + fileHeader.CRC.ToString("X"), compressed);
}
private void saveFolder()
{
File.Copy("resource.s4hd", "S4Resource.backup\\" + DateTime.Now.Year + "-" + DateTime.Now.Month + "-" + DateTime.Now.Day + "_" + +DateTime.Now.Hour + "-" + DateTime.Now.Minute + "-" + DateTime.Now.Second + "_" + "_resource.s4hd");
BinaryWriter bw = new BinaryWriter(new FileStream(fileName, FileMode.OpenOrCreate));
bw.Write((int)1);
List<FileHeader> fileHeaderList = fileHeaders.Values.ToList<FileHeader>();
bw.Write(fileHeaderList.Count);
foreach (FileHeader fileHeader in fileHeaderList)
{
byte[] header = new byte[272];
BinaryWriter bw2 = new BinaryWriter(new MemoryStream(header, true));
byte[] name = Encoding.ASCII.GetBytes(fileHeader.FileName);
if (name.Length > 256) continue;
byte[] name256 = new byte[256];
name.CopyTo(name256, 0);
bw2.Write(name256);
bw2.Write(fileHeader.CRC);
bw2.Write(fileHeader.FileSize);
bw2.Write(fileHeader.Unknown);
bw2.Close();
swapBytes(ref header, 272);
encryptCapped256(ref header, 272);
byte[] compressed = Compress(header);
swapBytes(ref compressed, compressed.Length);
encryptCapped256(ref compressed, compressed.Length);
bw.Write(compressed.Length);
bw.Write(compressed);
}
bw.Close();
}
private long GenerateCRC(string fullPath, ref byte[] fileData)
{
crc32 crc = new crc32();
long dataCRC = crc.CRC(fileData);
long nameCRC = crc.CRC(Encoding.ASCII.GetBytes(fullPath));
long finalCRC = dataCRC | (nameCRC << 32);
byte[] byteCRC = new byte[8];
BinaryWriter bw = new BinaryWriter(new MemoryStream(byteCRC, true));
bw.Write(finalCRC);
encryptCapped256(ref byteCRC, 8);
BinaryReader br = new BinaryReader(new MemoryStream(byteCRC));
return br.ReadInt64();
}
internal void exportFile(string fullPath, ref Stream file)
{
try
{
Directory.SetCurrentDirectory(workingPath);
FileHeader fileHeader = fileHeaders[fullPath];
if (fileHeader.FileName == null) return;
String path = "_resources\\" + fileHeader.CRC.ToString("X");
byte[] data = File.ReadAllBytes(path);
swapBytes(ref data, data.Length);
byte[] decompressed = Decompress(data,fileHeader.FileSize);
int size = fileHeader.FileSize;
decryptCapped256(ref decompressed, size);
if (fullPath.EndsWith(".x4"))
{
decompressed = decryptX4(decompressed, size, out size);
}
String test = Encoding.UTF8.GetString(decompressed);
file.Write(decompressed, 0, size);
file.Close();
}
catch (Exception e)
{
MessageBox.Show("Exception: "+e.Message, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
private byte[] decryptX4(byte[] decompressed, int size, out int realSize)
{
BinaryReader br = new BinaryReader(new MemoryStream(decompressed));
realSize = br.ReadInt32();
byte[] data = br.ReadBytes(size - 4);
decrypt(ref data, data.Length);
return Decompress(data, realSize);
}
internal void clean()
{
if (!Directory.Exists("_resources") || Directory.Exists("_resources.bkp")) return;
Directory.SetCurrentDirectory(workingPath);
Directory.Move("_resources", "_resources.bkp");
Directory.CreateDirectory("_resources");
foreach (FileHeader fileHeader in fileHeaders.Values.ToList<FileHeader>())
{
if (File.Exists("_resources.bkp\\" + fileHeader.CRC.ToString("X")))
{
File.Move("_resources.bkp\\" + fileHeader.CRC.ToString("X"), "_resources\\" + fileHeader.CRC.ToString("X"));
}
}
MessageBox.Show("You can delete the folder _resources.bkp now.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
public byte[] Compress(byte[] src)
{
byte[] dst = new byte[src.Length + src.Length / 64 + 16 + 3 + 4];
int outlen = 0;
lzo1x_1_compress(src, src.Length, dst, ref outlen, _workMemory);
byte[] ret = new byte[outlen];
Array.Copy(dst, 0, ret, 0, outlen);
return ret;
}
public byte[] Decompress(byte[] src, int size)
{
int origlen = size;
byte[] dst = new byte[origlen];
int outlen = origlen;
lzo1x_decompress(src, src.Length - 4, dst, ref outlen, _workMemory);
return dst;
}
}
}
Хорошо, давайте начнем с resource.s4hd файл. Он содержит внутренние имена и значения CRC расшифрованного / несжатого файла и он сжимается и шифруется с помощью ключа(примерно такого вида
Используются только первые 32 значения из 40. Файлы используют библиотеки LZO сжатия.
Файлы в папке _resources с шестнадцатеричным значением. Файлы, сжатые и зашифрованные тем же ключом.
Файлы, которые заканчиваются. X7, являются специальными. Они сжимаются и шифруются снова, но уже полностью 40 байтами значений. X7 файлы содержат множество параметров в игре, как и высота прыжка, сила тяжести, цены в магазине предметов и многое другое ...
Как же найти ключ:
Данный ключ включен в процесс S4Client.exe вам просто надо его найти в нем с помощью Редактора бинарных файлов.
Последний раз редактировалось Tantyr; 30.03.2012 в 07:25.
Покрайней мере позновательно. . Вроде если подставить свежий ключ должно будет заработать
я могу еще туторил написать как делать простой аккаунт креатор.
Новичкам? Да ты такое в жизни не повторишь.
А по сути старый или нет, это не важно, если бы мы знали алгоритм, с помощью которого они узнали этот ключ, то естественно смогли бы обновить (на epvp же повторили). Наверняка даже Няма в свое время знал об этом.
В подполке epvp наверняка есть, этот алгоритм. Да и скорее всего у них был исходный код шифровки, т.к. узнать алгоритм шифрования без просмотра исходного кода, не реально, только методом тыка.
Последний раз редактировалось Annedroid; 02.04.2012 в 17:08.
Дело в том что сам mrSm!th учился этому алгоритму у подпольщика.
[Ссылки могут видеть только зарегистрированные пользователи. ]
Обращайте внимание на таких личностей как: MrSm!th, Asiro(автор темы), FichteFoll со страницы 1 - 10 дальше бессмысленно.
Как я поняла этот ключ(алгоритм есть в s4Client.exe)
________________
Я не вредная, просто больше ценю благодарных людей.
Последний раз редактировалось Tantyr; 02.04.2012 в 18:10.
Новичкам? Да ты такое в жизни не повторишь.
А по сути старый или нет, это не важно, если бы мы знали алгоритм, с помощью которого они узнали этот ключ, то естественно смогли бы обновить (на epvp же повторили). Наверняка даже Няма в свое время знал об этом.
В подполке epvp наверняка есть, этот алгоритм. Да и скорее всего у них был исходный код шифровки, т.к. узнать алгоритм шифрования без просмотра исходного кода, не реально, только методом тыка.
Ты как обычно... если прочитаешь внимательно то я ответил не насчет ресурса