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

41 lines
1.1 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 byte PathLength { get; set; }
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;
PathLength = Raw[0xC];
byte[] stringBuffer = new byte[PathLength];
File.Read(stringBuffer, 0, stringBuffer.Length);
Path = Encoding.UTF8.GetString(stringBuffer);
Manifest = new AppHostManifest(File, BitConverter.ToInt32(Raw, 0x8));
}
}
}