Halo 3 [Beta] Mod Discussion

Discussion about modding Halo 3.
User avatar
Prey




Connoisseur Snitch! Pyre Articulatist 500

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

Post by Prey »

darvolt wrote:@Prey: how can I get the size, if sometimes, the previous tag offset is bigger than the next? Sort them? But how?
Loop through all the tags meta offsets until youve got the nearest-next-offset from the tag your on, heres the code i used..

Code: Select all

            //loop through tags
            for (int x = 0; x < map.index.objectCount; x++)
            {
                //declare var to hold our meta size, start it with end of meta
                int mSize = map.header.metaStart + map.header.metaSize;

                //loop through tags
                for (int y = 0; y < map.index.objectCount; y++)
                {
                    //if tag[y]'s meta offset is bigger than tag[x]'s meta 
                    //offset && smaller than what weve currently got for
                    //the tags meta size
                    if (tagsList[y].MetaOffset > tagsList[x].MetaOffset
                        && tagsList[y].MetaOffset < mSize)
                    {
                        //take tag[y]'s offset
                        mSize = tagsList[y].MetaOffset;
                    }
                }

                //and finally subtract tag[x]'s offset to get the actual size
                tagsList[x].MetaSize = mSize - tagsList[x].MetaOffset;
            }
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
darvolt





Posts: 49
Joined: Tue Mar 29, 2005 11:31 am
Location: Munich
Contact:

Post by darvolt »

thx a lot

in your App, there is a bitm with the meta size: 15216, is it correct?
User avatar
Prey




Connoisseur Snitch! Pyre Articulatist 500

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

Post by Prey »

darvolt wrote:thx a lot

in your App, there is a bitm with the meta size: 15216, is it correct?
eh what map and what tag >_>
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
darvolt





Posts: 49
Joined: Tue Mar 29, 2005 11:31 am
Location: Munich
Contact:

Post by darvolt »

Prey wrote:
darvolt wrote:thx a lot

in your App, there is a bitm with the meta size: 15216, is it correct?
eh what map and what tag >_>
Deadlock, Ident -7558, Path fx\particles\energy\_bitmaps\fire_large
User avatar
Prey




Connoisseur Snitch! Pyre Articulatist 500

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

Post by Prey »

darvolt wrote:
Prey wrote:
darvolt wrote:thx a lot

in your App, there is a bitm with the meta size: 15216, is it correct?
eh what map and what tag >_>
Deadlock, Ident -7558, Path fx\particles\energy\_bitmaps\fire_large
Yep i got 15216 for the meta size also.
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
darvolt





Posts: 49
Joined: Tue Mar 29, 2005 11:31 am
Location: Munich
Contact:

Post by darvolt »

ok, sry, another thing.
Where can I find the metaStart and the metaSize?
i think, I can take the offset of the first meta for the metaStart, but the size?
User avatar
Prey




Connoisseur Snitch! Pyre Articulatist 500

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

Post by Prey »

darvolt wrote:ok, sry, another thing.
Where can I find the metaStart and the metaSize?
i think, I can take the offset of the first meta for the metaStart, but the size?
I thought i'd posted this actually,

Code: Select all

            hr.BaseStream.Position = 20;
            metaStart = hr.ReadBigInt32();
            metaSize = hr.ReadBigInt32();
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
darvolt





Posts: 49
Joined: Tue Mar 29, 2005 11:31 am
Location: Munich
Contact:

Post by darvolt »

Prey wrote:

Code: Select all

            hr.BaseStream.Position = 20;
            metaStart = hr.ReadBigInt32();
            metaSize = hr.ReadBigInt32();
do I have to subtract the magic from the start?
User avatar
Prey




Connoisseur Snitch! Pyre Articulatist 500

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

Post by Prey »

darvolt wrote:
Prey wrote:

Code: Select all

            hr.BaseStream.Position = 20;
            metaStart = hr.ReadBigInt32();
            metaSize = hr.ReadBigInt32();
