View Issue Details

IDProjectCategoryView StatusLast Update
0000308fileGeneralpublic2022-02-14 16:47
Reporteradepasquale Assigned Tochristos  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version5.41 
Fixed in VersionHEAD 
Summary0000308: Fix and improve ARJ file information
DescriptionCurrent file 5.41 has an issue parsing the "original filename" from ARJ archive headers (wrong offset).

I updated the offset, as well as added more information based on open source documentation:
https://fossies.org/linux/unarj/unarj.c
https://www.fileformat.info/format/arj/corion.htm
http://hmelnov.icc.ru/geos/scripts/WWWBinV.dll/ShowR?ARJ.rfh

See the attached patch and hexdump of a sample file header (use xxd -r to restore).

Output before/after applying the patch:
test.arj: ARJ archive data, v11, slash-switched, original name: , os: Unix
test.arj: ARJ archive data, v11, slash-switched, original name: example_m0.arj, OS: Unix
Tagsmagic

Activities

adepasquale

2022-01-18 10:39

reporter  

arj.patch (1,335 bytes)   
diff --git a/magic/Magdir/archive b/magic/Magdir/archive
index d4fd3c92..80f6e8e7 100644
--- a/magic/Magdir/archive
+++ b/magic/Magdir/archive
@@ -931,22 +931,25 @@
 # ARJ archiver (jason@jarthur.Claremont.EDU)
 0	leshort		0xea60		ARJ archive data
 !:mime	application/x-arj
->5	byte		x		\b, v%d,
->8	byte		&0x04		multi-volume,
->8	byte		&0x10		slash-switched,
->8	byte		&0x20		backup,
->34	string		x		original name: %s,
->7	byte		0		os: MS-DOS
->7	byte		1		os: PRIMOS
->7	byte		2		os: Unix
->7	byte		3		os: Amiga
->7	byte		4		os: Macintosh
->7	byte		5		os: OS/2
->7	byte		6		os: Apple ][ GS
->7	byte		7		os: Atari ST
->7	byte		8		os: NeXT
->7	byte		9		os: VAX/VMS
->3	byte		>0		%d]
+>5	byte		x		\b, v%d
+>8	byte		&0x01		\b, password-protected
+#>8	byte		&0x02		\b, secured
+>8	byte		&0x04		\b, multi-volume
+>8	byte		&0x08		\b, file-offset
+>8	byte		&0x10		\b, slash-switched
+>8	byte		&0x20		\b, backup
+>8	byte		&0x40		\b, secured
+>38	string		x		\b, original name: %s
+>7	byte		0		\b, OS: MS-DOS
+>7	byte		1		\b, OS: PRIMOS
+>7	byte		2		\b, OS: Unix
+>7	byte		3		\b, OS: Amiga
+>7	byte		4		\b, OS: Macintosh
+>7	byte		5		\b, OS: OS/2
+>7	byte		6		\b, OS: Apple ][ GS
+>7	byte		7		\b, OS: Atari ST
+>7	byte		8		\b, OS: NeXT
+>7	byte		9		\b, OS: VAX/VMS
 # [JW] idarc says this is also possible
 2	leshort		0xea60		ARJ archive data
 
arj.patch (1,335 bytes)   
test_arj.hex (262 bytes)

christos

2022-02-14 16:47

manager   ~0003694

Committed, thanks!

Issue History

Date Modified Username Field Change
2022-01-18 10:39 adepasquale New Issue
2022-01-18 10:39 adepasquale File Added: arj.patch
2022-01-18 10:39 adepasquale File Added: test_arj.hex
2022-01-18 10:39 adepasquale Tag Attached: magic
2022-02-14 16:47 christos Assigned To => christos
2022-02-14 16:47 christos Status new => assigned
2022-02-14 16:47 christos Status assigned => resolved
2022-02-14 16:47 christos Resolution open => fixed
2022-02-14 16:47 christos Fixed in Version => HEAD
2022-02-14 16:47 christos Note Added: 0003694