Post: Waw Patch Creator
11-29-2010, 12:57 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); Hi Guys i have Created a W@W patch creator

it's .bat file

You must login or register to view this content.

You must login or register to view this content.
(adsbygoogle = window.adsbygoogle || []).push({});
12-16-2010, 11:37 PM #11
little_legz
SleepinIsCheatin
The hardest part is opening the FF file. I have the source code for the XBOX FF viewer so if I could somehow implement that into a program and tweak it to open the PS3 FF's then we could be full speed ahead.
12-17-2010, 02:19 AM #12
Karoolus
I'm the W@W Menu Guy !
Originally posted by Kane View Post
The hardest part is opening the FF file. I have the source code for the XBOX FF viewer so if I could somehow implement that into a program and tweak it to open the PS3 FF's then we could be full speed ahead.


i'll get the source code for the latest version & take a look at it..

if i find something or have an idea i'll just open a thread about it Winky Winky
if you'd be so kind to do the same ? would help a LOT Happy
12-17-2010, 10:30 AM #13
little_legz
SleepinIsCheatin
Originally posted by Karoolus View Post
i'll get the source code for the latest version & take a look at it..

if i find something or have an idea i'll just open a thread about it Winky Winky
if you'd be so kind to do the same ? would help a LOT Happy


Yeah sure, Well I think I have found what opens the FF's

        Private Sub OpenFFToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenFFToolStripMenuItem.Click
OpenFF()
End Sub



Private Sub OpenFF()
Try
If (dragDropFFname = "") Then
OpenDialog.Title = "Open a .FF file"
OpenDialog.Filter = ".FF files(*.ff)|*.ff"
OpenDialog.FileName = ""
OpenDialog.FilterIndex = 1
If (Boolean.Parse(GetPreferenceValue("rememberLF"))) Then
OpenDialog.InitialDirectory = GetPreferenceValue("lastlocation")
Else
OpenDialog.InitialDirectory = Directory.GetCurrentDirectory()
End If
OpenDialog.RestoreDirectory = True
If (OpenDialog.ShowDialog() = Windows.Forms.DialogResult.OK And OpenDialog.CheckFileExists) Then
dragDropFFname = OpenDialog.FileName
Else
Exit Sub
End If
End If

' Load the .FF file

Array.Clear(ffBytes, 0, ffBytes.Length)

RawFiles.Nodes.Clear()
fileInfo.RawFiles.Clear()

CodeBox.Text = ""

Wait.Show()

'If (Boolean.Parse(GetPreferenceValue("reduceram", "True"))) Then

' run backend in 'open' mode

