Skip to content
This repository was archived by the owner on Aug 13, 2025. It is now read-only.
/ sf3 Public archive

Commit e44cc20

Browse files
committed
Improve the magic file.
1 parent 7b7bf34 commit e44cc20

File tree

1 file changed

+28
-36
lines changed

1 file changed

+28
-36
lines changed

magic

Lines changed: 28 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@
44
# Reference: https://shirakumo.org/docs/sf3
55

66
0 name SF3-archive
7-
>0 lequad x \b, %d files
7+
>0 ulequad x \b, %llu files
88
!:mime application/x.sf3-archive
9-
!:ext ar.sf3/sf3
109

1110
0 name SF3-audio
12-
>0 lelong >1 \b, %dHz
13-
>4 byte >0 \b, %d channels
11+
>0 ulelong >1 \b, %dHz
12+
>4 ubyte >0 \b, %d channels
1413
>5 byte 0x01 \b, A-law
1514
>5 byte 0x02 \b, 16-bit signed PCM
1615
>5 byte 0x04 \b, 32-bit signed PCM
@@ -23,12 +22,11 @@
2322
>5 byte 0x24 \b, single-float PCM
2423
>5 byte 0x28 \b, double-float PCM
2524
!:mime audio/x.sf3
26-
!:ext au.sf3/sf3
2725

2826
0 name SF3-image
29-
>0 lelong >0 \b, %d
30-
>4 lelong >0 \bx%d
31-
>8 lelong >0 \bx%d
27+
>0 ulelong >0 \b, %d
28+
>4 ulelong >0 \bx%d
29+
>8 ulelong >0 \bx%d
3230
>12 byte 0x01 \b, grayscale
3331
>12 byte 0x02 \b, grayscale-alpha
3432
>12 byte 0x03 \b, RGB
@@ -52,65 +50,59 @@
5250
>13 byte 0x24 \b, single-float
5351
>13 byte 0x28 \b, double-float
5452
!:mime image/x.sf3
55-
!:ext img.sf3/sf3
5653

5754
0 name SF3-log
5855
>0 leqdate x \b, from %s
5956
>8 leqdate x \b, to %s
60-
>16 leshort x \b, %d chunks
57+
>16 uleshort x \b, %d chunks
6158
!:mime application/x.sf3-log
62-
!:ext log.sf3/sf3
6359

6460
0 name SF3-model
61+
>(2.l+22) ulelong x \b, %d face indices
62+
# How the heck.
63+
#>>&(&-8.l*4) ulelong x \b, %d vertices
6564
!:mime model/x.sf3
66-
!:ext mod.sf3/sf3
6765

6866
0 name SF3-physics-model
6967
>0 lefloat x \b, %f kg
70-
>40 leshort x \b, %d shapes
68+
>40 uleshort x \b, %d shapes
7169
!:mime model/x.sf3-physics
72-
!:ext phys.sf3/sf3
7370

7471
0 name SF3-table
75-
>0 leshort x \b, %d columns
76-
>10 lequad x \b, %d rows
72+
>0 uleshort x \b, %d columns
73+
>10 ulequad x \b, %llu rows
7774
!:mime application/x.sf3-table
78-
!:ext tab.sf3/sf3
7975

8076
0 name SF3-text
81-
>8 lelong x \b, %d markup options
77+
>8 ulelong x \b, %d markup options
8278
!:mime application/x.sf3-text
83-
!:ext txt.sf3/sf3
8479

8580
0 name SF3-vector-graphic
86-
>0 lelong >0 \b, %d
87-
>4 lelong >0 \bx%d
88-
>8 lelong x \b, %d instructions
81+
>0 ulelong >0 \b, %d
82+
>4 ulelong >0 \bx%d
83+
>8 ulelong x \b, %d instructions
8984
!:mime image/x.sf3-vector
90-
!:ext vec.sf3/sf3
9185

9286
# Generic SF3 Header
93-
0 string \x81SF3\x00\xE0\xD0\x0D\x0A\x0A SF3 raw data
94-
11 lelong x
95-
15 byte 0x00
96-
>10 byte 0x01
87+
0 string \x81SF3\x00\xE0\xD0\x0D\x0A\x0A SF3
88+
>10 byte 0x01 archive
9789
>>16 use SF3-archive
98-
>10 byte 0x02
90+
>10 byte 0x02 audio file
9991
>>16 use SF3-audio
100-
>10 byte 0x03
92+
>10 byte 0x03 image file
10193
>>16 use SF3-image
102-
>10 byte 0x04
94+
>10 byte 0x04 log file
10395
>>16 use SF3-log
104-
>10 byte 0x05
96+
>10 byte 0x05 3D model
10597
>>16 use SF3-model
106-
>10 byte 0x06
98+
>10 byte 0x06 physics model
10799
>>16 use SF3-physics-model
108-
>10 byte 0x07
100+
>10 byte 0x07 table
109101
>>16 use SF3-table
110-
>10 byte 0x08
102+
>10 byte 0x08 text file
111103
>>16 use SF3-text
112-
>10 byte 0x09
104+
>10 byte 0x09 vector graphic
113105
>>16 use SF3-vector-graphic
114-
>10 byte >9 Unknown type (%d)
106+
>10 byte >9 file of unknown type (%d)
115107
!:mime application/x.sf3
116108
!:ext sf3

0 commit comments

Comments
 (0)