diff --git a/src/apphost-extract/apphost-extract/AppHostFileEntry.cs b/src/apphost-extract/apphost-extract/AppHostFileEntry.cs index 05bc4ea..13d1a22 100644 --- a/src/apphost-extract/apphost-extract/AppHostFileEntry.cs +++ b/src/apphost-extract/apphost-extract/AppHostFileEntry.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -8,5 +9,23 @@ namespace apphost_extract { public class AppHostFileEntry { + public int Offset { get; set; } + public int Size { get; set; } + public string RelativePath { get; set; } + + private byte[] Raw; + + private const int FILE_ENTRY_SIZE = 0x12; + + public AppHostFileEntry(FileStream File) + { + byte[] entryBuffer = new byte[FILE_ENTRY_SIZE]; + File.Read(entryBuffer, 0, entryBuffer.Length); + Raw = entryBuffer; + + byte[] stringBuffer = new byte[Raw[0x11]]; + File.Read(stringBuffer, 0, stringBuffer.Length); + RelativePath = Encoding.UTF8.GetString(stringBuffer); + } } } diff --git a/src/apphost-extract/apphost-extract/AppHostFileHeader.cs b/src/apphost-extract/apphost-extract/AppHostFileHeader.cs index cb672c3..9047870 100644 --- a/src/apphost-extract/apphost-extract/AppHostFileHeader.cs +++ b/src/apphost-extract/apphost-extract/AppHostFileHeader.cs @@ -14,7 +14,6 @@ namespace apphost_extract private byte[] Raw; - public byte PathLength { get; set; } public string Path { get; set; } public int EmbeddedFilesCount { get; set; } @@ -26,9 +25,8 @@ namespace apphost_extract byte[] headerBuffer = new byte[HEADER_SIZE]; File.Read(headerBuffer, 0, HEADER_SIZE); Raw = headerBuffer; - PathLength = Raw[0xC]; - byte[] stringBuffer = new byte[PathLength]; + byte[] stringBuffer = new byte[Raw[0xC]]; File.Read(stringBuffer, 0, stringBuffer.Length); Path = Encoding.UTF8.GetString(stringBuffer); diff --git a/src/apphost-extract/apphost-extract/AppHostManifest.cs b/src/apphost-extract/apphost-extract/AppHostManifest.cs index 9dff1b5..4b61c29 100644 --- a/src/apphost-extract/apphost-extract/AppHostManifest.cs +++ b/src/apphost-extract/apphost-extract/AppHostManifest.cs @@ -13,7 +13,13 @@ namespace apphost_extract public AppHostManifest(FileStream File, int embeddedFileCount) { + List entries = new List(); + for(int i = 0; i < embeddedFileCount; i++) + { + AppHostFileEntry entry = new AppHostFileEntry(File); + entries.Add(entry); + } } } } diff --git a/src/apphost-extract/apphost-extract/apphost-extract.csproj b/src/apphost-extract/apphost-extract/apphost-extract.csproj index 5b4c330..54ad2a7 100644 --- a/src/apphost-extract/apphost-extract/apphost-extract.csproj +++ b/src/apphost-extract/apphost-extract/apphost-extract.csproj @@ -44,6 +44,7 @@ +