do I have to subtract the magic from the start?
darvolt do you have aim or msn, cause if you do add me as it would be a lot easier for me to answer all these questions, whilst keeping this thread 'clean' for 'factual' information >_>

..and no you dont have to subtract the magic.
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.
Shalted




Eureka Translator

Posts: 565
Joined: Wed Nov 17, 2004 8:41 am
Location: Vancouver, BC This is where people put their modding team because they feel important.
Contact:

Post by Shalted »

Prey wrote:

Code: Select all

            //loop through tags
            for (int x = 0; x < map.index.objectCount; x++)
            {
                //declare var to hold our meta size, start it with end of meta
                int mSize = map.header.metaStart + map.header.metaSize;

                //loop through tags
                for (int y = 0; y < map.index.objectCount; y++)
                {
                    //if tag[y]'s meta offset is bigger than tag[x]'s meta 
                    //offset && smaller than what weve currently got for
                    //the tags meta size
                    if (tagsList[y].MetaOffset > tagsList[x].MetaOffset
                        && tagsList[y].MetaOffset < mSize)
                    {
                        //take tag[y]'s offset
                        mSize = tagsList[y].MetaOffset;
                    }
                }

                //and finally subtract tag[x]'s offset to get the actual size
                tagsList[x].MetaSize = mSize - tagsList[x].MetaOffset;
            }
The last tag size will be wrong with this method, since the tag index, the class index, and the index header are all right after the meta data, (and before map.header.metaStart + map.header.metaSize)

so yeah...
Awaiting connection...
User avatar
Prey




Connoisseur Snitch! Pyre Articulatist 500

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

Post by Prey »

Shalted wrote:The last tag size will be wrong with this method, since the tag index, the class index, and the index header are all right after the meta data, (and before map.header.metaStart + map.header.metaSize)

so yeah...
ugh yea your right. Here i revised the code:

Code: Select all

            //loop through tags
            for (int x = 0; x < map.index.objectCount; x++)
            {
                //declare var to hold our meta size, start it with end of meta
                int mSize = map.index.objectIndexHeaderOffset1;

                //loop through tags
                for (int y = 0; y < map.index.objectCount; y++)
                {
                    //if tag[y]'s meta offset is bigger than tag[x]'s meta 
                    //offset && smaller than what weve currently got for
                    //the tags meta size
                    if (tagsList[y].MetaOffset > tagsList[x].MetaOffset
                        && tagsList[y].MetaOffset < mSize)
                    {
                        //take tag[y]'s offset
                        mSize = tagsList[y].MetaOffset;
                    }
                }

                //and finally subtract tag[x]'s offset to get the meta size
                tagsList[x].MetaSize = mSize - tagsList[x].MetaOffset;
            }
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.
Shalted




Eureka Translator

Posts: 565
Joined: Wed Nov 17, 2004 8:41 am
Location: Vancouver, BC This is where people put their modding team because they feel important.
Contact:

Post by Shalted »

Prey wrote: ugh yea your right. Here i revised the code:

Code: Select all

            //loop through tags
            for (int x = 0; x < map.index.objectCount; x++)
            {
                //declare var to hold our meta size, start it with end of meta
                int mSize = map.index.objectIndexHeaderOffset1;

                //loop through tags
                for (int y = 0; y < map.index.objectCount; y++)
                {
                    //if tag[y]'s meta offset is bigger than tag[x]'s meta 
                    //offset && smaller than what weve currently got for
                    //the tags meta size
                    if (tagsList[y].MetaOffset > tagsList[x].MetaOffset
                        && tagsList[y].MetaOffset < mSize)
                    {
                        //take tag[y]'s offset
                        mSize = tagsList[y].MetaOffset;
                    }
                }

                //and finally subtract tag[x]'s offset to get the meta size
                tagsList[x].MetaSize = mSize - tagsList[x].MetaOffset;
            }