Dim backEnd As Process = System.Diagnostics.Process.Start(Directory.GetCurrentDirectory() + "\FFbackend.exe", "-o """ + dragDropFFname + """")

backEnd.WaitForExit()

fileInfo.DataOffset = Integer.Parse(File.ReadAllLines(Directory.GetCurrentDirectory() + "\prefs\ff.config")(0)) ' read the file the backend makes
fileInfo.IsMultiplayer = Boolean.Parse(File.ReadAllLines(Directory.GetCurrentDirectory() + "\prefs\ff.config")(1))
fileInfo.OrigFileName = File.ReadAllLines(Directory.GetCurrentDirectory() + "\prefs\ff.config")(2)

File.Delete(Directory.GetCurrentDirectory() + "\prefs\ff.config") ' delete it

Me.Cursor = Cursors.Default

currentOpenFFextracted = dragDropFFname.Substring(0, dragDropFFname.LastIndexOf(".")) + "-extract.dat" ' The backend makes this file
fileInfo.FileName = dragDropFFname
dragDropFFname = ""

SetPreferenceValue("lastlocation", fileInfo.FileName.Substring(0, fileInfo.FileName.LastIndexOf("\")))
System.IO.File.Delete("prefs\prefs.ini")
System.IO.File.WriteAllLines("prefs\prefs.ini", Form1.optionsData.ToArray(GetType(System.String)))

ffBytes = File.ReadAllBytes(currentOpenFFextracted)

Me.Text = "FF Viewer v" + versionNum + " [" + fileInfo.FileName + "]"

Dim numOfNulls As Integer = 0

Dim notExtractedFF As Byte()
notExtractedFF = File.ReadAllBytes(fileInfo.FileName)

If (Integer.Parse(notExtractedFF(Cool Man (aka Tustin).ToString()) <> 0) Then
' the file is little endian (usually pc)
fileInfo.Version = ByteHandling.GetDWORD(notExtractedFF, 8, True)
fileInfo.BigEndian = False
Else
' the file is big endian
fileInfo.Version = ByteHandling.GetDWORD(notExtractedFF, 8, False)
fileInfo.BigEndian = True
End If

If (ffBytes(47) <> 255) Then ' if byte 47 is not FF, the current file is COD4/5!
numOfNulls = ByteHandling.GetDWORD(ffBytes, 44, Not fileInfo.BigEndian) 'and the amount of nulls starts 12 later! (12 more header bytes!)
openedMW2 = False
Else
numOfNulls = ByteHandling.GetDWORD(ffBytes, 32, Not fileInfo.BigEndian)
openedMW2 = True
End If

' Find out where the PreAssetStrings at the top of the FF starts
Dim currentSpacer As Integer = 52
If (Not openedMW2) Then
currentSpacer += 4
End If
While (ffBytes(currentSpacer) = Byte.Parse(255))
currentSpacer += 1
End While


' Now, add all of the PreAssetStrings to fileInfo
If (openedMW2) Then
fileInfo.PreAssetStringCount = ByteHandling.GetDWORD(ffBytes, 40, Not fileInfo.BigEndian) - 1
Dim preAssetStringOffset As Integer = currentSpacer
For i As Integer = 0 To fileInfo.PreAssetStringCount - 1
Dim newOffset As Integer = ByteHandling.FindBytes(ffBytes, New Byte() {0}, preAssetStringOffset)
Dim stringName As String = ByteHandling.GetString(ffBytes, preAssetStringOffset, newOffset)
fileInfo.PreAssetStrings.Add(New PreAssetStringData(stringName, stringName.Length))
preAssetStringOffset = newOffset + 1
Next
Else
fileInfo.PreAssetStringCount = ByteHandling.GetDWORD(ffBytes, 36, Not fileInfo.BigEndian) - 1
Dim preAssetStringOffset As Integer = currentSpacer
For i As Integer = 0 To fileInfo.PreAssetStringCount - 1
Dim newOffset As Integer = ByteHandling.FindBytes(ffBytes, New Byte() {0}, preAssetStringOffset)
Dim stringName As String = ByteHandling.GetString(ffBytes, preAssetStringOffset, newOffset)
fileInfo.PreAssetStrings.Add(New PreAssetStringData(stringName, stringName.Length))
preAssetStringOffset = newOffset + 1
Next
End If

numOfNulls = fileInfo.PreAssetStringCount

' Now find out where the string table ends and the assets start!
Dim startAssets As Integer = currentSpacer
While (numOfNulls > 0)
startAssets = ByteHandling.FindBytes(ffBytes, New Byte() {0}, startAssets + 1)
numOfNulls -= 1
End While

If (openedMW2) Then
fileInfo.AssetCount = ByteHandling.GetDWORD(ffBytes, 48, Not fileInfo.BigEndian)
Dim currentOffset As Integer = startAssets + 3

For i As Integer = 0 To fileInfo.AssetCount - 1
If (fileInfo.BigEndian) Then
fileInfo.Assets.Add(New AssetData(ffBytes(currentOffset + 1)))
Else
fileInfo.Assets.Add(New AssetData(ffBytes(currentOffset)))
End If
currentOffset += 8
Next
Else
fileInfo.AssetCount = ByteHandling.GetDWORD(ffBytes, 44, Not fileInfo.BigEndian)
Dim currentOffset As Integer = startAssets + 3

For i As Integer = 0 To fileInfo.AssetCount - 1
If (fileInfo.BigEndian) Then
fileInfo.Assets.Add(New AssetData(ffBytes(currentOffset + 1)))
Else
fileInfo.Assets.Add(New AssetData(ffBytes(currentOffset)))
End If

currentOffset += 8
Next
End If

Dim csvCount As Integer = ByteHandling.CountBytes(ffBytes, New Byte() {Asc("."), Asc("c"), Asc("s"), Asc("v"), 0})
Dim offset As Integer = 0
For i As Integer = 0 To csvCount - 1
offset = ByteHandling.FindBytes(ffBytes, New Byte() {Asc("."), Asc("c"), Asc("s"), Asc("v"), 0}, offset + 1, True) + 1
Dim startofNameoffset As Integer
startofNameoffset = ByteHandling.FindByteBackward(ffBytes, Byte.Parse(255), offset) + 1
Dim columns As Integer = ByteHandling.GetDWORD(ffBytes, startofNameoffset - 12, Not fileInfo.BigEndian)
Dim rows As Integer = ByteHandling.GetDWORD(ffBytes, startofNameoffset - 8, Not fileInfo.BigEndian)

If (rows <> -1 And columns <> -1 And offset - startofNameoffset < 25) Then
StringTables.Nodes.Add(ByteHandling.GetString(ffBytes, startofNameoffset, offset + 4))
StringTables.Nodes(StringTables.Nodes.Count - 1).Nodes.Add("Columns: " + columns.ToString())
StringTables.Nodes(StringTables.Nodes.Count - 1).Nodes.Add("Rows: " + rows.ToString())
fileInfo.StringTables.Add(New StringTableData(ByteHandling.GetString(ffBytes, startofNameoffset, offset + 4), columns, rows, startofNameoffset))
End If
Application.DoEvents()
Next

AddRawFileExtension(New Byte() {Asc("."), Asc("g"), Asc("s"), Asc("c"), 0})
AddRawFileExtension(New Byte() {Asc("."), Asc("r"), Asc("m"), Asc("b"), 0})
AddRawFileExtension(New Byte() {Asc("."), Asc("d"), Asc("e"), Asc("f"), 0, 78})
AddRawFileExtension(New Byte() {Asc("."), Asc("c"), Asc("f"), Asc("g"), 0})
AddRawFileExtension(New Byte() {Asc("."), Asc("i"), Asc("n"), Asc("f"), Asc("o"), 0}, 5)

Dim imageOffset As Integer = 0
Dim imageCount As Integer = ByteHandling.CountBytes(ffBytes, New Byte() {0, 160, 171, 16}, 0)
For i As Integer = 0 To imageCount - 1

imageOffset = ByteHandling.FindBytes(ffBytes, New Byte() {0, 160, 171, 16}, imageOffset + 1)
Dim nameOffsetEnd As Integer = imageOffset ' start of Image name
Dim nameOffset As Integer = 0
If (openedMW2) Then ' for some reason, cod4 uses a FF byte to indicate the start of an image :S?
nameOffset = ByteHandling.FindByteBackward(ffBytes, Byte.Parse(0), nameOffsetEnd - 1) + 1
Else
nameOffset = ByteHandling.FindByteBackward(ffBytes, Byte.Parse(255), nameOffsetEnd - 1) + 1
End If
MiscData.Nodes(0).Nodes.Add(ByteHandling.GetString(ffBytes, nameOffset, nameOffsetEnd))
Application.DoEvents()
Next

Dim menuOffset As Integer = 0
Dim menuCount As Integer = ByteHandling.CountBytes(ffBytes, New Byte() {Asc("."), Asc("m"), Asc("e"), Asc("n"), Asc("u"), 0}, 0)
For i As Integer = 0 To menuCount - 1
menuOffset = ByteHandling.FindBytes(ffBytes, New Byte() {Asc("."), Asc("m"), Asc("e"), Asc("n"), Asc("u"), 0}, menuOffset + 1)
Dim nameOffsetEnd As Integer = menuOffset ' start of menu name
Dim nameOffset As Integer = 0
nameOffset = ByteHandling.FindByteBackward(ffBytes, Byte.Parse(255), nameOffsetEnd - 1) + 1
Dim node As TreeNode = MiscData.Nodes(1).Nodes.Add(ByteHandling.GetString(ffBytes, nameOffset, nameOffsetEnd + 5))
node.Nodes.Add("Name Offset: " + nameOffset.ToString())
node.Nodes.Add("File offset: " + nameOffsetEnd.ToString())
node.Nodes.Add("# of menuDef's: " + ByteHandling.GetDWORD(ffBytes, nameOffset - 8, Not openedMW2).ToString())
Application.DoEvents()
Next

Dim weapCount As Integer = ByteHandling.CountBytes(ffBytes, New Byte() {0, Asc("W"), Asc("E"), Asc("A"), Asc("P")})
offset = 0
For i As Integer = 0 To weapCount - 1
offset = ByteHandling.FindBytes(ffBytes, New Byte() {0, Asc("W"), Asc("E"), Asc("A"), Asc("P")}, offset + 1, True) + 1
Dim startofNameoffset As Integer = ByteHandling.FindByteBackward(ffBytes, Byte.Parse(0), offset) + 1
Dim endofNameoffset As Integer = ByteHandling.FindBytes(ffBytes, New Byte() {255}, offset) + 1
Dim node As TreeNode = MiscData.Nodes(2).Nodes.Add(ByteHandling.GetString(ffBytes, startofNameoffset, endofNameoffset))
Dim endOffset As Integer = ByteHandling.FindBytes(ffBytes, New Byte() {255, 255, 255, 255}, offset + 4).ToString()
node.Nodes.Add("Name Offset: " + startofNameoffset.ToString())
node = Nothing
Next

'Catch ex As Exception
' MessageBox.Show("Could not open .FF file: " + ex.Message, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error)
'End Try

fileInfo.Size = ByteHandling.GetDWORD(ffBytes, 0, Not fileInfo.BigEndian)

If (fileInfo.Version = MW2Version Or fileInfo.Version = MW2VersionPC) Then
fileInfo.SecondSize = ByteHandling.GetDWORD(ffBytes, 20, Not fileInfo.BigEndian)
Else
fileInfo.SecondSize = ByteHandling.GetDWORD(ffBytes, 24, Not fileInfo.BigEndian)
End If

FileGridView.Refresh()
Catch ex As Exception
MessageBox.Show("Error opening: " + ex.Message)
End Try

End Sub



Theres some things in there like "FF viewer Backend" so I dont know if / how we would remove these to get this to work
This is also the source code just to open the FF only from the V2 version Smile
12-17-2010, 11:17 AM #14
Karoolus
I'm the W@W Menu Guy !
Originally posted by Kane View Post
Yeah sure, Well I think I have found what opens the FF's

        Private Sub OpenFFToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenFFToolStripMenuItem.Click
OpenFF()
End Sub



Private Sub OpenFF()
Try
If (dragDropFFname = "") Then
OpenDialog.Title = "Open a .FF file"
OpenDialog.Filter = ".FF files(*.ff)|*.ff"
OpenDialog.FileName = ""
OpenDialog.FilterIndex = 1
If (Boolean.Parse(GetPreferenceValue("rememberLF"))) Then
OpenDialog.InitialDirectory = GetPreferenceValue("lastlocation")
Else
OpenDialog.InitialDirectory = Directory.GetCurrentDirectory()
End If
OpenDialog.RestoreDirectory = True
If (OpenDialog.ShowDialog() = Windows.Forms.DialogResult.OK And OpenDialog.CheckFileExists) Then
dragDropFFname = OpenDialog.FileName
Else
Exit Sub
End If
End If

' Load the .FF file

Array.Clear(ffBytes, 0, ffBytes.Length)

RawFiles.Nodes.Clear()
fileInfo.RawFiles.Clear()

CodeBox.Text = ""

Wait.Show()

'If (Boolean.Parse(GetPreferenceValue("reduceram", "True"))) Then

' run backend in 'open' mode

Dim backEnd As Process = System.Diagnostics.Process.Start(Directory.GetCurrentDirectory() + "\FFbackend.exe", "-o """ + dragDropFFname + """")

backEnd.WaitForExit()

fileInfo.DataOffset = Integer.Parse(File.ReadAllLines(Directory.GetCurrentDirectory() + "\prefs\ff.config")(0)) ' read the file the backend makes
fileInfo.IsMultiplayer = Boolean.Parse(File.ReadAllLines(Directory.GetCurrentDirectory() + "\prefs\ff.config")(1))
fileInfo.OrigFileName = File.ReadAllLines(Directory.GetCurrentDirectory() + "\prefs\ff.config")(2)

File.Delete(Directory.GetCurrentDirectory() + "\prefs\ff.config") ' delete it

Me.Cursor = Cursors.Default

currentOpenFFextracted = dragDropFFname.Substring(0, dragDropFFname.LastIndexOf(".")) + "-extract.dat" ' The backend makes this file
fileInfo.FileName = dragDropFFname
dragDropFFname = ""

SetPreferenceValue("lastlocation", fileInfo.FileName.Substring(0, fileInfo.FileName.LastIndexOf("\")))
System.IO.File.Delete("prefs\prefs.ini")
System.IO.File.WriteAllLines("prefs\prefs.ini", Form1.optionsData.ToArray(GetType(System.String)))

ffBytes = File.ReadAllBytes(currentOpenFFextracted)

Me.Text = "FF Viewer v" + versionNum + " [" + fileInfo.FileName + "]"

Dim numOfNulls As Integer = 0

Dim notExtractedFF As Byte()
notExtractedFF = File.ReadAllBytes(fileInfo.FileName)

If (Integer.Parse(notExtractedFF(Cool Man (aka Tustin).ToString()) <> 0) Then
' the file is little endian (usually pc)
fileInfo.Version = ByteHandling.GetDWORD(notExtractedFF, 8, True)
fileInfo.BigEndian = False
Else
' the file is big endian
fileInfo.Version = ByteHandling.GetDWORD(notExtractedFF, 8, False)
fileInfo.BigEndian = True
End If

If (ffBytes(47) <> 255) Then ' if byte 47 is not FF, the current file is COD4/5!
numOfNulls = ByteHandling.GetDWORD(ffBytes, 44, Not fileInfo.BigEndian) 'and the amount of nulls starts 12 later! (12 more header bytes!)
openedMW2 = False
Else
numOfNulls = ByteHandling.GetDWORD(ffBytes, 32, Not fileInfo.BigEndian)
openedMW2 = True
End If

' Find out where the PreAssetStrings at the top of the FF starts
Dim currentSpacer As Integer = 52
If (Not openedMW2) Then
currentSpacer += 4
End If
While (ffBytes(currentSpacer) = Byte.Parse(255))
currentSpacer += 1
End While


' Now, add all of the PreAssetStrings to fileInfo
If (openedMW2) Then
fileInfo.PreAssetStringCount = ByteHandling.GetDWORD(ffBytes, 40, Not fileInfo.BigEndian) - 1
Dim preAssetStringOffset As Integer = currentSpacer
For i As Integer = 0 To fileInfo.PreAssetStringCount - 1
Dim newOffset As Integer = ByteHandling.FindBytes(ffBytes, New Byte() {0}, preAssetStringOffset)
Dim stringName As String = ByteHandling.GetString(ffBytes, preAssetStringOffset, newOffset)
fileInfo.PreAssetStrings.Add(New PreAssetStringData(stringName, stringName.Length))
preAssetStringOffset = newOffset + 1
Next
Else
fileInfo.PreAssetStringCount = ByteHandling.GetDWORD(ffBytes, 36, Not fileInfo.BigEndian) - 1
Dim preAssetStringOffset As Integer = currentSpacer
For i As Integer = 0 To fileInfo.PreAssetStringCount - 1
Dim newOffset As Integer = ByteHandling.FindBytes(ffBytes, New Byte() {0}, preAssetStringOffset)
Dim stringName As String = ByteHandling.GetString(ffBytes, preAssetStringOffset, newOffset)
fileInfo.PreAssetStrings.Add(New PreAssetStringData(stringName, stringName.Length))
preAssetStringOffset = newOffset + 1
Next
End If

numOfNulls = fileInfo.PreAssetStringCount

' Now find out where the string table ends and the assets start!
Dim startAssets As Integer = currentSpacer
While (numOfNulls > 0)
startAssets = ByteHandling.FindBytes(ffBytes, New Byte() {0}, startAssets + 1)
numOfNulls -= 1
End While

If (openedMW2) Then
fileInfo.AssetCount = ByteHandling.GetDWORD(ffBytes, 48, Not fileInfo.BigEndian)
Dim currentOffset As Integer = startAssets + 3

For i As Integer = 0 To fileInfo.AssetCount - 1
If (fileInfo.BigEndian) Then
fileInfo.Assets.Add(New AssetData(ffBytes(currentOffset + 1)))
Else
fileInfo.Assets.Add(New AssetData(ffBytes(currentOffset)))
End If
currentOffset += 8
Next
Else
fileInfo.AssetCount = ByteHandling.GetDWORD(ffBytes, 44, Not fileInfo.BigEndian)
Dim currentOffset As Integer = startAssets + 3

For i As Integer = 0 To fileInfo.AssetCount - 1
If (fileInfo.BigEndian) Then
fileInfo.Assets.Add(New AssetData(ffBytes(currentOffset + 1)))
Else
fileInfo.Assets.Add(New AssetData(ffBytes(currentOffset)))
End If

currentOffset += 8
Next
End If

Dim csvCount As Integer = ByteHandling.CountBytes(ffBytes, New Byte() {Asc("."), Asc("c"), Asc("s"), Asc("v"), 0})
Dim offset As Integer = 0
For i As Integer = 0 To csvCount - 1
offset = ByteHandling.FindBytes(ffBytes, New Byte() {Asc("."), Asc("c"), Asc("s"), Asc("v"), 0}, offset + 1, True) + 1
Dim startofNameoffset As Integer
startofNameoffset = ByteHandling.FindByteBackward(ffBytes, Byte.Parse(255), offset) + 1
Dim columns As Integer = ByteHandling.GetDWORD(ffBytes, startofNameoffset - 12, Not fileInfo.BigEndian)
Dim rows As Integer = ByteHandling.GetDWORD(ffBytes, startofNameoffset - 8, Not fileInfo.BigEndian)

If (rows <> -1 And columns <> -1 And offset - startofNameoffset < 25) Then
StringTables.Nodes.Add(ByteHandling.GetString(ffBytes, startofNameoffset, offset + 4))
StringTables.Nodes(StringTables.Nodes.Count - 1).Nodes.Add("Columns: " + columns.ToString())
StringTables.Nodes(StringTables.Nodes.Count - 1).Nodes.Add("Rows: " + rows.ToString())
fileInfo.StringTables.Add(New StringTableData(ByteHandling.GetString(ffBytes, startofNameoffset, offset + 4), columns, rows, startofNameoffset))
End If
Application.DoEvents()
Next

AddRawFileExtension(New Byte() {Asc("."), Asc("g"), Asc("s"), Asc("c"), 0})
AddRawFileExtension(New Byte() {Asc("."), Asc("r"), Asc("m"), Asc("b"), 0})
AddRawFileExtension(New Byte() {Asc("."), Asc("d"), Asc("e"), Asc("f"), 0, 78})
AddRawFileExtension(New Byte() {Asc("."), Asc("c"), Asc("f"), Asc("g"), 0})
AddRawFileExtension(New Byte() {Asc("."), Asc("i"), Asc("n"), Asc("f"), Asc("o"), 0}, 5)

Dim imageOffset As Integer = 0
Dim imageCount As Integer = ByteHandling.CountBytes(ffBytes, New Byte() {0, 160, 171, 16}, 0)
For i As Integer = 0 To imageCount - 1

imageOffset = ByteHandling.FindBytes(ffBytes, New Byte() {0, 160, 171, 16}, imageOffset + 1)
Dim nameOffsetEnd As Integer = imageOffset ' start of Image name
Dim nameOffset As Integer = 0
If (openedMW2) Then ' for some reason, cod4 uses a FF byte to indicate the start of an image :S?
nameOffset = ByteHandling.FindByteBackward(ffBytes, Byte.Parse(0), nameOffsetEnd - 1) + 1
Else
nameOffset = ByteHandling.FindByteBackward(ffBytes, Byte.Parse(255), nameOffsetEnd - 1) + 1
End If
MiscData.Nodes(0).Nodes.Add(ByteHandling.GetString(ffBytes, nameOffset, nameOffsetEnd))
Application.DoEvents()
Next

Dim menuOffset As Integer = 0
Dim menuCount As Integer = ByteHandling.CountBytes(ffBytes, New Byte() {Asc("."), Asc("m"), Asc("e"), Asc("n"), Asc("u"), 0}, 0)
For i As Integer = 0 To menuCount - 1
menuOffset = ByteHandling.FindBytes(ffBytes, New Byte() {Asc("."), Asc("m"), Asc("e"), Asc("n"), Asc("u"), 0}, menuOffset + 1)
Dim nameOffsetEnd As Integer = menuOffset ' start of menu name
Dim nameOffset As Integer = 0
nameOffset = ByteHandling.FindByteBackward(ffBytes, Byte.Parse(255), nameOffsetEnd - 1) + 1
Dim node As TreeNode = MiscData.Nodes(1).Nodes.Add(ByteHandling.GetString(ffBytes, nameOffset, nameOffsetEnd + 5))
node.Nodes.Add("Name Offset: " + nameOffset.ToString())
node.Nodes.Add("File offset: " + nameOffsetEnd.ToString())
node.Nodes.Add("# of menuDef's: " + ByteHandling.GetDWORD(ffBytes, nameOffset - 8, Not openedMW2).ToString())
Application.DoEvents()
Next

Dim weapCount As Integer = ByteHandling.CountBytes(ffBytes, New Byte() {0, Asc("W"), Asc("E"), Asc("A"), Asc("P")})
offset = 0
For i As Integer = 0 To weapCount - 1
offset = ByteHandling.FindBytes(ffBytes, New Byte() {0, Asc("W"), Asc("E"), Asc("A"), Asc("P")}, offset + 1, True) + 1
Dim startofNameoffset As Integer = ByteHandling.FindByteBackward(ffBytes, Byte.Parse(0), offset) + 1
Dim endofNameoffset As Integer = ByteHandling.FindBytes(ffBytes, New Byte() {255}, offset) + 1
Dim node As TreeNode = MiscData.Nodes(2).Nodes.Add(ByteHandling.GetString(ffBytes, startofNameoffset, endofNameoffset))
Dim endOffset As Integer = ByteHandling.FindBytes(ffBytes, New Byte() {255, 255, 255, 255}, offset + 4).ToString()
node.Nodes.Add("Name Offset: " + startofNameoffset.ToString())
node = Nothing
Next

'Catch ex As Exception
' MessageBox.Show("Could not open .FF file: " + ex.Message, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error)
'End Try

fileInfo.Size = ByteHandling.GetDWORD(ffBytes, 0, Not fileInfo.BigEndian)

If (fileInfo.Version = MW2Version Or fileInfo.Version = MW2VersionPC) Then
fileInfo.SecondSize = ByteHandling.GetDWORD(ffBytes, 20, Not fileInfo.BigEndian)
Else
fileInfo.SecondSize = ByteHandling.GetDWORD(ffBytes, 24, Not fileInfo.BigEndian)
End If

FileGridView.Refresh()
Catch ex As Exception
MessageBox.Show("Error opening: " + ex.Message)
End Try

End Sub



Theres some things in there like "FF viewer Backend" so I dont know if / how we would remove these to get this to work
This is also the source code just to open the FF only from the V2 version Smile


    Dim backEnd As Process = System.Diagnostics.Process.Start(Directory.GetCurrentDirectory() + "\[COLOR="Red"]FFbackend.exe", "-o """ + dragDropFFname + """"[/COLOR])


doesn't that ring a bell for you ?


FFbackend.exe", "-o """ + dragDropFFname + """"
==> FFbackend.exe -o patch_mp.ff

if we could make it do offzip -a -z -15 patch_mp.ff & work from the results we get there..
mmhm.. things to think about..
12-17-2010, 12:07 PM #15
little_legz
SleepinIsCheatin
Originally posted by Karoolus View Post
    Dim backEnd As Process = System.Diagnostics.Process.Start(Directory.GetCurrentDirectory() + "\[COLOR="Red"]FFbackend.exe", "-o """ + dragDropFFname + """"[/COLOR])


doesn't that ring a bell for you ?


FFbackend.exe", "-o """ + dragDropFFname + """"
==> FFbackend.exe -o patch_mp.ff

if we could make it do offzip -a -z -15 patch_mp.ff & work from the results we get there..
mmhm.. things to think about..


I didn't even see that part of code tbh haha. I'll go see if I can make a quick program in VB to see if I can get offzip to launch and unpack the patch

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo