Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Flyff > Flyff Private Server
You last visited: Today at 09:28

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Request] .Res file format

Discussion on [Request] .Res file format within the Flyff Private Server forum part of the Flyff category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Mar 2008
Posts: 665
Received Thanks: 230
[Request] .Res file format

As the title says. All links I found are broken.
alfredico is offline  
Old 02/12/2012, 01:26   #2



 
Sedrika's Avatar
 
elite*gold: 18
The Black Market: 103/0/0
Join Date: Sep 2009
Posts: 20,174
Received Thanks: 14,475
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();
}
}
}
Sedrika is offline  
Thanks
1 User
Old 02/12/2012, 20:36   #3
 
elite*gold: 0
Join Date: Mar 2008
Posts: 665
Received Thanks: 230
Anyone got a flyff res editor source?
alfredico is offline  
Old 02/12/2012, 20:58   #4
 
elite*gold: 0
Join Date: May 2009
Posts: 122
Received Thanks: 160
Aufbau einer .res Datei:
Code:
//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
Krustenkäse is offline  
Thanks
1 User
Old 02/15/2012, 07:36   #5
 
elite*gold: 0
Join Date: Mar 2008
Posts: 665
Received Thanks: 230
I already knew that...
alfredico is offline  
Old 02/15/2012, 15:58   #6



 
Sedrika's Avatar
 
elite*gold: 18
The Black Market: 103/0/0
Join Date: Sep 2009
Posts: 20,174
Received Thanks: 14,475
Thats all. You have to do everything else by yourself.
Sedrika is offline  
Old 02/18/2012, 03:52   #7
 
elite*gold: 9
Join Date: Oct 2011
Posts: 147
Received Thanks: 106
Sauber Krustenkäse das habe ich auch noch gesucht
Krawallbrüder is offline  
Reply


Similar Threads Similar Threads
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...



All times are GMT +1. The time now is 09:28.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.