mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-08-01 21:49:23 +00:00
Add SFFS models, no encryption
This commit is contained in:
20
BurnOutSharp.Models/SFFS/FileEntry.cs
Normal file
20
BurnOutSharp.Models/SFFS/FileEntry.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace BurnOutSharp.Models.SFFS
|
||||
{
|
||||
/// <see cref="https://forum.xentax.com/viewtopic.php?f=21&t=2084"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public class FileEntry
|
||||
{
|
||||
/// <summary>
|
||||
/// MD5 hash of filename (not encrypted,)
|
||||
/// </summary>
|
||||
/// <remarks>0x10 bytes</remarks>
|
||||
public byte[] FilenameMD5Hash;
|
||||
|
||||
/// <summary>
|
||||
/// Index of fileheader (encrypted with filename)
|
||||
/// </summary>
|
||||
public ulong FileHeaderIndex;
|
||||
}
|
||||
}
|
||||
20
BurnOutSharp.Models/SFFS/FileHeader.cs
Normal file
20
BurnOutSharp.Models/SFFS/FileHeader.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace BurnOutSharp.Models.SFFS
|
||||
{
|
||||
/// <see cref="https://forum.xentax.com/viewtopic.php?f=21&t=2084"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public class FileHeader
|
||||
{
|
||||
/// <summary>
|
||||
/// Start of file content (encrypted with filename)
|
||||
/// </summary>
|
||||
public ulong FileContentStart;
|
||||
|
||||
/// <summary>
|
||||
/// File info (timestamps, size, data position, encrypted)
|
||||
/// </summary>
|
||||
/// <remarks>Unknown format</remarks>
|
||||
public byte[] FileInfo;
|
||||
}
|
||||
}
|
||||
29
BurnOutSharp.Models/SFFS/Header.cs
Normal file
29
BurnOutSharp.Models/SFFS/Header.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace BurnOutSharp.Models.SFFS
|
||||
{
|
||||
/// <summary>
|
||||
/// Header
|
||||
/// </summary>
|
||||
/// <see cref="https://forum.xentax.com/viewtopic.php?f=21&t=2084"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public class Header
|
||||
{
|
||||
/// <summary>
|
||||
/// "SFFS"
|
||||
/// </summary>
|
||||
public uint Magic;
|
||||
|
||||
/// <summary>
|
||||
/// Version (0x00000001)
|
||||
/// </summary>
|
||||
public uint Version;
|
||||
|
||||
/// <summary>
|
||||
/// Number of files in the container (encrypted with application key).
|
||||
/// Minimal number here is usually 65h, so its not real file count
|
||||
/// in some cases, more like index size
|
||||
/// </summary>
|
||||
public ulong FileCount;
|
||||
}
|
||||
}
|
||||
33
BurnOutSharp.Models/SFFS/StarForceFileSystem.cs
Normal file
33
BurnOutSharp.Models/SFFS/StarForceFileSystem.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
namespace BurnOutSharp.Models.SFFS
|
||||
{
|
||||
/// <summary>
|
||||
/// SFFS consists of 2 major parts: the container files that contain the game
|
||||
/// content and a filesystem filter driver (sfvfs02.sys) that handles all file-io.
|
||||
/// When a game has SFFS'ed files and uses some file-io api like CreateFile, the
|
||||
/// SFFS filterdriver sees this request and handles it if needed.that way, SFFS is
|
||||
/// totally transparent to the game, since it never knows if the data is coming from
|
||||
/// real file API or from the SFFS filterdriver. during SF initialization, the
|
||||
/// SF-process registers itself as a SFFS process in a processid list, maintained
|
||||
/// from the filterdriver. Part of that registration are the names of the
|
||||
/// containerfiles, the process uses and an application key, that is needed to
|
||||
/// decrypt headerinfos. Note that SFFS itself is completly vm-free.
|
||||
/// </summary>
|
||||
/// <see cref="https://forum.xentax.com/viewtopic.php?f=21&t=2084"/>
|
||||
public class StarForceFileSystem
|
||||
{
|
||||
/// <summary>
|
||||
/// Header
|
||||
/// </summary>
|
||||
public Header Header { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Files
|
||||
/// </summary>
|
||||
public FileEntry[] Files { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// File headers
|
||||
/// </summary>
|
||||
public FileHeader[] FileHeaders { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user