Results 16 to 22 of 22

Threaded View

  1. #1
    Biesi's Avatar
    Join Date
    Dec 2011
    Gender
    male
    Posts
    4,993
    Reputation
    374
    Thanks
    8,808
    My Mood
    Twisted

    [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.

     


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

    Scans
    1/53
    0/21

     
    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;
                }
            }
        }
    }
    <b>Downloadable Files</b> Downloadable Files
    Last edited by Biesi; 12-18-2015 at 06:22 PM.

  2. The Following 92 Users Say Thank You to Biesi For This Useful Post:

    1076774938 (02-17-2016),1342971816 (11-24-2016),159482657 (09-11-2016),3scuid (10-04-2020),a2421960839 (02-27-2016),aaronjasper4917 (01-28-2016),andanhkg20 (08-25-2021),anhhungt (02-09-2016),aryaputraprdna (06-21-2018),asepajah990 (05-20-2016),Avalar (05-09-2016),bdt8c (05-13-2016),blacksky1881 (05-28-2017),BOBOKM (03-23-2017),bocilxct (05-28-2022),CaptainBr (01-30-2024),cmc5414 (01-31-2016),daddypappy (10-21-2016),DANJICF (02-17-2016),dcvnoob (04-17-2017),DragoNaga11 (11-10-2021),DT007 (09-08-2018),duckden (01-06-2016),fairytail.lmht (10-18-2016),fastnick12 (09-16-2016),gaming011 (01-17-2024),gumrukcu (02-21-2016),gxdivo100 (08-09-2023),hadisaputra1 (09-05-2016),haroldivan888 (05-09-2016),HendraGaming320 (12-20-2018),Hoa8888 (09-25-2019),hrustikru (09-22-2017),hyungenie (12-19-2023),ifail5021 (12-23-2015),ikske123 (06-11-2016),jamesjaveluna (07-21-2016),janfe09 (11-19-2017),jaysmith27 (05-20-2018),jdawg209 (02-01-2016),johnthuc0310 (11-21-2020),JohnVice (03-04-2016),jujiu (12-18-2016),JunyHere (04-05-2016),kentoy12345 (09-25-2018),kilivnz2509 (12-23-2015),kiroou (01-21-2017),kkw90111 (01-06-2022),lhvip (11-03-2016),lianyoujie (10-06-2023),lzyroot (05-10-2016),M4aks (05-30-2018),mangtung (01-23-2016),MaphSenpai (07-20-2016),markantony1 (02-29-2016),marose08 (09-06-2016),Meife (09-16-2016),mosta_boy (10-23-2018),NekoAkira03 (06-04-2017),Nubyraa (04-20-2016),penhi97 (03-06-2016),phamduy9x (02-17-2016),pluzvn (02-25-2016),predador180 (03-03-2016),qq1194869050 (12-04-2016),qweasdrf221133 (01-06-2016),R3B00TS (06-19-2016),rainevin (06-27-2016),Rinko2000 (08-31-2022),rizaldy07 (05-16-2022),sambala1102 (02-22-2016),saninja (01-16-2016),scholarForever (07-13-2023),sjlver1992 (12-26-2015),skypu (04-20-2021),snick6123 (05-11-2016),thetop2020 (05-14-2016),thodama2010 (02-28-2016),Tran Dat (05-05-2019),UltraPGNoob (03-18-2016),vapelife24 (04-14-2017),Varanium22 (09-03-2016),vheeanav (05-29-2016),vinhcatba (07-23-2016),weex0606 (05-22-2016),win_123 (04-03-2024),xdgxdg123 (03-22-2016),xiaorou (04-03-2023),yeat4life (02-27-2023),zFreeLove (12-23-2015),ZhaoCelestial (12-20-2015),zhenpengge (01-13-2016)

Similar Threads

  1. [Source Code] BLACKSHOT.EXE SOURCE CODE & GG SOURCE CODE
    By COD3RIN in forum Blackshot Coding & Source Code
    Replies: 13
    Last Post: 01-23-2014, 12:35 AM
  2. WallHack.exe Source code
    By Vahan96 in forum CrossFire Hack Coding / Programming / Source Code
    Replies: 5
    Last Post: 06-16-2012, 10:21 AM
  3. [Help] Today I Have CFREZ.exe but I donot know how to use it because I donot know the Code!
    By XTIANZKIE21 in forum CrossFire Mods & Rez Modding
    Replies: 21
    Last Post: 06-16-2012, 04:30 AM
  4. [Release] ****** DLL Source Code
    By OneWhoSighs in forum WarRock - International Hacks
    Replies: 20
    Last Post: 10-25-2007, 07:41 AM
  5. HALO 2 (XBOX) Source Code
    By mirelesmichael in forum General Game Hacking
    Replies: 12
    Last Post: 09-23-2006, 04:35 AM