Offset Values
- Aumaan Anubis
- Staff
- Posts: 1812
- Joined: Thu Dec 13, 2007 12:18 am
- Contact:
Offset Values
Right, so I made an app, awhile ago, that can edit the bipd jump height value. I had used a tutorial to do it, so the code wasn't my own. I scanned through it, and saw that the offset for bipd jump height was 504.
I'd like to be able to find the offset for, say, the max and min ROF of a weapon. Or something else like that. I don't know much about Hex or Binary, including BinaryReaders, so I was wondering if there was a simple way.
I'd like to be able to find the offset for, say, the max and min ROF of a weapon. Or something else like that. I don't know much about Hex or Binary, including BinaryReaders, so I was wondering if there was a simple way.
-
- Posts: 409
- Joined: Sat Jan 12, 2008 11:42 pm
- Location: Michigan
- Contact:
- Aumaan Anubis
- Staff
- Posts: 1812
- Joined: Thu Dec 13, 2007 12:18 am
- Contact:
Re: Offset Values
Aumaan Anubis wrote:Right, so I made an app, awhile ago, that can edit the bipd jump height value. I had used a tutorial to do it, so the code wasn't my own. I scanned through it, and saw that the offset for bipd jump height was 504.
I'd like to be able to find the offset for, say, the max and min ROF of a weapon. Or something else like that. I don't know much about Hex or Binary, including BinaryReaders, so I was wondering if there was a simple way.
- Grimdoomer
- Admin
- Posts: 1835
- Joined: Sun Dec 09, 2007 9:09 pm
Re: Offset Values
look in the plugin for the tag you want to edit, then find the value you wish to change and look at what struct it is in. You will need the offset of that struct and the offset of the value you wish to edit. Then you simply get the meta offset of the Tag after you select it of coarse then do:
And thats it. I think might want to run this by someone else.
Code: Select all
BR.BaseStream.Position = TagsMetaOffset + (structOffset + Value Offset)
Don't snort the magic, we need it for the network.
- XZodia
- Staff
- Posts: 2208
- Joined: Sun Dec 09, 2007 2:09 pm
- Location: UK
- Contact:
Re: Offset Values
dont forget to add the multiply of by the chunk size /end drunkensseses
- Aumaan Anubis
- Staff
- Posts: 1812
- Joined: Thu Dec 13, 2007 12:18 am
- Contact:
Re: Offset Values
I honestly have no idea what you said grimdoomer.
I was hoping that there was an app where you'd type in a number and it'd be like, "That the max ROF of a weapon!" or something nice and easy like that.
But that's probably a little too much too hope for.
I was hoping that there was an app where you'd type in a number and it'd be like, "That the max ROF of a weapon!" or something nice and easy like that.
But that's probably a little too much too hope for.
- OwnZ joO
- Posts: 1197
- Joined: Sun Dec 09, 2007 4:46 pm
Re: Offset Values
Well there no real way to find the offset through a program, you should just look at a plugin to find the offset of the max rate of fire.
- Aumaan Anubis
- Staff
- Posts: 1812
- Joined: Thu Dec 13, 2007 12:18 am
- Contact:
Re: Offset Values
That actually helps.
But both Weapon Pickup Distance and Minimum ROF share the same offset of 0x4. How do I distinguish between them?
But both Weapon Pickup Distance and Minimum ROF share the same offset of 0x4. How do I distinguish between them?
- XZodia
- Staff
- Posts: 2208
- Joined: Sun Dec 09, 2007 2:09 pm
- Location: UK
- Contact:
Re: Offset Values
? values cant share an offset
- neodos
- Posts: 1493
- Joined: Sun Dec 09, 2007 8:58 pm
Re: Offset Values
Yes they do, hmm, chunks can be shared in another tag, reflexives too, i noticed that on wgit and skin, seems like same thing for vehi and weap.
- Grimdoomer
- Admin
- Posts: 1835
- Joined: Sun Dec 09, 2007 9:09 pm
Re: Offset Values
He forgot the struct offset here
thats the part you need to look at, the struct offset is 704, and intial rounds offset is 6. All you do is get the metaoffset of the tag, and goto the struct offset. Then you read the chunkcount there, then advance byt the offset of the intial rounds wich is 6:
Thats it.
Code: Select all
<struct name="Magazine" offset="704" visible="true" size="92" label="">
<bitmask32 name="Flags" offset="0" visible="True">
<option name="Wastes rounds when reloaded" value="1" />
<option name="Every round must be chambered" value="2" />
</bitmask32>
<short name="Rounds Recharged (per second)" offset="4" visible="True" />
<short name="Initial Rounds" offset="6" visible="True" />
<short name="Max Rounds" offset="8" visible="True" />
<short name="Max Rounds Loaded" offset="10" visible="True" />
<int name="Max Rounds Held" offset="12" visible="True" />
<float name="Reload Time(seconds)" offset="16" visible="False" />
<int name="Rounds Reloaded" offset="20" visible="True" />
<float name="Chamber Time(seconds)" offset="24" visible="True" />
<unused offset="28" size="24" />
<tag name="Reloading Effect" offset="52" visible="True" />
<id name="Reloading Effect" offset="56" visible="True" />
<tag name="Chambering Effect" offset="60" visible="True" />
<id name="Chambering Effect" offset="64" visible="True" />
<tag name="Unused" offset="68" visible="False" />
<id name="Unused" offset="72" visible="False" />
<tag name="Unused" offset="76" visible="False" />
<id name="Unused" offset="80" visible="False" />
<struct name="Magazines" offset="84" visible="true" size="12" label="">
<int name="Rounds" offset="0" visible="True" />
<tag name="Equipment" offset="4" visible="True" />
<id name="Equipment" offset="8" visible="True" />
</struct>
</struct>
Code: Select all
BR.BaseStream.Posistion = TagsMetaOffset + 704
ChunkCount = BR.Readint32
BR.BaseStream.Position += 6
InitialRounds = BR.ReadShort
Don't snort the magic, we need it for the network.
- Aumaan Anubis
- Staff
- Posts: 1812
- Joined: Thu Dec 13, 2007 12:18 am
- Contact:
Offset Values
I'm not a programming master, so I'll just post my source.
Keep in mind, this isn't the code related to the controls on the form, and therefore I have absolutely no idea what's happening.
Visual Basic, unfortunately.
Keep in mind, this isn't the code related to the controls on the form, and therefore I have absolutely no idea what's happening.
Code: Select all
Imports System.IO
Public Class H2Map
Public Structure Halo2Map
'Basic Map Info
Public MapLocation As String
Public MapLoaded As Boolean
Public H2Tag() As H2Tag
Public mapMagic As Long
Public mapSecondaryMagic As Long
Public mapName As String
'Basic header Info
Public indexOffset As Long
Public indexSize As Long
Public metaSize As Long
Public fileTableOffset As Long
'Basic Index Info
Public primaryMagicConstantMagic As Long
Public objectIndexOffset As Long
Public objectCount As Long
Public Sub LoadH2Map()
Dim BR As New BinaryReader(New FileStream(MapLocation, FileMode.Open, FileAccess.Read, FileShare.Read))
BR.BaseStream.Position = 16
indexOffset = BR.ReadInt32()
indexSize = BR.ReadInt32()
metaSize = BR.ReadInt32()
BR.BaseStream.Position = 708
fileTableOffset = BR.ReadInt32()
BR.BaseStream.Position = 408
Dim tempcharforname As Char = " "
Do While tempcharforname <> Chr(0)
tempcharforname = BR.ReadChar
If tempcharforname <> Chr(0) Then mapName &= tempcharforname
Loop
BR.BaseStream.Position = indexOffset
primaryMagicConstantMagic = BR.ReadInt32()
BR.BaseStream.Position += 4
objectIndexOffset = BR.ReadInt32()
BR.BaseStream.Position += 12
objectCount = BR.ReadInt32()
Dim TagStart As Long = indexOffset + 32 + (objectIndexOffset - primaryMagicConstantMagic)
ReDim H2Tag(0 To objectCount + 1)
BR.BaseStream.Position = TagStart
For i As Integer = 1 To objectCount Step 1
H2Tag(i).TagClass = StrReverse(BR.ReadChars(4))
H2Tag(i).TagID = BR.ReadInt32()
H2Tag(i).MetaOffset = BR.ReadInt32()
H2Tag(i).MetaSize = BR.ReadInt32()
Next
mapMagic = H2Tag(1).MetaOffset - (indexOffset + indexSize)
mapSecondaryMagic = primaryMagicConstantMagic - indexOffset - 32
For i As Integer = 1 To objectCount Step 1
H2Tag(i).MetaOffset = H2Tag(i).MetaOffset - mapMagic
Next
BR.BaseStream.Position = fileTableOffset
For i As Integer = 1 To objectCount Step 1
Dim tempchar As Char = " "
Do While tempchar <> Chr(0)
tempchar = BR.ReadChar()
H2Tag(i).TagPath &= tempchar
Loop
Next
BR.Close()
MapLoaded = True
End Sub
Public Sub LoadIntoTreeView(ByVal TreeView1 As TreeView, ByVal ProgressBar1 As ProgressBar)
TreeView1.Nodes.Add("Map(" & mapName & ")")
TreeView1.Sorted = True
ProgressBar1.Maximum = objectCount + 1
ProgressBar1.Minimum = 0
ProgressBar1.Value = 0
Dim templistbox As New ListBox
For x As Integer = 1 To objectCount Step 1
'If the templistbox dosent have the class in it then add it to it and also add it to the treeview
If templistbox.Items.Contains(H2Tag(x).TagClass) = False Then
templistbox.Items.Add(H2Tag(x).TagClass)
TreeView1.Nodes(0).Nodes.Add(BuildClassNode(H2Tag(x).TagClass))
Application.DoEvents()
End If
'Increase the Progressbar
ProgressBar1.Value += 1
Next
'Dispose the templistbox
templistbox.Dispose()
'Expand the TreeView
TreeView1.Nodes(0).Expand()
'Reset the Progressbar to 0
ProgressBar1.Value = 0
End Sub
Private Function BuildClassNode(ByVal tagClass As String)
'create a temp TreeNode
Dim ClassNode As New TreeNode
'Set the text to the tagclass
ClassNode.Text = "[" & tagClass & "]"
'Loop through all the tags and if its of the class we want then add to the node
For i As Integer = 1 To objectCount Step 1
If H2Tag(i).TagClass = tagClass Then
ClassNode.Nodes.Add(H2Tag(i).TagPath)
End If
Next
'return the node we put together
Return ClassNode
End Function
Public Sub LoadIntoListBox(ByVal Listbox1 As ListBox, ByVal ProgressBar1 As ProgressBar, Optional ByVal TagClass As String = "")
'Set up the ProgressBars
ProgressBar1.Maximum = objectCount + 1
ProgressBar1.Minimum = 0
ProgressBar1.Value = 0
'If they dont specify A tagClass then do all then if they do then do just that class
If TagClass = "" Then
'This will let you use a Listbox
For i As Integer = 1 To objectCount Step 1
Listbox1.Items.Add(H2Tag(i).TagPath)
ProgressBar1.Value += 1
Next
Else
'This will let you use a Listbox with only 1 tag class
For i As Integer = 1 To objectCount Step 1
If H2Tag(i).TagClass = TagClass Then
Listbox1.Items.Add(H2Tag(i).TagPath)
End If
ProgressBar1.Value += 1
Next
End If
ProgressBar1.Value = 0
End Sub
Public Function FindTagIndexByPath(ByVal TagPath As String) As Integer
Dim index As Integer = 0
'Loop through all the tags and if we find a matching path then we return then index of it
For i As Integer = 1 To objectCount Step 1
If H2Tag(i).TagPath = TagPath Then
index = i
Exit For
End If
Next
Return index
End Function
End Structure
Public Structure H2Tag
Public TagID As Long
Public TagClass As String
Public MetaOffset As Long
Public MetaSize As Long
Public TagPath As String
End Structure
End Class
- Grimdoomer
- Admin
- Posts: 1835
- Joined: Sun Dec 09, 2007 9:09 pm
Offset Values
if this is anthonys source from his tut then please get the fuck out of here.
Don't snort the magic, we need it for the network.
- XZodia
- Staff
- Posts: 2208
- Joined: Sun Dec 09, 2007 2:09 pm
- Location: UK
- Contact:
Offset Values
it certainly looks like it....
- Aumaan Anubis
- Staff
- Posts: 1812
- Joined: Thu Dec 13, 2007 12:18 am
- Contact:
Offset Values
Uhh why?
I used his tutorial.
Did I not give him credit or something?
I used his tutorial.
Did I not give him credit or something?
I thought that this would give it away that it's not mine...Aumaan Anubis wrote:I'm not a programming master, so I'll just post my source.
Keep in mind, this isn't the code related to the controls on the form, and therefore I have absolutely no idea what's happening.
- XZodia
- Staff
- Posts: 2208
- Joined: Sun Dec 09, 2007 2:09 pm
- Location: UK
- Contact:
Offset Values
well you refered to it as your source...and wat was the point in posting it anyway?
- Aumaan Anubis
- Staff
- Posts: 1812
- Joined: Thu Dec 13, 2007 12:18 am
- Contact:
Offset Values
My source was meant to be interpreted as the source I was using.
- Prey
- Posts: 129
- Joined: Sat Dec 29, 2007 5:06 pm
- Location: UK
Offset Values
:/
Whoever's source it is.. it is terrible...
Whoever's source it is.. it is terrible...
-
- Posts: 409
- Joined: Sat Jan 12, 2008 11:42 pm
- Location: Michigan
- Contact:
- Aumaan Anubis
- Staff
- Posts: 1812
- Joined: Thu Dec 13, 2007 12:18 am
- Contact:
Offset Values
Yeah Prey, this is the source for the application I was making awhile back that you helped me with when I got like, tons of errors. It is Anthony's.
Hey, if anyone wants to write a new tut for C# on making a simple app, please, go ahead.
I'll be able to scan the code and hopefully further my minimal knowledge.
Hey, if anyone wants to write a new tut for C# on making a simple app, please, go ahead.
I'll be able to scan the code and hopefully further my minimal knowledge.
- XZodia
- Staff
- Posts: 2208
- Joined: Sun Dec 09, 2007 2:09 pm
- Location: UK
- Contact:
Offset Values
take a lookz at this: http://forums.remnantmods.com/viewtopic.php?f=25&t=24
- Aumaan Anubis
- Staff
- Posts: 1812
- Joined: Thu Dec 13, 2007 12:18 am
- Contact:
Offset Values
Really? Is that what that is?
Sweet, I'll take a look at it.
Sweet, I'll take a look at it.
- Aumaan Anubis
- Staff
- Posts: 1812
- Joined: Thu Dec 13, 2007 12:18 am
- Contact:
Offset Values
Ooook, slighty(majorly) too advanced for me to comprehend.
I'll keep doing stuff and come back to it later.
I'll keep doing stuff and come back to it later.
- XZodia
- Staff
- Posts: 2208
- Joined: Sun Dec 09, 2007 2:09 pm
- Location: UK
- Contact:
Offset Values
lol years of experience went into that dll and its still crap imo
- Grimdoomer
- Admin
- Posts: 1835
- Joined: Sun Dec 09, 2007 9:09 pm
Offset Values
well I have a small open map demo in C# I can give to you. Every pretty much has a comment on what it does.
Don't snort the magic, we need it for the network.