home *** CD-ROM | disk | FTP | other *** search
- /* Unpack File for Spot. Or other prog who need it
-
- Created By DarkSpirit 1995
-
-
- |\__/,| (`\ NetMail #1: 2:200/136.17
- _.|o o |_ ) ) NetMail #2: 2:200/113.22
- -(((---(((---------AmigaNet: 39:163/101.1
- E-Mail: Cat@p22.dennis.ct.se
- E-Mail: Cat@p10.kockens.ct.se
- */
- MODULE 'dos/dos'
- OBJECT suf
- type[30]:ARRAY OF CHAR
- ENDOBJECT
- PROC main()
- DEF fh, cmd[10]:ARRAY OF suf,buf,x=0,comand[128]:STRING
- CopyMem('UnZip',cmd[1].type,10)
- CopyMem('LHA x',cmd[2].type,10)
- CopyMem('Arc x',cmd[3].type,10)
- CopyMem('LZX x',cmd[4].type,10)
- CopyMem('ARJ x',cmd[5].type,10)
- CopyMem('ZOO -extract',cmd[6].type,15)
- banner()
- chk(arg)
- fh:=Open(arg,MODE_OLDFILE)
- IF fh=0
- WriteF('Error opening file:\s\n',arg)
- RETURN 1
- ENDIF
- buf:=New(10)
- Read(fh,buf,10)
- Close(fh)
- MOVE.L buf,A0
- CMP.W #"PK",(A0)
- BNE notzip
- x:=1
- notzip:
- CMP.L #"-lh5",2(A0)
- BNE notlha5
- x:=2
- notlha5:
- CMP.L #"-lh0",2(A0)
- BNE notlha
- x:=2
- notlha:
- CMP.W #$1A08,(A0)
- BNE notarc
- x:=3
- notarc:
- CMP.L #$4C5A5800,(A0)
- BNE notlzx
- x:=4
- notlzx:
- IF (chkarj(arg))=0 THEN x:=5
-
- MOVE.L buf,A0
- CMP.L #$5A4F4F20,(A0)
- BNE notzoo
- x:=6
- notzoo:
- IF x=0
- WriteF('Error: Unknown archive type\n')
- RETURN 1
- ENDIF
-
- StringF(comand,'\s "\s"',cmd[x].type,arg)
- Execute(comand,0,0)
-
- ENDPROC 0
-
- PROC chk(name)
- MOVE.L name,A0
- CMP.B #$22,(A0)
- BEQ doit
- RETURN 1
- doit:
- MOVE.L A0,A1
- ADDQ.L #1,A1
- fix:
- MOVE.B (A1)+,(A0)+
- CMP.B #$22,(A1)
- BNE fix
- MOVE.B #0,(A0)
- RETURN 0
- ENDPROC
- PROC banner()
- MOVEM.L D0-D7/A0-A6,-(A7)
- MOVE.L dosbase,A6
- JSR -60(A6)
- MOVE.L D0,D1
- LEA.L ban(PC),A0
- MOVE.L A0,D2
- LEA.L bas(PC),A1
- SUB.L A0,A1
- MOVE.L A1,D3
- JSR -48(A6)
- MOVEM.L (A7)+,D0-D7/A0-A6
- ENDPROC
- PROC chkarj(name)
- UpperStr(name)
- MOVE.L name,A0
- fipu:
- CMP.B #".",(A0)
- BEQ pufound
- CMP.B #0,(A0)+
- BNE fipu
- dsa:
- RETURN 1
- pufound:
- CMP.L #".ARJ",(A0)
- BNE dsa
- ENDPROC 0
-
- ban: CHAR $1b,$5b,'41m',$1b,$5b,'32mLx v1.0 By DarkSpirit 1995',$1b,$5b,'0m',$a,$a,0
- bas: CHAR 0,'$VER: Lx v1.0 (25.03.95)'