File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
src/archive/archive_atlus Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,20 @@ public FBIN(Stream input)
17
17
_stream = input ;
18
18
using ( var br = new BinaryReaderX ( input , true ) )
19
19
{
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
+
21
34
}
22
35
}
23
36
Original file line number Diff line number Diff line change @@ -6,13 +6,15 @@ namespace archive_atlus.FBIN
6
6
{
7
7
public class FbinFileInfo : ArchiveFileInfo
8
8
{
9
- // TODO
9
+
10
10
}
11
11
12
12
[ StructLayout ( LayoutKind . Sequential , Pack = 1 ) ]
13
13
public class Header
14
14
{
15
15
public Magic magic ;
16
- // TODO
16
+ public int fileCount ;
17
+ public uint headerSize ;
17
18
}
19
+
18
20
}
You can’t perform that action at this time.
0 commit comments