Nulled out tags

Post here about scripting and programming for HaloPC (audio, network, ai, etc.)
Post Reply
User avatar
Patrickh




Wordewatician 500

Posts: 1173
Joined: Wed Mar 14, 2007 4:53 pm

Nulled out tags

Post by Patrickh »

so im looping through metadata, searching for tag IDs that i can recognize (loading dependencies) but i have a problem. I found out how to load nulled out dependencies, but when loading nulled out lone IDs, how do i tell what class they are supposed to be? HHT does this and I'm wondering how. Do i need to hardcode some offsets based off of tagmaps or can it be determined from the map file? if you haven't noticed, im talking about halo 1 (pc). Any help would be appreciated :wink:
Image
conure says: or i could jsut incase my shoes in papar mache, followed by my dog
|||Lethargy||| Mr. Mohawk|||
|||feel free to contact me via PMs, AIM, MSNM, or Xfire if you have any questions|||
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 »

There should be a 4 char string right before the ID which will tell you the tag type.
User avatar
Prey




Connoisseur Snitch! Pyre Articulatist 500

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

Re: Nulled out tags

Post by Prey »

Patrickh wrote:but when loading nulled out lone IDs
Anyway, this would definitely be loaded from some sort of plugin.. I see no other way of getting the class from just a -1.
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
Patrickh




Wordewatician 500

Posts: 1173
Joined: Wed Mar 14, 2007 4:53 pm

Post by Patrickh »

thanks guys

New question:

what's wrong with this meta injector?
im injecting valid metas and they don't inject correctly. I've just been reading a byte from the selected file, then writing it into the map, looping through all the bytes in the meta
heres my code:

Code: Select all

 Private Sub InjectMeta()

        Dim metaoffset As Int32
        Dim tagmetasize As Int32
        class1 = ClassA.SelectedItem.ToString
        metaoffset = Val("&H" & tagMetaOffset.Text)
        tagmetasize = txtTagmetasize.Text
        Dim ofd As New OpenFileDialog
        ofd.Filter = "[" & class1 & "] tag. (*." & class1 & ")|*." & class1 & "|[" & class1 & "] tag. (*." & class1 & ".meta)|*." & class1 & ".meta"
        ofd.Title = "Meta Injection"
        If ofd.ShowDialog <> Windows.Forms.DialogResult.Cancel Then
            Dim br As New IO.BinaryReader(New IO.FileStream(ofd.FileName, IO.FileMode.Open, IO.FileAccess.Read))
            Dim bw As New IO.BinaryWriter(New IO.FileStream(map_location, IO.FileMode.Open, IO.FileAccess.Write))
            For i As Integer = 0 To tagmetasize - 1
                br.BaseStream.Position = i
                Dim byteval As Byte
                byteval = br.ReadByte
                bw.BaseStream.Position = metaoffset + i
                bw.Write(byteval)
            Next
            bw.Close()
            br.Close()
            MsgBox("Meta Injection Complete.")
        End If

    End Sub
what am i doing wrong?
Image
conure says: or i could jsut incase my shoes in papar mache, followed by my dog
|||Lethargy||| Mr. Mohawk|||
|||feel free to contact me via PMs, AIM, MSNM, or Xfire if you have any questions|||
User avatar
Prey




Connoisseur Snitch! Pyre Articulatist 500

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

Post by Prey »

"metaoffset = Val("&H" & tagMetaOffset.Text) "

I think this may be it.. are you sure tagMetaOffset.Text is in hexadecimal format? And if it is, are you sure it doesn't already have the "0x" prefix?
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
Patrickh




Wordewatician 500

Posts: 1173
Joined: Wed Mar 14, 2007 4:53 pm

Post by Patrickh »

Prey wrote:"metaoffset = Val("&H" & tagMetaOffset.Text) "

I think this may be it.. are you sure tagMetaOffset.Text is in hexadecimal format? And if it is, are you sure it doesn't already have the "0x" prefix?
well tagMetaOffset.Text diplays the tags meta offset converted to hex, so metaoffset should wind up equalling it converted back to dec
also, i used the same line in my extractor, which reads from that offset, and the extractor works perfectly. Heres the code for my extractor:

Code: Select all

 
            Dim metaoffset As Int32
            Dim tagmetasize As Int32

            class1 = ClassA.SelectedItem.ToString
            metaoffset = Val("&H" & tagMetaOffset.Text)
            tagmetasize = txtTagmetasize.Text
            Dim sfd As New SaveFileDialog
            sfd.Filter = "[" & class1 & "] tag. (*." & class1 & ")|*." & class1
            sfd.Title = "Meta Extraction"
            If sfd.ShowDialog <> Windows.Forms.DialogResult.Cancel Then
                Dim br As New IO.BinaryReader(New IO.FileStream(map_location, IO.FileMode.Open, IO.FileAccess.Read))
                Dim bw As New IO.BinaryWriter(New IO.FileStream(sfd.FileName, IO.FileMode.Create, IO.FileAccess.Write))
                For i As Integer = 0 To tagmetasize - 1
                    br.BaseStream.Position = metaoffset + i
                    Dim byteval As Byte
                    byteval = br.ReadByte
                    bw.BaseStream.Position = i
                    bw.Write(byteval)
                Next
                br.Close()
                bw.Close()
                MsgBox("Meta Extraction Complete.")
            End If
thanks for the help
Image
conure says: or i could jsut incase my shoes in papar mache, followed by my dog
|||Lethargy||| Mr. Mohawk|||
|||feel free to contact me via PMs, AIM, MSNM, or Xfire if you have any questions|||
User avatar
Prey




Connoisseur Snitch! Pyre Articulatist 500

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

Post by Prey »

Meh. It's all I can see that is wrong. Use a breakpoint or Msgbox to make sure it definitely converts to the correct meta offset.
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
Patrickh




Wordewatician 500

Posts: 1173
Joined: Wed Mar 14, 2007 4:53 pm

Post by Patrickh »

Prey wrote:Meh. It's all I can see that is wrong. Use a breakpoint or Msgbox to make sure it definitely converts to the correct meta offset.
that is strange... i added this to the end of the injection code:

Code: Select all

MsgBox("Meta Injection Complete. Meta offset: " & Hex$(metaoffset))
and it displayed the proper offset :?
I'll post the answer here when i figure out what's up.

edit: ok, what's happening is that i extract the pelican's meta, then inject it back in. when i reload the map and click on the tag, it loads a bunch of dependencies i don't recognize, that definately don't belong to the pelican. The wierd part: i extract the meta from the wierd tag and it extract the tags metadata perfectly accurately... so i guess the problem is how it's loading the dependencies, but it displays the metaoffset and metasize correctly, so scanning for dependencies should be any different since the meta is apparently the same. :(
If you guys have any ideas of whats up, that'd be great. otherwise ill just fiddle with it
Image
conure says: or i could jsut incase my shoes in papar mache, followed by my dog
|||Lethargy||| Mr. Mohawk|||
|||feel free to contact me via PMs, AIM, MSNM, or Xfire if you have any questions|||
Post Reply