Skip to content

Commit

Permalink
Merge pull request #450 from Megaflan/master
Browse files Browse the repository at this point in the history
FBIN Load plugin
  • Loading branch information
IcySon55 authored May 10, 2018
2 parents 5f170ba + 684a779 commit 5e48d1f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
15 changes: 14 additions & 1 deletion src/archive/archive_atlus/FBIN.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,20 @@ public FBIN(Stream input)
_stream = input;
using (var br = new BinaryReaderX(input, true))
{
// TODO
header = br.ReadStruct<Header>();
var offsets = br.ReadMultiple<int>(header.fileCount);
br.BaseStream.Position = br.BaseStream.Position + 0x0C; //0x0C is the size of the header struct
for (int i = 0; i < header.fileCount - 1; i++)
{
Files.Add(new FbinFileInfo
{
State = ArchiveFileState.Archived,
FileName = "file"+ i + ".bin",
FileData = new SubStream(br.BaseStream, br.BaseStream.Position, offsets[i])
});
br.BaseStream.Position = (br.BaseStream.Position + offsets[i]);
}

}
}

Expand Down
6 changes: 4 additions & 2 deletions src/archive/archive_atlus/FbinSupport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ namespace archive_atlus.FBIN
{
public class FbinFileInfo : ArchiveFileInfo
{
// TODO

}

[StructLayout(LayoutKind.Sequential, Pack = 1)]
public class Header
{
public Magic magic;
// TODO
public int fileCount;
public uint headerSize;
}

}

0 comments on commit 5e48d1f

Please sign in to comment.