Resigning Map in C

Discuss Halo 2 modding, progress on figuring things out, mapfiles...you know the drill. Cheating discussion not allowed.
Post Reply
timrs





Posts: 7
Joined: Tue Jul 11, 2006 8:55 am

Resigning Map in C

Post by timrs »

How would I resign a map using C without any checks for anything -- just a simple function used to sign a halo 2 map? I am having bad luck searching these forums -- the search engine sucks...
User avatar
Prey




Connoisseur Snitch! Pyre Articulatist 500

Posts: 1026
Joined: Wed Dec 27, 2006 6:49 am
Location: UK
Contact:

Post by Prey »

Code: Select all

            FileStream fs = new FileStream((map.path,
                FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite);

            BinaryReader br = new BinaryReader(fs);
            BinaryWriter bw = new BinaryWriter(fs);

            int sig = 0;
            long length = br.BaseStream.Length;

            br.BaseStream.Position = 2048;

            for (long i = 2048; i < length; i += 4)
                sig ^= br.ReadInt32();

            bw.BaseStream.Position = 720;
            bw.Write(sig);

            br.Close();
            bw.Close();
That is C# if it helps.
Halo 2 Prophet - Skin with ease with the simple 3D point and click interface.
Halo 3 Research Thread - Contribute to the research into Halo 3.
User avatar
Th2mods
Readers Club





Posts: 1229
Joined: Mon Jan 08, 2007 5:54 pm
Location: Salt Lake City, Utah
Contact:

Re: Resigning Map in C

Post by Th2mods »

timrs wrote:How would I resign a map using C without any checks for anything -- just a simple function used to sign a halo 2 map? I am having bad luck searching these forums -- the search engine sucks...
i use google
Image
timrs





Posts: 7
Joined: Tue Jul 11, 2006 8:55 am

Post by timrs »

Well, actually this helps me know what needs to be done, but still need help to get this into c++ -- I found ifstream, the equivelent to filestream -- and i know i need to put "#include <fstream> but not anything else---please help me, and tell me what files to include
Post Reply