Very nice prey :),
Too bad some of the sizes will still be wrong, because some of the Data Block(reflexive) Pools are between two meta offsets, making the tags seem larger than they really are.
Awaiting connection...
User avatar
Tural




Conceptionist Acolyte Bloodhound Recreator
Socialist Connoisseur Droplet Scorched Earth
Grunge

Posts: 15628
Joined: Thu Jun 16, 2005 3:44 pm
Location: Lincoln, NE
Contact:

Post by Tural »

Apparently nobody understood the first dozen times.
This thread is about map structure and modding. This is not the thread to post random discoveries, and certainly not the place to ever even consider discussing leaked content.

Got it now? This is your final warning (Although you should not need more than one), any further discussion will result in a one week ban, no questions asked. It is not up for discussion, at all. Do not post arguing against this, it will get you punished as well.

If you have nothing to comment about the map structures, tools, etc., you'd be very, very wise to not post.
User avatar
LuxuriousMeat





Posts: 824
Joined: Thu Nov 03, 2005 6:43 pm
Location: zzzzzzzzzzzzzzzz
Contact:

Post by LuxuriousMeat »

Shalted wrote:
Prey wrote: ugh yea your right. Here i revised the code:

Code: Select all

            //loop through tags
            for (int x = 0; x < map.index.objectCount; x++)
            {
                //declare var to hold our meta size, start it with end of meta
                int mSize = map.index.objectIndexHeaderOffset1;

                //loop through tags
                for (int y = 0; y < map.index.objectCount; y++)
                {
                    //if tag[y]'s meta offset is bigger than tag[x]'s meta 
                    //offset && smaller than what weve currently got for
                    //the tags meta size
                    if (tagsList[y].MetaOffset > tagsList[x].MetaOffset
                        && tagsList[y].MetaOffset < mSize)
                    {
                        //take tag[y]'s offset
                        mSize = tagsList[y].MetaOffset;
                    }
                }

                //and finally subtract tag[x]'s offset to get the meta size
                tagsList[x].MetaSize = mSize - tagsList[x].MetaOffset;
            }
Very nice prey :),
Too bad some of the sizes will still be wrong, because some of the Data Block(reflexive) Pools are between two meta offsets, making the tags seem larger than they really are.
Care to give us some insight on how to do it correctly? :)
Image
Shalted




Eureka Translator

Posts: 565
Joined: Wed Nov 17, 2004 8:41 am
Location: Vancouver, BC This is where people put their modding team because they feel important.
Contact:

Post by Shalted »

There is no "real"(well, easy) correct way, unless you want to scan for a whole bunch of reflexives(which is not a reliable method because reflexive scanning is inaccurate), anyway, what you guys have is good enough (same method I've been using anyway :) ), because it at least gets you the tag header.
Awaiting connection...
Nick




Socialist Magic Era Golden Age ONI

Posts: 84
Joined: Mon Apr 12, 2004 8:52 am

Post by Nick »

Shadow LAG wrote:I think we can stop censoring leaked content now....
No. That is not a suggestion, the spark of debate, a question in any form, or anything else besides a command. You will not discuss details in the map files that have yet to be officially revealed by Bungie, period. You cannot find all of the information contained in the map files in the Custom Game lobby. I could care less what is being posted on the Bungie forums; this is Halomods and we have integrity - if you do not, leave.

Feel free to check out the main page of Halomods for two stories at the top about this mess.

Nick
Shalted




Eureka Translator

Posts: 565
Joined: Wed Nov 17, 2004 8:41 am
Location: Vancouver, BC This is where people put their modding team because they feel important.
Contact:

Post by Shalted »

I seriously have no idea why everyone is having so much trouble translating memory pointers into file offsets? I mean all the memory pointers translate perfectly when I do it, I am almost certain that the magic I calculate is the same as everyone else's(why wouldn't it be). Maybe everyone is getting confused, because of the way they're stored, they're now stored in a sort of "pool" with all the other reflexives of that type. so they can be almost anywhere in the map (well, in the Virtual Segment of the map).

