Skip to content

Commit 5e48d1f

Browse files
authored
Merge pull request #450 from Megaflan/master
FBIN Load plugin
2 parents 5f170ba + 684a779 commit 5e48d1f

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

src/archive/archive_atlus/FBIN.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,20 @@ public FBIN(Stream input)
1717
_stream = input;
1818
using (var br = new BinaryReaderX(input, true))
1919
{
20-
// TODO
20+
header = br.ReadStruct<Header>();
21+
var offsets = br.ReadMultiple<int>(header.fileCount);
22+
br.BaseStream.Position = br.BaseStream.Position + 0x0C; //0x0C is the size of the header struct
23+
for (int i = 0; i < header.fileCount - 1; i++)
24+
{
25+
Files.Add(new FbinFileInfo
26+
{
27+
State = ArchiveFileState.Archived,
28+
FileName = "file"+ i + ".bin",
29+
FileData = new SubStream(br.BaseStream, br.BaseStream.Position, offsets[i])
30+
});
31+
br.BaseStream.Position = (br.BaseStream.Position + offsets[i]);
32+
}
33+
2134
}
2235
}
2336

src/archive/archive_atlus/FbinSupport.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ namespace archive_atlus.FBIN
66
{
77
public class FbinFileInfo : ArchiveFileInfo
88
{
9-
// TODO
9+
1010
}
1111

1212
[StructLayout(LayoutKind.Sequential, Pack = 1)]
1313
public class Header
1414
{
1515
public Magic magic;
16-
// TODO
16+
public int fileCount;
17+
public uint headerSize;
1718
}
19+
1820
}

0 commit comments

Comments
 (0)