I found this after searching in google for 1min.
It's written in C#
Credits to Xadet:
Quote:
/*
* Example class to extract .res files
* Created by xadet ()
* Please do not remove this header if you redistribute this example
*/
/*
* Resource files reader
* Code & struct by xadet (as mentioned above)
*
*/
using System;
using System.IO;
using System.Text;
namespace FlyffWorld.Databases
{
public struct FlyffResourceSubFile
{
public string strFileName;
public int dwSize;
public int dwUnknown;
public int dwOffset;
public string strContents;
public void SaveFile(string path)
{
StreamWriter s = new StreamWriter(path);
s.Write(strContents);
s.Close();
}
}
public class FlyffResourceFile
{
public string strResourceName;
private FileStream m_stream;
public FlyffResourceSubFile[] files;
public bool bObfuscated = false;
public FlyffResourceFile(string strResourceName)
{
Constructor(strResourceName, true);
}
public FlyffResourceFile(string strResourceName, bool bLoadFiles)
{
Constructor(strResourceName, bLoadFiles);
}
private void Constructor(string strResourceName, bool bLoadFiles)
{
this.strResourceName = strResourceName;
this.m_stream = File.OpenRead(strResourceName);
if (bLoadFiles)
LoadResources();
}
/// <summary>
/// Loads resource files into memory. :|
/// </summary>
public void LoadResources()
{
BinaryReader br = new BinaryReader(this.m_stream);
byte key = br.ReadByte();
bObfuscated = br.ReadByte() != 0;
int dwSize = br.ReadInt32();
byte[] header = br.ReadBytes(dwSize);
// decrypt header
for (int i = 0; i < dwSize; i++)
header[i] = (byte)((16 * (key ^ (byte)~header[i])) | ((key ^ (byte)~header[i]) >> 4));
BinaryReader head = new BinaryReader(new MemoryStream(header));
head.ReadBytes(7); // "V0.01"
short count = head.ReadInt16();
files = new FlyffResourceSubFile[count];
for (int i = 0; i < count; i++)
{
short len = head.ReadInt16();
files[i] = new FlyffResourceSubFile()
{
strFileName = Encoding.ASCII.GetString(head.ReadBytes(len)),
dwSize = head.ReadInt32(),
dwUnknown = head.ReadInt32(),
dwOffset = head.ReadInt32()
};
br.BaseStream.Seek(files[i].dwOffset, SeekOrigin.Begin);
byte[] buffer = br.ReadBytes(files[i].dwSize);
if (bObfuscated)
for (int l = 0; l < files[i].dwSize; l++)
buffer[l] = (byte)((16 * (key ^ (byte)~buffer[l])) | ((key ^ (byte)~buffer[l]) >> 4));
files[i].strContents = Encoding.ASCII.GetString(buffer);
}
}
public FlyffResourceSubFile GetFileByName(string strFileName)
{
for (int i = 0; i < files.Length; i++)
if (files[i].strFileName.ToLower() == strFileName.ToLower())
return files[i];
return new FlyffResourceSubFile();
}
}
}
//Head
BYTE byEncryptionKey;
bool bEncryption;
int nFileHeaderSize;
//ab hier wird alles verschlüsselt
char strVersion[8];
int nFileNumber;
for( int i=0;i<nFileNumber;i++ )
{
short nFileNameLength;
char szFileName[_MAX_FNAME];
int nFileSize;
time_t time_;
int nFilePosition;
}
//Body
//Hier ist der verschlüsselte Inhalt der Dateien aneinandergereiht
DDS File editing - Which format? 02/03/2012 - Shaiya Private Server - 0 Replies I have just recolored some Armor Sets in CS2, packed them back into the data.saf and attemped to log into my Server. Im getting Character Load Errors, which mean that my character has armors that are no longer existing, means the game cant read the new .dds files.
Before saving the files I had a chance to choose between many .dds formats, so now Im wondering which one does Shaiya support?
what file format is .c3 ? 08/09/2007 - Conquer Online 2 - 11 Replies Yo,
I want to know how I can preview those .c3 meshes... I looked at all the net for information but couldnt find it. In the file header I found: MAXFILE C3 00001CAME
I thought it is 3dsmax but since I have 3dsmax I can't load/import/merge the data.
Apreciate positive feedback about it :D
Greetz!
.d2s v1.11 file format 11/24/2005 - Diablo 2 - 3 Replies I am looking for the file formats of the .d2s files for both expansion and non expansion.
If someone gets them for me I could make a stat editor...