You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
apphost-extract/src/apphost-extract/apphost-extract/AppHostFileHeader.cs

39 lines
1.0 KiB

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace apphost_extract
{
public class AppHostFileHeader
{
private const int HEADER_OFFSET = 0x1DE7E2;
private const int HEADER_SIZE = 0xD;
private byte[] Raw;
public string Path { get; set; }
public int EmbeddedFilesCount { get; set; }
public AppHostManifest Manifest { get; set; }
public AppHostFileHeader(FileStream File)
{
File.Seek(HEADER_OFFSET, SeekOrigin.Begin);
byte[] headerBuffer = new byte[HEADER_SIZE];
File.Read(headerBuffer, 0, HEADER_SIZE);
Raw = headerBuffer;
byte[] stringBuffer = new byte[Raw[0xC]];
File.Read(stringBuffer, 0, stringBuffer.Length);
Path = Encoding.UTF8.GetString(stringBuffer);
Manifest = new AppHostManifest(File, BitConverter.ToInt32(Raw, 0x8));
}
}
}