Anyway, if any one wants the a few map structures, here they are (not included is the bitm struct and a few more):

Code: Select all

#define SWAP4(x) ((x << 24) | ((x & 0xff00) << 8) | \
                 ((x >> 8) & 0xff00) | (x >> 24)) 
                 
#define SWAP2(x) ( ((x & 0xff) << 8) | (x >> 8 ))

#define MAP3_VIRTUAL_BASE 0xA6000000

#define NOALIGN __attribute__ ((packed))

typedef unsigned long long uint64;
typedef unsigned int uint32;
typedef unsigned short uint16;
typedef unsigned char uint8;

typedef unsigned int dword;
typedef unsigned short word;
typedef unsigned char byte;
 
typedef unsigned int magic_o;

typedef struct{
	char head[4];
	int Version; //9 for halo 3
	int filesize;
	int zero;
	magic_o Offset_to_index;
	int offset_to_virt_seg;
	int total_size_of_virt_segment;
	byte padding[0x100];//Map Path?
	char build_info[32];
	byte zeros[0x20];
	int Offset_to_string128;
	uint32 string128Count;
	uint32 sid_indice_count;
	uint32 offset_sid_indices;
	uint32 offset_sid_data;
	byte build_garb[0x24];
	char mapname[0x24];
	char map_path[0x100];
	int unknown3;
	uint32 name_count;
	uint32 name_data_offset;
	uint32 name_data_size;
	uint32 name_index_offset;
	byte unknown2[0x44];
	byte hash[0x100];//md5?
	byte padd[0x3ec];
	char foot[4];
}_h3b_head;

typedef struct{
	uint32 taglist_count;
	magic_o TagInfoOffset;
	uint32 TagCount;
	magic_o FileIndexOffset;
	uint32 ImportantTagCnt;
	magic_o ITC_Offset;
	int unknown_cnt;
	magic_o unknown_offset;
	int unknown;
	char tags[4];
}_h3b_ihead;

typedef struct{
	char Object[4];
	char Parent[4];
	char GrandParent[4];
	int Identifyer;
}_h3b_tlentry;

typedef struct{
	word type; //index into _h3btlentry
	word ID;
	magic_o offset;
}NOALIGN _h3b_tag_entry;


  Map_Magic = MAP3_VIRTUAL_BASE  - SWAP4(_h3b_head->offset_to_virt_seg);
Awaiting connection...
User avatar
xbox7887




Socialist Coagulator Decryptor Advisor
Eureka Commentator Wave Scorched Earth

Posts: 2160
Joined: Mon Dec 27, 2004 6:19 pm
Location: New Lenox, Illinois
Contact:

Post by xbox7887 »

Shalted wrote:Anyway, if any one wants the a few map structures, here they are
Wow I think you're the first person to actually notice the huge 256-byte chunk of garbage sitting at 0x310 in the header...LAWL

/me pats Joshua on the back and hands him a cookie
User avatar
shade45




Translator Artisan Enthraller Logistician
Stylist Wave Firestorm New Age

Posts: 2270
Joined: Fri Apr 01, 2005 1:04 pm

Post by shade45 »

xbox7887 wrote:
Shalted wrote:Anyway, if any one wants the a few map structures, here they are
Wow I think you're the first person to actually notice the huge 256-byte chunk of garbage sitting at 0x310 in the header...LAWL

/me pats Joshua on the back and hands him a cookie
I was sure I posted it. O well do you think its SHA-256?
Shalted




Eureka Translator

Posts: 565
Joined: Wed Nov 17, 2004 8:41 am
Location: Vancouver, BC This is where people put their modding team because they feel important.
Contact:

Post by Shalted »

I think it's either SHA-256, or an MD5-SUM, I also think there's a secondary hash a little bit earlier in the file, but I think it's a waste of time to look into at the moment, because I wouldn't want to try to use these maps on live :S.
Awaiting connection...
Locked