[Source Code] cfrez.exe

Posts 115 of 22 · Page 1 of 2
[Source Code] cfrez.exe
Here is my cfrez.exe and the source code.
It's used to extract Crossfire's .REZ format files. Since 2.0 there are new .REZ files which cannot be extracted using this tool.
Source based on LithTech's RezMgr.
The cfrezformat.dll is also located in your Crossfire folder and is called pack_cf_03.dll.

 
Screenshots


Usage
CFREZ.EXE [SIMPLE TUTORIAL]
Or just check the help provided by the tool.

Scans
1/53
0/21

 
Source code
Code:
namespace Biesi.CfRez
{
    using System;
    using System.Linq;
    using System.Runtime.InteropServices;

    delegate int RezCompiler(string cmd, string rezFile, string targetDirectory, bool lithRez, string extension);
    
    class Program
    {
        [DllImport("kernel32", SetLastError = true, CharSet = CharSet.Ansi)]
        static extern IntPtr LoadLibrary([MarshalAs(UnmanagedType.LPStr)]string lpFileName);

        private static void DisplayHelp()
        {
            Console.WriteLine("CFREZ 1.0 (Dec-18-2015) Copyright (C) 2015 Nobody");
            Console.WriteLine("Usage: CFREZ <commands> <rez file name> [parameters]");
            Console.WriteLine("Commands: c <rez file name> <root directory to read> [extension[;]] - Create");
            Console.WriteLine("          v <rez file name>                          - View");
            Console.WriteLine("          x <rez file name> <directory to output to> - Extract");
            Console.WriteLine("Option:   v                                          - Verbose");
            Console.WriteLine("Option:   z                                          - Warn zero len");
            Console.WriteLine("Option:   l                                          - Lower case ok\n");
            Console.WriteLine("Example: lithrez cv foo.rez c:\\foo *.ltb;*.dat;*.dtx");
            Console.WriteLine("          (would create rez file foo.rez from the contents of the");
            Console.WriteLine("          directory \"c:\\foo\" where files with extensions ltb dat and");
            Console.WriteLine("          dtx are added, the verbose option would be turned on)\n");
        }

        static int Main(string[] args)
        {
            try
            {
                IntPtr formatBase = LoadLibrary("cfrezformat.dll");
                if (formatBase == IntPtr.Zero)
                {
                    Console.WriteLine("ERROR! Unable to load cfrezformat.dll");
                    return 1;
                }

                if (args.Count() < 2)
                {
                    DisplayHelp();
                    return 1;
                }

                char modeParam = char.ToUpper(args[0][0]);
                if ((args.Count() < 3) && (modeParam == 'X' || modeParam == 'C'))
                {
                    DisplayHelp();
                    return 1;
                }

                string rezFile = args[1].ToUpperInvariant();
                string extension = args.Count() < 4 ? "*.*" : args[3];

                RezCompiler rezCompiler = Marshal.GetDelegateForFunctionPointer<RezCompiler>(IntPtr.Add(formatBase, 0xA730));
                rezCompiler(args[0], rezFile, args[2], true, extension);

                return 0;
            }
            catch (Exception ex)
            {
                Console.Write("ERROR! ");
                Console.WriteLine(ex.Message);
                return 1;
            }
        }
    }
}
cfrez_mpgh.net.zip73 KB · 1,151 downloads Clean
can someone help me
Error
Code:
The application was unable to start correctly (0xc000007b)
imgur .com/Z2VgdRx
Quote Originally Posted by kilivnz2509 View Post
can someone help me
Error
Code:
The application was unable to start correctly (0xc000007b)
imgur .com/Z2VgdRx
Install the latest version of the .NET Framework
Run is error on cmd

Code:
ERROR! Not a LitTech resource file
imgur .com/qQdEWHe
Quote Originally Posted by kilivnz2509 View Post
Run is error on cmd

Code:
ERROR! Not a LitTech resource file
imgur .com/qQdEWHe
Which CrossFire version is this?
Quote Originally Posted by Biesi View Post


Which CrossFire version is this?
In CrossFire Vietnam ver 1203, or CrossFire Rusian ; Crossfire Japan ; Crossfire Korea new version
Link download : fshare .vn/file/YHBTVNFTMERG
You can download this link : linksvip .net . Then copy link Fshare on this
To kilivnz
Rename the rez file first
Change the name of Rezextractor to .ini and rename rf017.rez to RF017.REZ
Do it also to rf017
Finally, rename it back to Rezextractor.bat
P/s: Unblock me on Fb, and then talk to me
Quote Originally Posted by Biesi View Post


Which CrossFire version is this?
cfeu version doesnt work
Quote Originally Posted by mosta_boy View Post
cfeu version doesnt work
smilegay added a new encryption+compression to 2.0 rez files. You'll need to crack it first before viewing files now.
is there any chance somebody cracked them yet?
Quote Originally Posted by lolwtfnewb View Post
is there any chance somebody cracked them yet?
They have a simple compression algorithm i think its the one from 7 zip
- - - Updated - - -

Quote Originally Posted by BlenMiner View Post
They have a simple compression algorithm i think its the one from 7 zip
When I extract RF018.rez I get a file called sound1.wav that is compressed all the game sounds, I can decompress it with 7 zip how?
Quote Originally Posted by Biesi View Post
[FONT="Lucida Console"][COLOR="DimGray"]Here is my cfrez.exe and the source code.
It's used to extract Crossfire's .REZ format files. Since 2.0 there are new .REZ files which cannot be extracted using this tool.
Source based on LithTech's RezMgr.
The cfrezformat.dll is also located in your Crossfire folder and is called pack_cf_03.dll.
Can you give file pack_cf_3.dll of your cf to me? I can't find any file like that in my CF.
Posts 115 of 22 · Page 1 of 2

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?