xdms-1.3.2/0000700000175000017510000000000010447526066011533 5ustar tarDebian-NMxdms-1.3.2/Makefile.in0000600000175000017510000000064710447526026013605 0ustar tarDebian-NM xdms: $(MAKE) -C src clean: $(MAKE) -C src clean install: xdms mkdir -p {PREFIX}/bin {PREFIX}/share/doc/xdms-{VERSION} {PREFIX}/share/man/man1 install src/xdms {PREFIX}/bin/ install xdms.txt COPYING ChangeLog.txt {PREFIX}/share/doc/xdms-{VERSION}/ chmod og+rx {PREFIX}/bin {PREFIX}/bin/xdms chmod -R og+rX {PREFIX}/share/doc/xdms-{VERSION} gzip < xdms.1 > xdms.1.gz install xdms.1.gz {PREFIX}/share/man/man1/ xdms-1.3.2/COPYING0000600000175000017510000000006610447526026012566 0ustar tarDebian-NM xdms is licensed under PUBLIC DOMAIN. Read xdms.txt. xdms-1.3.2/amiga-bin/0000700000175000017510000000000010447526070013352 5ustar tarDebian-NMxdms-1.3.2/amiga-bin/readdisk0000700000175000017510000003210410447526026015067 0ustar tarDebian-NM fp H~$H$I,xGr <,`&Q)O)N&n +g @ (4` :")ALdT ,L)@"<N:Jg)@)@ЬL" n$m)@)AܒA N$`.@)O)OA  n$mN$Bp"<0N&nCpN)@fpd`)k Jg~ k"h r)IЁ^@)@H@@"<N:LJfp/g: @)@ Sԁ SQ S"  Q"/`JA\NA\N)@/$@ *$g,l @"(N)@ "N l/Hl h$)hNJf Np` /$l%)l,xY n$m AN$`.l ,g @NN,x n$mJg AYN$.J ,g "l,xN.Jg ,l", gN,xN|"lN`,x ,g"lN."lNb L~Nudos.libraryeH!./*op5x"HABAp5x$HBBB҂p5x$҂p5xҀ L Nu eQOH4*o(Hx,a&@A prQA Cp-./ /aHxD/ a^'@..ab'@Hx/ aD,O*<4$kJg// a&PO"ҁA/H o(<`(C J `SdĞYSfHx/ aPO/@g"ҁA*H*<4Hx/ a,PO fxHyHyaa2PO`^ L,PONu eQOH4*o$Hx,ar&@A prQA Cp-./ /aBBBHx / a&.OJf~HpHgHy:HyaZPO|d rЁ// a*POJg ЀAHx//H aPOVg[f0//a.$@XO$'J`0//aXO @ '@/@`HydHyaaPOHx//ah*PO`|R`\ L,PONu  e bH4*oA Hx/aPOJj,pg"A /HyHyaXHxaOA /aXOJj"A /HyHya&HxaO&m g/ ahXO K&P`$m gPA Hx/a.POJjHyHyaHxahO /*/*/a6.a,O J$P`HyaXOL,Nu e VH4./*opmpoHyHya`HxaO HyB/-a$@JPOfHyFHya.HxaO / /< HxHyaHxHyXHyaOJgHy^HyaHxarO Hya&@XO Wf./-a2XOJj /-HytHyaHxa0O/ aXOpL,NuNq/~XH`J9fJf "yH QN.XH yHJf .NuNqYOA.g yNJgp @pXONuYOA .g yNXONuNqH*y `pЭ"M,x&UN.*K fB LhNu"o o f SNu / oNU"Or N A0Jf fBN]Nu / oNU"O"AA0f fBN]Nu0123456789abcdef / oQO"O2Af fBPONu o"oH0 $Hr & +g -fvRH0m n$҂ҁJfҀ`⒀`" SL Nu oH",yN.fN|#a#p`",yNpL@Nu oYOH!/H"t,yN.fp##p`pAa*@Jf"p #pg#",yNp`"$ ,yNJf"p# Ba F#"Np`N -j(p# Ma #",yNp` # ",yN"N Ma pL`XONuNq o/ *H-f6 9Pa8+@+@f p #p`+yPpB Bp*_Nu o/ "H&I`"AEp0g rp `rJf &_NuHp#0*y$`$pUf -g"-A mad*U f*yX~`4,-Jgf0H y(N`g"-,yNRG*U fL`NuNN /"/ oYOH36.$/@ *Ha a \&@Jfp#p`+f#p#p`+gHx raXO+g"p Ma $@Jf"+$ &,yN"Rgb `z,& $ "+,yNRgDAf"+$vN*JRg,A"p a L$@ f"+$ &,yNRg `,yN|#a#pLlXONu /"/ oQOH2&,/@/Ha a 2*@Jfp#p`-f#p#p`B&o"-$ ,yN,RfN|#a0#p`fJg-f `V Sr 3f, B"p a J @Jg K` r gRe&o,"p Ka  @Jf ` LhLPONuNqNN /"//o YOH3,/ .$/@av a$*@Jf p#p``B&S"-$,yN"RfN|#p#p`* g Sg Sg ` ` Ї`"-t&,yNL`XONu o //Hx/aO NuNqN N /H.a ar*@Jfp`Nprfp+@`:Jfp`0"-,yN-g m aX - g @ahBpL`NuNqYOH/6*o,~|'A|#(a>&yX$Kr`$KR&R gJf f#pLlXONuPH06Cp,xN*@Jfpa yr( C @SdB7,MA#pp"t}Ԃv(CxGNpaBLl PNu** Stack Overflow **EXITintuition.libraryJjDJj Da DNuaDDNuJj DaDNu/HA4f"H@HAHB4g0H@40HB2$Nu/v AdQC AdYC A@dUCJAkSC4HBBBHC604HAdSCЁr2HCH@A&$NuHp$g JfB`&HBHBBBւHAH@B@ЃLNu 9@.@NV // I/aXO(_NuH*oB, @Rr gr gr ggPr"f(`r*fRJgRr"gJfJg R`Rgr g r gr fJgR,` 9,gR,xrHAN:#4fpa"o y4 @Rr gr gr ggr"fXR&I X`8r*f.RpJgrEg r g `B`P` @R @r"gJfJgRB` @Rgr g r gr fJgB`d 9,f y` y4#0adLh`4/ 9,gJ4gR"y4,xN.,_NuNq /TH76 y.|(pOo,C'  @SdB7h',xN @J$@gT * @*(8f**Jg>A"$v ,yN&R h'A'"$,yNp#0paCp,xN*@Jfp#0paA'#p"t}ԂvB8+B:*E؅XXJjjD7Dk*43HBB7Hש&)n f>Jg8 9 @f# ` hf!i ),xN.LL2V nn&9 g"Cn4"9 f(EJRkB8*D匰oB8*kEH`&)gf"C`GBg<,Yf `0JjjF*7F7E5EzJFk42HBB5H&)#C XLL|Nu*j 9("9,xN:Jf # `"@E#y # #D#y &g(Yg$#CGX5|5E7EC7C`B5|D5D XLL|NuYO 9$gr//@  oNXOACapX`l Abnormal program termination Nq /H.*y` mN*U f L `" / o/ *H"RC R  mrAA "ma B*_Nu / *oB B/MHo//AC a PO / grAA"oa -f-gp` /*_ Nu o"oH&I*H` Ka Rfp` pJfpL(Nu o /"/ "oYOH4.,J&I$HgJfp`N "a,zp0gp`4p~Fg(p3Sg4p\Fr@ҁf+gp`Bp`8f yg Ma.p fJg ma B -aLRgJgp @pL NuNq o"o/o H4$o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Hr f+g Ka8 + lJnJo Ka +" oa؀ "aLXONuNq / oYOH.|@rAҁ*H­f p`Rr3­UgZrLF­p@ЀfB +m`8-gp`rnF­pnFg Map+@ m+H - l: mR R -gr f Ma>,Jg `r `-g.B -rAa,Rf`r Sgl`dJf MaBJg p`Xp+@ +m - m Ma, mR R -gr f Ma,Jg `r L XONuNqH 6A\#$#8#~<#P@#`PB`#@XBLB\Bl#D#T#d,yNJfrJg$ yJ g"( $<N#H`қA"HJfS A" p/f&KJg"y i$*h MJfS҈ y h$eA"HJfS҉ a&@Jfp`P KCab$@ g J"MaT$@ y h$e JCa8" $<,yN#H Ka&JHfA"N#HG 9H,x$@N @$<#p!jA",yN#XfHA"N#X`6N#HN$<#XA~"N#hfAf"N#hVTpJ\f <"A@BBx#tr#r###pLlNuOutputNIL:*/,xN @!yp,_NuNq% L N&**))))))^)L)z)r)&)*j*)((((+8******t*X*<*4*,**)@)(((((((((((+ ++***((%%%h%B%8%&^"^@^VrJ~xh^2@nhbPDxnfRL<h`LrdLZT"~4J<    ( x f &  V B & v < &  D . T J ` 8~R h\& fDisk structure corrupted. Use DISKDOCTOR to correct it. Warning: Hash table with != 72 entries. Disk structure corrupted. Use DISKDOCTOR to correct it. Could not create directory "%s". Giving up. Could not enter directory "%s". Giving up. Could not create file. Giving up. /Usage: readdisk [] rbcan't open file DOSNot an OFS DOS disk. Couldn't change to %s. Giving up. px( b ((((( H  d/auto/close/waitcon:10/10/320/80/   ~  ~\Hxdms-1.3.2/amiga-bin/xdms0000700000175000017510000007552410447526026014271 0ustar tarDebian-NM\H~$H$I,xGlr <`&Q)O\ )Nt&n +g @ (4` :")A\dT ,)@"<N:Jg)@)@\Ь" n$m)@)AA N$`.@)O)OA \ n$mN$B\4p"<0N&nCpN)@pfpd`)k\0Jg~ k"h r)I\$Ё^@)@|H@@"<N:LJfp/g: @)@x Sԁ SQ S"  Q"/`JA\NA\N)@\4/$@ *$g,lp @"(N)@\0"N l\4/Hll h$)h\$N8DJf NC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POo$gp `JobgpP@gp0// aPOpoZfpP@d Dcp0r2/(vt/)///// / avO:gJobgp`X0`Rp0// aPO2/*@gJobgp`0p `*p0//L/Hx/ a)Or2gp `po^fHlHlHaHlHaO poZfv Ffpp0r2t/(v/)///// / aO:gJobgp`0`p0// aHPO2/*@gJobgp`vp `rp0// aPOpoZfZpP@fTp0r2t/(v/)///// / a>OJ@f*p0// aPO2/*@gp `p0// a>POpL, Nu \e@H/3///&&o *op d@0;N :p0 @Sd`|p0// / aO J@gdp`jp0// / aO J@gp`Np0// / aRO J@gp`2p0 @Sd`p0// / avO J@gp`p0// / a O J@gp`p0 @Sd`p0// / aO J@gp`p0// / aO J@gp`p0 @Sd` [f&rp0/// / aOJ@g*p`drp0/// / a̲OJ@gp`>g,p0// / a>O J@gp`p0 @Sd`p` fa&pL(Nu\eZH!>/"o ` IR2,[tIp0Ђ9@[ SGJ@fLNu Q\eH4*o&M$Mp0/`p fB/ HlaPOKReL,NuNq\eH00/)o\ )o\2/t9B[JRAv9|[Bl\Bl\ 9@[9@\9A[9B\9C[9C[a(0,\ fa0,\ f0,\l[gp @pL Nu\eTH!~Jl\ gp`R0,[l[f`^p0,[r l\ 4,[0 fFC\>0,\Q0l[c$9|\ p` HGBGHG ЀRG2,[ l\1l\e0,[`Rl[p0,[2,[Hm9|[Rl[0,\H9@\C[RQ0Yd aDa@`r Ac 9|\ p`>,\Rl\0,[H@B@H@"ҁSp0m 9|\ p`haHGBGHG"ҁA1aHGBGHG"ҁA10,\l[e 9|\ p`(2,[4,[AfH@B@H@"ҁRl\ l\1Sl[0LNuNq\e / oE\$BB\C)I\p)@\E)J\rက)@\|\$_Nu\e H./ o |` pr2Ҁ, SJf0H@B@H@LNu\e \H#./"o|`(0H@rt4rFā"ҁA@40B, SJf0LNuNqJanFebMarAprMayJunJulAugSepOctNovDecSunMonTueWedThuFriSat/~X`J,\TfJf "l QN.X lJf|\T .NuNqYOAD.g y@NJgp @pXONuYOAL.g y@NXONuNqH*o MJfS.`A&a#pJf L NuNqHK0~`p%fj o,R,prdgB8+B:*E؅XXJjjD7Dk*43HBB7Hש&)\n f:Jg4 ,\X @f )i\X` hf!i ),xN.LL2V n\n&,\Xg"Cn2",\< f(EJRkB8*D匰oB8*kEH`&)gf"C`GBg<,Yf `0JjjF*7F7E5EzJFk42HBB5H&)#C XLL|Nu*\j ,\(",\<,xN:Jf )| \8`"@E#l\X)I\X#D#l\< &g(Yg$#CGX5|5E7EC7C`B5|D5D XLL|Nu oH7*H&x~ fp)@\8B\,p`,lpN,fA~"$<N,~ k$e,/|! NG$&&"&BA " $N*`"" &tN"JfN|)@\,r)A\8* @*Jg"N LhNuNIL:Nq oH76,x*HNr"@ i#A/@0/H,A"t,lpNJg"N." N,gzڅpAar$@Jg"$ NJg**| Ba"N" $<N,gZ Ra8&@Jg<"$ &NJo*B3p BadJg$ @B"XlR Ba&@` B`p )@\8",lpN"N"N o0!o, LlNuENV: /H.*l` mN*U f L `TNq / oCR QRNuQO o B/HHo//ACa V o POB PONuNq / o/ *H"RC R  mrAA "ma B*_Nu / *oB B/MHo//AC a PO / grAA"oa -f-gp` /*_ Nu/ *HC"R R  mAC&ra B*_NuBBHo//ACa VPO /grAAC&a Fp0>gp @ Nu o /"/ "oYOH4.,J&I$HgJfp`J "az,zp0gp`0p~Fg$p3Sg4p\Fr@ҁf+gp`Bp`\f l\aJf.+f& Ka8Jgp`K URSSRJgJnJo+fo4'k J +"a"Rf` g+mB p0f-gpp`&p`"*l\\~`Jg MaDJg~*U f L NuNq oH*H~ g -fp`>g Ma.p fJg maB -a$RgJgp @pL NuNq o"o/o H4$o &I*H~,,zJg Jaxp+r+g"r6gSg`"|@r++WDHH*` zpa+f|prag rg[g$`6JVrA~@`&JVr`JVrAA`p`|/,// a(RO fp`bJg`0prag rg[g`Hx ra~XO`~ @~fK**%D%H%H %H* L,NuNq o"oYOH4/I &l\\*H`$K&R gJf f*p"a&@Jfp`(J\\f)K\\ @$ Kpr!Q/ "o MarXOL,XONu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rr3­UgZrLF­p@ЀfB +m`8-gp`rnF­pnFg Map+@ m+H - l: mR R -gr f Ma^,Jg `r `-g.B -rAa,Rf`r Sgl`dJf ManJg p`Xp+@ +m - m Ma, mR R -gr f Ma,Jg `r L XONuNq oYOH.$,<z`:3SS rf" rdaJf rdaJfQSJj^Jk "<Qa( "<Qa /A"<a)@] /"<an /Ar*_XONuNqH 6A)H\\)H\A&)H\A]L)H])Ad)@`pLlNuOutputNIL:*/,xN @!l]l,_NuNq\:::D:": Unknown option ! Unknown option ! Unknown command ! stdin.dms.dmsstdoutstdout:\/:\/:\/.dms.adz.adf.adz.adfstdin.adzstdin.adfstdout:\/:\/.dms.adz.adf.adz.adfstdin.adzstdin.adfUnpacking file %s to Unpacking data from stdin to %s stdout Unpacking file %s Unpacking data from stdin Testing file %s Testing data from stdin Showing FILEID.DIZ in %s : Showing FILEID.DIZ in stdin : Showing Banner in %s : Showing Banner in stdin : Temporary fileRepacking unpacked data with gzip gzip -cfqn "%s" >"%s"gzip -cfqn "%s"Extracting files from unpacked data with readdisk readdisk "%s" "%s"readdisk "%s"File %s was correctly unpacked to Data from stdin was correctly unpacked to %s stdout File %s was correctly converted to Data from stdin was correctly converted to %s stdout The files were correctly extracted from %s The files were correctly extracted from stdin File %s is ok Data from stdin is ok xDMS v1.3 - Portable DMS archive unpacker - Public Domain Written by Andre Rodrigues de la Rocha Usage: xdms [options] { [+output]} Commands : t : Test DMS archives u : Unpack DMS archives to disk images z : Unpack to disk images and compress it with gzip x : Extract files inside DMS archives using readdisk v : View DMS archives information f : View full information d : Show attached FILEID.DIZ b : Show attached Banner Options : -q : Quiet -v : Verbose -d : Set destination directory -p : Decrypt encrypted archives using password stdinstdoutNot enough memory for buffers ! Can't open %s for reading ! Can't open %s for writing ! File %s is not a DMS archive ! Error reading file %s : unexpected end of file ! Error in file %s : header CRC error ! Error in file %s : track header not found ! Error in file %s : track too big ! Error in file %s : track header CRC error ! Error in file %s : track data CRC error ! Error in file %s : checksum error after unpacking ! This file seems ok, but the unpacking failed. This can be caused by a bug in xDMS. Please contact the author Error : can't write to file %s ! Error in file %s : error unpacking ! This file seems ok, but the unpacking failed. This can be caused by a bug in xDMS. Please contact the author Error in file %s : unknown compression mode used ! Can't process file %s : file is encrypted ! Error unpacking file %s . The password is probably wrong. Error in file %s : this file is not really a compressed disk image, but an FMS archive ! Can't convert file %s : gzip failed ! Can't extract files from %s : readdisk failed ! Error while processing file %s : internal error ! This is a bug in xDMS Please contact the author   !!""##$$%%&&''(())**++,,--..//0123456789:;<=>?NOCOMPSIMPLEQUICK MEDIUMDEEP HEAVY1HEAVY2rb File : %s Data from stdin Created with DMS version %d.%02d Registered Evaluation Creation date : %s Lowest track in archive : %d Highest track in archive : %d Packed data size : %lu Unpacked data size : %lu Disk type of archive : AmigaOS 1.0 OFS AmigaOS 2.0 FFS AmigaOS 3.0 OFS / International AmigaOS 3.0 FFS / International AmigaOS 3.0 OFS / Dir Cache AmigaOS 3.0 FFS / Dir Cache FMS Amiga System File Unknown Compression mode used : Unknown ! %s General info : NoneNoZero Encrypted Appends Banner HD MS-DOS DMS_DEV_Fixed FILEID.DIZ Info Header CRC : %04X Track Plength Ulength Cmode USUM HCRC DCRC Cflag ------ ------- ------- ------ ---- ---- ---- ----- wb FileID Banner FakeBB %2d %5d %5d %s %04X %04X %04X %0d #%s ???@AAā@ A΁@ ˁ @ AAځ@߁@AՁ@AAЁ@01A32@67@54A<=@?>A:;A98@()@+*A./A-,@$%A'&@"#@! A`aAcb@fg@edAlm@onAjkAih@xy@{zA~A}|@tuAwv@rs@qpAPQ@SRAVWAUT@\]A_^@Z[@YXAHIAKJ@NO@MLADE@GFABCAA@@9a=(;<G$T`CST9999999999999999999 ((((( H @ D~DHJ@HfHp\/auto/close/waitcon:10/10/320/80/   &HtL8$|xtTPLD@&d(xdms-1.3.2/ChangeLog.txt0000600000175000017510000000272110447526026014123 0ustar tarDebian-NMDate format is YYYYMMDD History: -------- Version 1.0 : 1998.02.17 First release (Roche) Version 1.1 : 1998.02.18 Reading/writing to stdin/stdout under MS-DOS didn't work correctly. Fixed. (Roche) Version 1.2 : 1998.03.01 Corrected a small and harmless bug. When using the z command, the temporary file name was saved in the gzip compressed file. So if someone tried to unpack it with gzip with the -N option, gzip would generate a file with a very strange name. Fixed. (Roche) Version 1.3 : 1999.03.24 Fixed a major bug in the decompression functions that caused complete failure with some DMS files, mostly generated by old versions of DMS. Made some other minor changes. Changed the Makefile to strip debug information from the executable. (Roche) Version 1.3.1 : 2004.09.02 Moved to C99 type definitions (#include ). Replaced tmpnam() with mkstemp(). Fixed print formatters. Fixed ambiguous C language constructs. Added a simple configure script for consistent compilation and installation. (Heikki Orsila ) No Version : 2004-09-10 Fixed file permissions for documentation directory. (Heikki Orsila ) Version 1.3.2: 2006-06-25 Added -f option to override errors in unpacked data. It can be useful for desperate data salvation. Please send me corrupted dms images for further analysis to improve xdms. (Heikki Orsila ) xdms-1.3.2/configure0000700000175000017510000000271310447526026013441 0ustar tarDebian-NM#!/bin/sh VERSION="1.3.2" if test -n "$CC"; then CC="$CC" echo "Forcing compiler to be $CC" else CC="gcc" fi ARCHFLAGS="" if test -n "$CFLAGS"; then ARCHFLAGS="$ARCHFLAGS $CFLAGS" echo "Adding $ARCHFLAGS to ARCHFLAGS" fi ARCHLIBS="" if test -n "$LDFLAGS"; then ARCHLIBS="$ARCHLIBS $LDFLAGS" echo "Adding $ARCHLIBS to ARCHLIBS" fi prefix=/usr/local for opt in "$@" ; do case $opt in --prefix=*) prefix=`echo $opt | sed -n 's/--prefix=\(.*\)/\1/p'` ;; --package-prefix=*) packageprefix=`echo $opt | sed -n 's/--package-prefix=\(.*\)/\1/p'` ;; *) echo "configure parameter error" echo "" echo "valid options are:" echo "--prefix dir install pipemeter to prefix 'dir'" echo "--package-prefix dest pretend to install to the prefix," echo " but copy files to 'dest/prefix' on make install" echo "Setting environment variables CFLAGS and LDFLAGS lets you add" echo "compile time options for your architecture. CC variable choose the" echo "compiler." exit ;; esac done if test ! -z "$packageprefix" ; then prefix="$packageprefix/$prefix" fi sed -e "s|{PREFIX}|$prefix|g" -e "s|{VERSION}|$VERSION|g" \ < Makefile.in > Makefile echo "Would install xdms binary to directory $prefix/bin." echo "" echo "Configure succesful." sed -e "s|{CC}|$CC|" -e "s|{ARCHFLAGS}|$ARCHFLAGS|" \ -e "s|{ARCHLIBS}|$ARCHLIBS|" -e "s|{VERSION}|$VERSION|" \ < src/Makefile.in > src/Makefile xdms-1.3.2/xdms.txt0000600000175000017510000003132010447526026013244 0ustar tarDebian-NMxDMS - extracting DMS disk image files -------------------------------------- Introduction: ------------- Some time ago I started using UAE and Fellow Amiga emulators in the PC, while still using my Amiga. Both emulators are very nice, and I started testing some of my old games and demos with it. But a thing annoyed me. I have some CDs with demos and other software, with hundreds of disk images compressed with DMS. DMS was always the Amiga 'de facto' standard for storing copies of non-dos disks, as used by most games and demos. But the emulators required the Amiga software to be in uncompressed disk image format (now known as .ADF) or disk images compressed with gzip (ADZ). To use my DMS archives in the emulators I had to uncompress them with DMS inside the emulation, saving it as an uncompressed disk image in the PC hard disk. It was very boring, and also a waste of time and hard disk space, since I could not leave the files into the CDs. I thought a much better solution would be to add direct support for DMS files in the emulators itselves, in the same way as they support gzip compressed images. But as DMS uses a proprietary format, I thought DMS support in the near future would be unlikely. So I decided to do something myself and began to study the inner workings of DMS. After some days of hard work, I wrote a portable DMS unpacker, xDMS. xDMS is more useful for users of Amiga emulators, but can also be useful for actual Amiga users too. xDMS Features: -------------- Supports decompression of files compressed using all known DMS compression modes, including old and obsolete ones, and also encrypted files, for 100% compatibility. Can test DMS files integrity, view file informations and show attached Banners and FILEID.DIZ . Can generate standard disk images and compressed disk images, using gzip, if you want to store your files in ADF or ADZ formats. Can extract the files contained inside the DMS archives, if the compressed disk is an AmigaDOS disk, using readdisk made by Bernd Schmidt. Can process multiple files in batch with a single command, and also use stdin and stdout for input and output of data. Installation: ------------ This archive contains xDMS in binary executable format for AmigaOS, MS-DOS and Linux/Intel/ELF, and also its source code. If the system you use is one of these, you can just copy the binary file to a directory in your path. If you use another system, you will need to compile xDMS yourself. xDMS was written in ANSI C and should work with most ANSI C or C++ compilers and platforms with minor or no changes. It was tested under Linux with GCC, MS-DOS with DJGPP and Amiga with SAS/C and worked well, without warnings. To compile it with GCC or DJGPP you can just use make with the supplied Makefile. For other compilers you may have to modify it slightly. A smakefile for SAS/C is also supplied. After a successful compilation you can install the generated executable somewhere in your path. You also need to install gzip and readdisk if you want to be able to create gzip compressed disk images and extract files from DMS. gzip is available in most public domain software libraries. Readdisk is supplied with UAE. You probably already have both. Usage: ------ xDMS is a shell utility program. When executed without arguments, it shows an usage screen. The template of xDMS is the following: xdms [options] { [+output]} Arguments inside [] are optional. Arguments inside <> are required. Arguments inside {} can be used one or several times. A command is indicated by a letter and can be one of the following: t : Test DMS archives u : Unpack DMS archives to disk images z : Unpack to disk images and compress it with gzip x : Extract files inside DMS archives using readdisk v : View DMS archives information f : View full information d : Show attached FILEID.DIZ b : Show attached Banner If the supplied input DMS file name doesn't have a .DMS or .dms extension, a default .dms will be appended to it. The output argument is optional and specifies a file name or a directory for each unpacked file. If the output filename is not supplied, it is generated from the input filename. If the generated file is a standard disk image it will have the .adf extension. If it is a compressed image the extension will be .adz . If you supply an output file name, no extension will be added. By default, files are unpacked to the current directory, unless you specify another directory with the output file name or use the -d option. Commands z and x respectively need gzip and readdisk instaled in the current path, or it will fail. When extracting files with x option, xDMS will call readdisk and it will reconstruct the tree of files and directories contained inside the DMS compressed disk image, starting in a directory with the same name as the volume name of the disk in the DMS file. This command can fail if xDMS can't execute readdisk, or if the dms compressed disk is not an AmigaDOS disk. The current version of readdisk supplied with UAE only supports old OFS Kickstart 1.x compatible disks, reporting any of the newer formats introduced with AmigaOS 2.0 or newer as non-dos disks, while they actualy are. The v commands show some information contained in DMS files, as the version of DMS that created it, the type of the disk, date of creation, number of tracks, etc. The f command also shows additional tracks informations. The b command shows the banner, if the file contains one. A banner is a text that is displayed when DMS unpacks a file and usually contains informations about the group/BBS/person that made it. The f command shows the FILEID.DIZ, if found in the DMS. It is a text that identifies what the DMS file contains. You can also supply as input filename stdin and/or +stdout as output. in this case xDMS will read the data from the standard input and/or send it to the standard output. You can supply multiple input and optional output files and use wild cards. When using wildcards, the +output argument will affect only the last file name expanded from the wildcard. To supply a global destination directory you must use the -d option. All commands and options are not case sensitive. You can also supply one or more (or none) of the following options: -f : Override errors (to salvage broken data tracks) -q : Quiet -v : Verbose -d : Set destination directory -p : Decrypt encrypted archives using password When more than one option is supplied they must be separated. You can't use something like -qd dir . The quiet option suppresses all messages usually emited by xDMS, including error messages. It is mostly to be used when xDMS is called from inside emulators or some type of front-end. The program that calls xDMS can verify if the operation was successful checking the return code of xDMS. It will be zero if the operation was successful or non-zero if it failed for one or more files. The verbose option makes xDMS display more messages than it usually does, including a progress indicator when unpacking files. This indicator is only useful if you have a slow computer. The -d option specifies a global destination directory. This directory name is inserted before the name of any output file or output directory supplied with +output in the command line. The -p option uses a password to decrypt the dms files if they are encrypted. DMS uses a very lame encryption algorithm that could be easyly cracked. In fact, if the file is encrypted, and contains a banner, you can unpack it with any password. Some examples: xdms u foo.dms This will unpack the file foo.dms in the current directory and save it as foo.adf, also in the current directory. xdms -v -d /tmp/tst u foo +bar.dsk This will unpack the file foo.dms in the current directory and save it as /tmp/tst/bar.dsk . Aditional messages and a progress indicator will be displayed. xdms f ram:Hardwired1.dms (in the Amiga or inside Amiga emu) This will show informations about the file Hardwired1.dms in Amiga's Ram Disk, including tracks information. xdms -p treva u tst1 tst2 +tstdir/ttt tst3.DMS +stdout >tora This will (try to) unpack the files tst1.dms, tst2.dms and tst3.DMS in the current directory. If any of them is encrypted xDMS will try to decrypt it using the password "treva". tst1.dms will be unpacked as tst1.adf, tst2.dms as tstdir/ttt and tst3.DMS will be unpacked to stdout that is redirected to file tora. xdms -d /home/apele/uae/demos z /mnt/cdrom/*.dms (under Linux) xdms -d c:\emul\fellow\demos z f:\*.dms (under MS-DOS) This will unpack all files with the dms extension in the root directory of a CDROM disk, pack it again using gzip and save it in another directory. The generated files will have the .adz extension. xdms -q x tst This will (try to) extract the files contained inside the tst.dms file. The files and directories will be extracted to a directory with a name equal to the volume name of the disk contained in the dms file. No messages will be displayed. xdms -d stdout u *.dms >bigfile This will unpack all the dms files in the current directory and save them all to a single file. xdms -d /home u apele +apele/yourfile.adf trevor +trevor/yourfile.adf This will unpack the file apele.dms in the current directory and save it as /home/apele/yourfile.adf . Will also unpack the file trevor.dms as /home/trevor/yourfile.adf . cat tst.dms | xdms u stdin +stdout | strings | more This will display the ascii strings inside the unpacked dms file. In this case, xDMS is used as a filter. Known problems: --------------- If you try to extract the files (using the x command) of a DMS archive that contains a disk in one of the disk formats introduced with AmigaOS version 2 or newer, it will fail. Also, if you try to extract the files under MS-DOS it will almost always fail. It's not a problem in xDMS. It is a problem in the current version of readdisk. It only suports OFS disks. Another problem of readdisk is that it fails when executed under MS-DOS and the DMS archive contains files with names invalid to MS-DOS rules. If your Amiga disk compressed in the DMS archive contains a file named as Amazing_Amiga.txt.info, it will fail. It works under Unix. Under MS-DOS readdisk also changes the current working directory after its execution, if you specify an output directory to it. This can cause some problems too. xDMS doesn't perform internal expansion of wildcards, but expects the shell (or the compiler) to do it. It is the usual under unix. But if you use it in a system where the shell does not perform wildcard expansion and your compiler also does not generate code to perform it, then wildcards will not work. This is the case, for example when using xDMS in the Amiga, under the standard Amiga Shell, when compiled with SAS/C. I think Amiga GCC adds wildcard expansion to the program it compiles. The same applies to xDMS compiled with compilers like TurboC under MS-DOS. DJGPP for MSDOS generate code to expand wildcards. Acknowledgements: ----------------- xDMS uses source code fragments or informations from the following public domain or freeware programs: Unix LHA by Masaru Oki : xDMS Heavy mode decrunch functions are based in lha static lzh functions. DMS used parts of LHA and LZHUF in the first place. LZHUF by Haruyasu Yoshizaki : xDMS Deep mode decrunch functions are based in LZHUF. testdms by Bjorn Stenberg : I got some initial information about the DMS headers with testdms, and also the CRC calculation function. xDMS also calls, if available, gzip made by Jean-loup Gailly / Free Software Foundation, and readdisk made by Bernd Schmidt Copyright: ---------- xDMS is released as public domain software. You can spread it, modify it and use it in any way you like. You can do anything with it without even asking me first. But I would like to know if you do something cool with it. How to contact the author: -------------------------- If you have some problem, or have found a bug in xDMS, you can contact me by e-mail. But first make sure you have read all this documentation. The new maintainer: Heikki Orsila heikki.orsila@iki.fi The old maintainer: Andre' Rodrigues de la Rocha adlroc@usa.net xdms-1.3.2/gentoo/0000700000175000017510000000000010447526070013021 5ustar tarDebian-NMxdms-1.3.2/gentoo/xdms-1.3.1.ebuild0000600000175000017510000000127410447526026015627 0ustar tarDebian-NM# Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /home/cvs/uade-cvsroot/xdms/gentoo/xdms-1.3.1.ebuild,v 1.1 2004/09/11 14:46:43 shd Exp $ inherit eutils DESCRIPTION="xDMS - Amiga DMS disk image decompressor" HOMEPAGE="http://freshmeat.net/projects/xdms" SRC_URI="http://ee.tut.fi/~heikki/xdms/${P}.tar.gz" LICENSE="public-domain" SLOT="0" KEYWORDS="~amd64 ~x86 ~ppc" DEPEND="virtual/libc" src_compile() { cd ${S} ./configure --prefix=/usr --package-prefix="${D}" \ || die "configure failed" emake || die "emake failed" } src_install() { make install || die "make install failed" dodoc COPYING xdms.txt ChangeLog.txt } xdms-1.3.2/src/0000700000175000017510000000000010447526070012315 5ustar tarDebian-NMxdms-1.3.2/src/Makefile.in0000600000175000017510000000202610447526026014365 0ustar tarDebian-NM # xDMS Makefile # If you use another compiler change the following line: CC = {CC} OBJS= u_heavy.o xdms.o u_deep.o u_init.o u_quick.o u_medium.o u_rle.o \ tables.o pfile.o maketbl.o getbits.o crc_csum.o CFLAGS = -O2 -Wall {ARCHFLAGS} -DVERSION=\"{VERSION}\" LFLAGS = {ARCHLIBS} .SUFFIXES: .c .o .c.o: $(CC) $(CFLAGS) -c $< xdms: $(OBJS) $(CC) $(LFLAGS) $(OBJS) -o $@ getbits.o: getbits.c cdata.h getbits.h tables.o: tables.c cdata.h maketbl.o: maketbl.c cdata.h maketbl.h crc_csum.o: crc_csum.c cdata.h crc_csum.h u_rle.o: u_rle.c cdata.h u_rle.h u_quick.o: u_quick.c cdata.h u_quick.h getbits.h u_medium.o: u_medium.c cdata.h u_medium.h getbits.h tables.h cdata.h u_deep.o: u_deep.c cdata.h u_deep.h getbits.h u_heavy.o: u_heavy.c cdata.h u_heavy.h getbits.h maketbl.h u_init.o: u_init.c cdata.h u_init.h u_quick.h u_medium.h u_deep.h u_heavy.h xdms.o: xdms.c cdata.h pfile.h crc_csum.h pfile.o: pfile.c cdata.h u_rle.h u_quick.h u_medium.h u_deep.h \ u_heavy.h u_init.h crc_csum.h pfile.h clean: rm -f *.o xdms xdms-1.3.2/src/cdata.h0000600000175000017510000000216710447526026013553 0ustar tarDebian-NM /* * xDMS v1.3 - Portable DMS archive unpacker - Public Domain * Written by Andre Rodrigues de la Rocha * * Main types of variables used in xDMS, some implementation * dependant features and other global stuff */ #include #ifndef UCHAR #define UCHAR uint8_t #endif #ifndef USHORT #define USHORT uint16_t #endif #ifndef SHORT #define SHORT int16_t #endif #ifndef ULONG #define ULONG uint32_t #endif #ifndef INLINE #ifdef __cplusplus #define INLINE inline #else #ifdef __GNUC__ #define INLINE inline #else #ifdef __SASC #define INLINE __inline #else #define INLINE static #endif #endif #endif #endif #ifndef UNDER_DOS #ifdef __MSDOS__ #define UNDER_DOS #else #ifdef __MSDOS #define UNDER_DOS #else #ifdef _OS2 #define UNDER_DOS #else #ifdef _QC #define UNDER_DOS #endif #endif #endif #endif #endif #ifndef DIR_CHAR #ifdef UNDER_DOS /* running under MSDOS or DOS-like OS */ #define DIR_CHAR '\\' #else #define DIR_CHAR '/' #endif #endif #define DIR_SEPARATORS ":\\/" extern UCHAR *text; xdms-1.3.2/src/crc_csum.c0000600000175000017510000000473310447526026014271 0ustar tarDebian-NM /* * xDMS v1.3 - Portable DMS archive unpacker - Public Domain * Written by Andre Rodrigues de la Rocha * * CRC16 & CheckSum16 calculation functions * CreateCRC was written (aparently) by Bjorn Stenberg * */ #include "cdata.h" #include "crc_csum.h" USHORT Calc_CheckSum(UCHAR *mem, ULONG size){ USHORT u=0; while(size--) u += *mem++; return (USHORT)(u & 0xffff); } USHORT CreateCRC(UCHAR* mem, ULONG size ){ static USHORT CRCTab[256]={ 0x0000,0xC0C1,0xC181,0x0140,0xC301,0x03C0,0x0280,0xC241, 0xC601,0x06C0,0x0780,0xC741,0x0500,0xC5C1,0xC481,0x0440, 0xCC01,0x0CC0,0x0D80,0xCD41,0x0F00,0xCFC1,0xCE81,0x0E40, 0x0A00,0xCAC1,0xCB81,0x0B40,0xC901,0x09C0,0x0880,0xC841, 0xD801,0x18C0,0x1980,0xD941,0x1B00,0xDBC1,0xDA81,0x1A40, 0x1E00,0xDEC1,0xDF81,0x1F40,0xDD01,0x1DC0,0x1C80,0xDC41, 0x1400,0xD4C1,0xD581,0x1540,0xD701,0x17C0,0x1680,0xD641, 0xD201,0x12C0,0x1380,0xD341,0x1100,0xD1C1,0xD081,0x1040, 0xF001,0x30C0,0x3180,0xF141,0x3300,0xF3C1,0xF281,0x3240, 0x3600,0xF6C1,0xF781,0x3740,0xF501,0x35C0,0x3480,0xF441, 0x3C00,0xFCC1,0xFD81,0x3D40,0xFF01,0x3FC0,0x3E80,0xFE41, 0xFA01,0x3AC0,0x3B80,0xFB41,0x3900,0xF9C1,0xF881,0x3840, 0x2800,0xE8C1,0xE981,0x2940,0xEB01,0x2BC0,0x2A80,0xEA41, 0xEE01,0x2EC0,0x2F80,0xEF41,0x2D00,0xEDC1,0xEC81,0x2C40, 0xE401,0x24C0,0x2580,0xE541,0x2700,0xE7C1,0xE681,0x2640, 0x2200,0xE2C1,0xE381,0x2340,0xE101,0x21C0,0x2080,0xE041, 0xA001,0x60C0,0x6180,0xA141,0x6300,0xA3C1,0xA281,0x6240, 0x6600,0xA6C1,0xA781,0x6740,0xA501,0x65C0,0x6480,0xA441, 0x6C00,0xACC1,0xAD81,0x6D40,0xAF01,0x6FC0,0x6E80,0xAE41, 0xAA01,0x6AC0,0x6B80,0xAB41,0x6900,0xA9C1,0xA881,0x6840, 0x7800,0xB8C1,0xB981,0x7940,0xBB01,0x7BC0,0x7A80,0xBA41, 0xBE01,0x7EC0,0x7F80,0xBF41,0x7D00,0xBDC1,0xBC81,0x7C40, 0xB401,0x74C0,0x7580,0xB541,0x7700,0xB7C1,0xB681,0x7640, 0x7200,0xB2C1,0xB381,0x7340,0xB101,0x71C0,0x7080,0xB041, 0x5000,0x90C1,0x9181,0x5140,0x9301,0x53C0,0x5280,0x9241, 0x9601,0x56C0,0x5780,0x9741,0x5500,0x95C1,0x9481,0x5440, 0x9C01,0x5CC0,0x5D80,0x9D41,0x5F00,0x9FC1,0x9E81,0x5E40, 0x5A00,0x9AC1,0x9B81,0x5B40,0x9901,0x59C0,0x5880,0x9841, 0x8801,0x48C0,0x4980,0x8941,0x4B00,0x8BC1,0x8A81,0x4A40, 0x4E00,0x8EC1,0x8F81,0x4F40,0x8D01,0x4DC0,0x4C80,0x8C41, 0x4400,0x84C1,0x8581,0x4540,0x8701,0x47C0,0x4680,0x8641, 0x8201,0x42C0,0x4380,0x8341,0x4100,0x81C1,0x8081,0x4040 }; register USHORT CRC = 0; while(size--) CRC = (USHORT) (CRCTab[((CRC ^ *mem++) & 255)] ^ ((CRC >> 8) & 255)); return CRC; } xdms-1.3.2/src/crc_csum.h0000600000175000017510000000011210447526026014261 0ustar tarDebian-NM USHORT Calc_CheckSum(UCHAR *, ULONG); USHORT CreateCRC(UCHAR *, ULONG); xdms-1.3.2/src/getbits.c0000600000175000017510000000123110447526026014122 0ustar tarDebian-NM /* * xDMS v1.3 - Portable DMS archive unpacker - Public Domain * Written by Andre Rodrigues de la Rocha * Functions/macros to get a variable number of bits * */ #include "cdata.h" #include "getbits.h" ULONG mask_bits[]={ 0x000000L,0x000001L,0x000003L,0x000007L,0x00000fL,0x00001fL, 0x00003fL,0x00007fL,0x0000ffL,0x0001ffL,0x0003ffL,0x0007ffL, 0x000fffL,0x001fffL,0x003fffL,0x007fffL,0x00ffffL,0x01ffffL, 0x03ffffL,0x07ffffL,0x0fffffL,0x1fffffL,0x3fffffL,0x7fffffL, 0xffffffL }; UCHAR *indata, bitcount; ULONG bitbuf; void initbitbuf(UCHAR *in){ bitbuf = 0; bitcount = 0; indata = in; DROPBITS(0); } xdms-1.3.2/src/getbits.h0000600000175000017510000000043510447526026014134 0ustar tarDebian-NM extern ULONG mask_bits[], bitbuf; extern UCHAR *indata, bitcount; #define GETBITS(n) ((USHORT)(bitbuf >> (bitcount-(n)))) #define DROPBITS(n) {bitbuf &= mask_bits[bitcount-=(n)]; while (bitcount<16) {bitbuf = (bitbuf << 8) | *indata++; bitcount += 8;}} void initbitbuf(UCHAR *); xdms-1.3.2/src/maketbl.c0000600000175000017510000000312610447526026014105 0ustar tarDebian-NM /* * xDMS v1.3 - Portable DMS archive unpacker - Public Domain * Written by Andre Rodrigues de la Rocha * * Makes decoding table for Heavy LZH decompression * From UNIX LHA made by Masaru Oki * */ #include "cdata.h" #include "maketbl.h" static SHORT c; static USHORT n, tblsiz, len, depth, maxdepth, avail; static USHORT codeword, bit, *tbl, TabErr; static UCHAR *blen; static USHORT mktbl(void); USHORT make_table(USHORT nchar, UCHAR bitlen[],USHORT tablebits, USHORT table[]){ n = avail = nchar; blen = bitlen; tbl = table; tblsiz = (USHORT) (1U << tablebits); bit = (USHORT) (tblsiz / 2); maxdepth = (USHORT)(tablebits + 1); depth = len = 1; c = -1; codeword = 0; TabErr = 0; mktbl(); /* left subtree */ if (TabErr) return TabErr; mktbl(); /* right subtree */ if (TabErr) return TabErr; if (codeword != tblsiz) return 5; return 0; } static USHORT mktbl(void){ USHORT i=0; if (TabErr) return 0; if (len == depth) { while (++c < n) if (blen[c] == len) { i = codeword; codeword += bit; if (codeword > tblsiz) { TabErr=1; return 0; } while (i < codeword) tbl[i++] = (USHORT)c; return (USHORT)c; } c = -1; len++; bit >>= 1; } depth++; if (depth < maxdepth) { mktbl(); mktbl(); } else if (depth > 32) { TabErr = 2; return 0; } else { if ((i = avail++) >= 2 * n - 1) { TabErr = 3; return 0; } left[i] = mktbl(); right[i] = mktbl(); if (codeword >= tblsiz) { TabErr = 4; return 0; } if (depth == maxdepth) tbl[codeword++] = i; } depth--; return i; } xdms-1.3.2/src/maketbl.h0000600000175000017510000000016510447526026014112 0ustar tarDebian-NM extern USHORT left[], right[]; USHORT make_table(USHORT nchar, UCHAR bitlen[], USHORT tablebits, USHORT table[]); xdms-1.3.2/src/pfile.c0000600000175000017510000003144410447526026013571 0ustar tarDebian-NM /* * xDMS v1.3 - Portable DMS archive unpacker - Public Domain * Written by Andre Rodrigues de la Rocha * * Handles the processing of a single DMS archive * */ #define HEADLEN 56 #define THLEN 20 #define TRACK_BUFFER_LEN 32000 #define TEMP_BUFFER_LEN 32000 #include #include #include #include #include "cdata.h" #include "u_init.h" #include "u_rle.h" #include "u_quick.h" #include "u_medium.h" #include "u_deep.h" #include "u_heavy.h" #include "crc_csum.h" #include "pfile.h" static USHORT Process_Track(FILE *, FILE *, UCHAR *, UCHAR *, USHORT, USHORT, USHORT); static USHORT Unpack_Track(UCHAR *, UCHAR *, USHORT, USHORT, UCHAR, UCHAR); static void printbandiz(UCHAR *, USHORT); static void dms_decrypt(UCHAR *, USHORT); static char modes[7][7]={"NOCOMP","SIMPLE","QUICK ","MEDIUM","DEEP ","HEAVY1","HEAVY2"}; static USHORT PWDCRC; UCHAR *text; int OverrideErrors; USHORT Process_File(char *iname, char *oname, USHORT cmd, USHORT opt, USHORT PCRC, USHORT pwd){ FILE *fi, *fo=NULL; USHORT from, to, geninfo, c_version, cmode, hcrc, disktype, pv, ret; ULONG pkfsize, unpkfsize; UCHAR *b1, *b2; time_t date; b1 = (UCHAR *)calloc((size_t)TRACK_BUFFER_LEN,1); if (!b1) return ERR_NOMEMORY; b2 = (UCHAR *)calloc((size_t)TRACK_BUFFER_LEN,1); if (!b2) { free(b1); return ERR_NOMEMORY; } text = (UCHAR *)calloc((size_t)TEMP_BUFFER_LEN,1); if (!text) { free(b1); free(b2); return ERR_NOMEMORY; } /* if iname is NULL, input is stdin; if oname is NULL, output is stdout */ if (iname){ fi = fopen(iname,"rb"); if (!fi) { free(b1); free(b2); free(text); return ERR_CANTOPENIN; } } else { fi = stdin; } if (fread(b1,1,HEADLEN,fi) != HEADLEN) { if (iname) fclose(fi); free(b1); free(b2); free(text); return ERR_SREAD; } if ( (b1[0] != 'D') || (b1[1] != 'M') || (b1[2] != 'S') || (b1[3] != '!') ) { /* Check the first 4 bytes of file to see if it is "DMS!" */ if (iname) fclose(fi); free(b1); free(b2); free(text); return ERR_NOTDMS; } hcrc = (USHORT)((b1[HEADLEN-2]<<8) | b1[HEADLEN-1]); /* Header CRC */ if (hcrc != CreateCRC(b1+4,(ULONG)(HEADLEN-6))) { if (iname) fclose(fi); free(b1); free(b2); free(text); return ERR_HCRC; } geninfo = (USHORT) ((b1[10]<<8) | b1[11]); /* General info about archive */ date = (time_t) ((((ULONG)b1[12])<<24) | (((ULONG)b1[13])<<16) | (((ULONG)b1[14])<<8) | (ULONG)b1[15]); /* date in standard UNIX/ANSI format */ from = (USHORT) ((b1[16]<<8) | b1[17]); /* Lowest track in archive. May be incorrect if archive is "appended" */ to = (USHORT) ((b1[18]<<8) | b1[19]); /* Highest track in archive. May be incorrect if archive is "appended" */ pkfsize = (ULONG) ((((ULONG)b1[21])<<16) | (((ULONG)b1[22])<<8) | (ULONG)b1[23]); /* Length of total packed data as in archive */ unpkfsize = (ULONG) ((((ULONG)b1[25])<<16) | (((ULONG)b1[26])<<8) | (ULONG)b1[27]); /* Length of unpacked data. Usually 901120 bytes */ c_version = (USHORT) ((b1[46]<<8) | b1[47]); /* version of DMS used to generate it */ disktype = (USHORT) ((b1[50]<<8) | b1[51]); /* Type of compressed disk */ cmode = (USHORT) ((b1[52]<<8) | b1[53]); /* Compression mode mostly used in this archive */ PWDCRC = PCRC; if ( (cmd == CMD_VIEW) || (cmd == CMD_VIEWFULL) ) { if (iname) printf("\n File : %s\n",iname); else printf("\n Data from stdin\n"); pv = (USHORT)(c_version/100); printf(" Created with DMS version %d.%02d ",pv,c_version-pv*100); if (geninfo & 0x80) printf("Registered\n"); else printf("Evaluation\n"); printf(" Creation date : %s",ctime(&date)); printf(" Lowest track in archive : %d\n",from); printf(" Highest track in archive : %d\n",to); printf(" Packed data size : %u\n",pkfsize); printf(" Unpacked data size : %u\n",unpkfsize); printf(" Disk type of archive : "); /* The original DMS from SDS software (DMS up to 1.11) used other values */ /* in disk type to indicate formats as MS-DOS, AMax and Mac, but it was */ /* not suported for compression. It was for future expansion and was never */ /* used. The newer versions of DMS made by ParCon Software changed it to */ /* add support for new Amiga disk types. */ switch (disktype) { case 0: case 1: /* Can also be a non-dos disk */ printf("AmigaOS 1.0 OFS\n"); break; case 2: printf("AmigaOS 2.0 FFS\n"); break; case 3: printf("AmigaOS 3.0 OFS / International\n"); break; case 4: printf("AmigaOS 3.0 FFS / International\n"); break; case 5: printf("AmigaOS 3.0 OFS / Dir Cache\n"); break; case 6: printf("AmigaOS 3.0 FFS / Dir Cache\n"); break; case 7: printf("FMS Amiga System File\n"); break; default: printf("Unknown\n"); } printf(" Compression mode used : "); if (cmode>6) printf("Unknown !\n"); else printf("%s\n",modes[cmode]); printf(" General info : "); if ((geninfo==0)||(geninfo==0x80)) printf("None"); if (geninfo & 1) printf("NoZero "); if (geninfo & 2) printf("Encrypted "); if (geninfo & 4) printf("Appends "); if (geninfo & 8) printf("Banner "); if (geninfo & 16) printf("HD "); if (geninfo & 32) printf("MS-DOS "); if (geninfo & 64) printf("DMS_DEV_Fixed "); if (geninfo & 256) printf("FILEID.DIZ"); printf("\n"); printf(" Info Header CRC : %04X\n\n",hcrc); } if (disktype == 7) { /* It's not a DMS compressed disk image, but a FMS archive */ if (iname) fclose(fi); free(b1); free(b2); free(text); return ERR_FMS; } if (cmd == CMD_VIEWFULL) { printf(" Track Plength Ulength Cmode USUM HCRC DCRC Cflag\n"); printf(" ------ ------- ------- ------ ---- ---- ---- -----\n"); } if (((cmd==CMD_UNPACK) || (cmd==CMD_SHOWBANNER)) && (geninfo & 2) && (!pwd)) return ERR_NOPASSWD; if (cmd == CMD_UNPACK) { if (oname){ fo = fopen(oname,"wb"); if (!fo) { if (iname) fclose(fi); free(b1); free(b2); free(text); return ERR_CANTOPENOUT; } } else { fo = stdout; } } ret=NO_PROBLEM; Init_Decrunchers(); if (cmd != CMD_VIEW) { if (cmd == CMD_SHOWBANNER) /* Banner is in the first track */ ret = Process_Track(fi,NULL,b1,b2,cmd,opt,(geninfo & 2)?pwd:0); else { while ( (ret=Process_Track(fi,fo,b1,b2,cmd,opt,(geninfo & 2)?pwd:0)) == NO_PROBLEM ) ; if ((cmd == CMD_UNPACK) && (opt == OPT_VERBOSE)) fprintf(stderr,"\n"); } } if ((cmd == CMD_VIEWFULL) || (cmd == CMD_SHOWDIZ) || (cmd == CMD_SHOWBANNER)) printf("\n"); if (ret == FILE_END) ret = NO_PROBLEM; /* Used to give an error message, but I have seen some DMS */ /* files with texts or zeros at the end of the valid data */ /* So, when we find something that is not a track header, */ /* we suppose that the valid data is over. And say it's ok. */ if (ret == ERR_NOTTRACK) ret = NO_PROBLEM; if (iname) fclose(fi); if ((cmd == CMD_UNPACK) && oname) fclose(fo); free(b1); free(b2); free(text); return ret; } static USHORT Process_Track(FILE *fi, FILE *fo, UCHAR *b1, UCHAR *b2, USHORT cmd, USHORT opt, USHORT pwd) { USHORT hcrc, dcrc, usum, number, pklen1, pklen2, unpklen, l, r; UCHAR cmode, flags; l = (USHORT)fread(b1,1,THLEN,fi); if (l != THLEN) { if (l==0) return FILE_END; else return ERR_SREAD; } /* "TR" identifies a Track Header */ if ((b1[0] != 'T')||(b1[1] != 'R')) return ERR_NOTTRACK; /* Track Header CRC */ hcrc = (USHORT)((b1[THLEN-2] << 8) | b1[THLEN-1]); if (CreateCRC(b1,(ULONG)(THLEN-2)) != hcrc) return ERR_THCRC; number = (USHORT)((b1[2] << 8) | b1[3]); /* Number of track */ pklen1 = (USHORT)((b1[6] << 8) | b1[7]); /* Length of packed track data as in archive */ pklen2 = (USHORT)((b1[8] << 8) | b1[9]); /* Length of data after first unpacking */ unpklen = (USHORT)((b1[10] << 8) | b1[11]); /* Length of data after subsequent rle unpacking */ flags = b1[12]; /* control flags */ cmode = b1[13]; /* compression mode used */ usum = (USHORT)((b1[14] << 8) | b1[15]); /* Track Data CheckSum AFTER unpacking */ dcrc = (USHORT)((b1[16] << 8) | b1[17]); /* Track Data CRC BEFORE unpacking */ if (cmd == CMD_VIEWFULL) { if (number==80) printf(" FileID "); else if (number==0xffff) printf(" Banner "); else if ((number==0) && (unpklen==1024)) printf(" FakeBB "); else printf(" %2d ",(short)number); printf("%5d %5d %s %04X %04X %04X %0d\n", pklen1, unpklen, modes[cmode], usum, hcrc, dcrc, flags); } if ((pklen1 > TRACK_BUFFER_LEN) || (pklen2 >TRACK_BUFFER_LEN) || (unpklen > TRACK_BUFFER_LEN)) return ERR_BIGTRACK; if (fread(b1,1,(size_t)pklen1,fi) != pklen1) return ERR_SREAD; if (CreateCRC(b1,(ULONG)pklen1) != dcrc) { if (OverrideErrors) { fprintf(stderr, "Detected a CRC error on " "track %d, but overriding.\n", number); } else { return ERR_TDCRC; } } /* track 80 is FILEID.DIZ, track 0xffff (-1) is Banner */ /* and track 0 with 1024 bytes only is a fake boot block with more advertising */ /* FILE_ID.DIZ is never encrypted */ if (pwd && (number != 80)) dms_decrypt(b1,pklen1); if ((cmd == CMD_UNPACK) && (number<80) && (unpklen>2048)) { memset(b2, 0, unpklen); r = Unpack_Track(b1, b2, pklen2, unpklen, cmode, flags); if (r != NO_PROBLEM) { if (OverrideErrors) { fprintf(stderr, "Detected an error while " "unpacking track %d, but " "overriding.\n", number); } else { if (pwd) return ERR_BADPASSWD; else return r; } } if (usum != Calc_CheckSum(b2,(ULONG)unpklen)) { if (OverrideErrors) { fprintf(stderr, "Detected an error after " "unpacking track %d, but " "overriding.\n", number); } else { if (pwd) return ERR_BADPASSWD; else return ERR_CSUM; } } if (fwrite(b2, 1, (size_t) unpklen, fo) != unpklen) return ERR_CANTWRITE; if (opt == OPT_VERBOSE) { fprintf(stderr,"#"); fflush(stderr); } } if ((cmd == CMD_SHOWBANNER) && (number == 0xffff)){ r = Unpack_Track(b1, b2, pklen2, unpklen, cmode, flags); if (r != NO_PROBLEM) { if (OverrideErrors) { fprintf(stderr, "Detected an error while " "unpacking bannder, but overriding.\n"); } else { if (pwd) return ERR_BADPASSWD; else return r; } } if (usum != Calc_CheckSum(b2,(ULONG)unpklen)) { if (OverrideErrors) { fprintf(stderr, "Detected an error after " "unpacking banner, but overriding.\n"); } else { if (pwd) return ERR_BADPASSWD; else return ERR_CSUM; } } printbandiz(b2,unpklen); } if ((cmd == CMD_SHOWDIZ) && (number == 80)) { r = Unpack_Track(b1, b2, pklen2, unpklen, cmode, flags); if (r != NO_PROBLEM) { if (OverrideErrors) { fprintf(stderr, "Detected an error while " "unpacking showdiz, but overriding.\n"); } else { return r; } } if (usum != Calc_CheckSum(b2,(ULONG)unpklen)) { if (OverrideErrors) { fprintf(stderr, "Detected an error after " "unpacking showdiz, but overriding.\n"); } else { return ERR_CSUM; } } printbandiz(b2,unpklen); } return NO_PROBLEM; } static USHORT Unpack_Track(UCHAR *b1, UCHAR *b2, USHORT pklen2, USHORT unpklen, UCHAR cmode, UCHAR flags) { switch (cmode){ case 0: /* No Compression */ memcpy(b2,b1,(size_t)unpklen); break; case 1: /* Simple Compression */ if (Unpack_RLE(b1,b2,unpklen)) return ERR_BADDECR; break; case 2: /* Quick Compression */ if (Unpack_QUICK(b1,b2,pklen2)) return ERR_BADDECR; if (Unpack_RLE(b2,b1,unpklen)) return ERR_BADDECR; memcpy(b2,b1,(size_t)unpklen); break; case 3: /* Medium Compression */ if (Unpack_MEDIUM(b1,b2,pklen2)) return ERR_BADDECR; if (Unpack_RLE(b2,b1,unpklen)) return ERR_BADDECR; memcpy(b2,b1,(size_t)unpklen); break; case 4: /* Deep Compression */ if (Unpack_DEEP(b1,b2,pklen2)) return ERR_BADDECR; if (Unpack_RLE(b2,b1,unpklen)) return ERR_BADDECR; memcpy(b2,b1,(size_t)unpklen); break; case 5: case 6: /* Heavy Compression */ if (cmode==5) { /* Heavy 1 */ if (Unpack_HEAVY(b1,b2,flags & 7,pklen2)) return ERR_BADDECR; } else { /* Heavy 2 */ if (Unpack_HEAVY(b1,b2,flags | 8,pklen2)) return ERR_BADDECR; } if (flags & 4) { /* Unpack with RLE only if this flag is set */ if (Unpack_RLE(b2,b1,unpklen)) return ERR_BADDECR; memcpy(b2,b1,(size_t)unpklen); } break; default: return ERR_UNKNMODE; } if (!(flags & 1)) Init_Decrunchers(); return NO_PROBLEM; } /* DMS uses a lame encryption */ static void dms_decrypt(UCHAR *p, USHORT len){ USHORT t; while (len--){ t = (USHORT) *p; *p++ ^= (UCHAR)PWDCRC; PWDCRC = (USHORT)((PWDCRC >> 1) + t); } } static void printbandiz(UCHAR *m, USHORT len){ UCHAR *i,*j; i=j=m; while (i * * Tables used in Medium and Deep compression modes * */ #include "cdata.h" #include "tables.h" UCHAR d_code[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0C, 0x0C, 0x0C, 0x0C, 0x0D, 0x0D, 0x0D, 0x0D, 0x0E, 0x0E, 0x0E, 0x0E, 0x0F, 0x0F, 0x0F, 0x0F, 0x10, 0x10, 0x10, 0x10, 0x11, 0x11, 0x11, 0x11, 0x12, 0x12, 0x12, 0x12, 0x13, 0x13, 0x13, 0x13, 0x14, 0x14, 0x14, 0x14, 0x15, 0x15, 0x15, 0x15, 0x16, 0x16, 0x16, 0x16, 0x17, 0x17, 0x17, 0x17, 0x18, 0x18, 0x19, 0x19, 0x1A, 0x1A, 0x1B, 0x1B, 0x1C, 0x1C, 0x1D, 0x1D, 0x1E, 0x1E, 0x1F, 0x1F, 0x20, 0x20, 0x21, 0x21, 0x22, 0x22, 0x23, 0x23, 0x24, 0x24, 0x25, 0x25, 0x26, 0x26, 0x27, 0x27, 0x28, 0x28, 0x29, 0x29, 0x2A, 0x2A, 0x2B, 0x2B, 0x2C, 0x2C, 0x2D, 0x2D, 0x2E, 0x2E, 0x2F, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, }; UCHAR d_len[256] = { 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, }; xdms-1.3.2/src/tables.h0000600000175000017510000000004210447526026013737 0ustar tarDebian-NM extern UCHAR d_code[], d_len[]; xdms-1.3.2/src/u_deep.c0000600000175000017510000001006210447526026013724 0ustar tarDebian-NM /* * xDMS v1.3 - Portable DMS archive unpacker - Public Domain * Written by Andre Rodrigues de la Rocha * * Lempel-Ziv-DynamicHuffman decompression functions used in Deep * mode. * Most routines ripped from LZHUF written by Haruyasu Yoshizaki * */ #include #include "cdata.h" #include "tables.h" #include "u_deep.h" #include "getbits.h" INLINE USHORT DecodeChar(void); INLINE USHORT DecodePosition(void); INLINE void update(USHORT c); static void reconst(void); USHORT deep_text_loc; int init_deep_tabs=1; #define DBITMASK 0x3fff /* uses 16Kb dictionary */ #define F 60 /* lookahead buffer size */ #define THRESHOLD 2 #define N_CHAR (256 - THRESHOLD + F) /* kinds of characters (character code = 0..N_CHAR-1) */ #define T (N_CHAR * 2 - 1) /* size of table */ #define R (T - 1) /* position of root */ #define MAX_FREQ 0x8000 /* updates tree when the */ USHORT freq[T + 1]; /* frequency table */ USHORT prnt[T + N_CHAR]; /* pointers to parent nodes, except for the */ /* elements [T..T + N_CHAR - 1] which are used to get */ /* the positions of leaves corresponding to the codes. */ USHORT son[T]; /* pointers to child nodes (son[], son[] + 1) */ void Init_DEEP_Tabs(void){ USHORT i, j; for (i = 0; i < N_CHAR; i++) { freq[i] = 1; son[i] = (USHORT)(i + T); prnt[i + T] = i; } i = 0; j = N_CHAR; while (j <= R) { freq[j] = (USHORT) (freq[i] + freq[i + 1]); son[j] = i; prnt[i] = prnt[i + 1] = j; i += 2; j++; } freq[T] = 0xffff; prnt[R] = 0; init_deep_tabs = 0; } USHORT Unpack_DEEP(UCHAR *in, UCHAR *out, USHORT origsize){ USHORT i, j, c; UCHAR *outend; initbitbuf(in); if (init_deep_tabs) Init_DEEP_Tabs(); outend = out+origsize; while (out < outend) { c = DecodeChar(); if (c < 256) { *out++ = text[deep_text_loc++ & DBITMASK] = (UCHAR)c; } else { j = (USHORT) (c - 255 + THRESHOLD); i = (USHORT) (deep_text_loc - DecodePosition() - 1); while (j--) *out++ = text[deep_text_loc++ & DBITMASK] = text[i++ & DBITMASK]; } } deep_text_loc = (USHORT)((deep_text_loc+60) & DBITMASK); return 0; } INLINE USHORT DecodeChar(void){ USHORT c; c = son[R]; /* travel from root to leaf, */ /* choosing the smaller child node (son[]) if the read bit is 0, */ /* the bigger (son[]+1} if 1 */ while (c < T) { c = son[c + GETBITS(1)]; DROPBITS(1); } c -= T; update(c); return c; } INLINE USHORT DecodePosition(void){ USHORT i, j, c; i = GETBITS(8); DROPBITS(8); c = (USHORT) (d_code[i] << 8); j = d_len[i]; i = (USHORT) (((i << j) | GETBITS(j)) & 0xff); DROPBITS(j); return (USHORT) (c | i) ; } /* reconstruction of tree */ static void reconst(void){ USHORT i, j, k, f, l; /* collect leaf nodes in the first half of the table */ /* and replace the freq by (freq + 1) / 2. */ j = 0; for (i = 0; i < T; i++) { if (son[i] >= T) { freq[j] = (USHORT) ((freq[i] + 1) / 2); son[j] = son[i]; j++; } } /* begin constructing tree by connecting sons */ for (i = 0, j = N_CHAR; j < T; i += 2, j++) { k = (USHORT) (i + 1); f = freq[j] = (USHORT) (freq[i] + freq[k]); for (k = (USHORT)(j - 1); f < freq[k]; k--); k++; l = (USHORT)((j - k) * 2); memmove(&freq[k + 1], &freq[k], (size_t)l); freq[k] = f; memmove(&son[k + 1], &son[k], (size_t)l); son[k] = i; } /* connect prnt */ for (i = 0; i < T; i++) { if ((k = son[i]) >= T) { prnt[k] = i; } else { prnt[k] = prnt[k + 1] = i; } } } /* increment frequency of given code by one, and update tree */ INLINE void update(USHORT c){ USHORT i, j, k, l; if (freq[R] == MAX_FREQ) { reconst(); } c = prnt[c + T]; do { k = ++freq[c]; /* if the order is disturbed, exchange nodes */ if (k > freq[l = (USHORT)(c + 1)]) { while (k > freq[++l]); l--; freq[c] = freq[l]; freq[l] = k; i = son[c]; prnt[i] = l; if (i < T) prnt[i + 1] = l; j = son[l]; son[l] = i; prnt[j] = c; if (j < T) prnt[j + 1] = c; son[c] = j; c = l; } } while ((c = prnt[c]) != 0); /* repeat up to root */ } xdms-1.3.2/src/u_deep.h0000600000175000017510000000015210447526026013730 0ustar tarDebian-NM USHORT Unpack_DEEP(UCHAR *, UCHAR *, USHORT); extern int init_deep_tabs; extern USHORT deep_text_loc; xdms-1.3.2/src/u_heavy.c0000600000175000017510000000576310447526026014137 0ustar tarDebian-NM /* * xDMS v1.3 - Portable DMS archive unpacker - Public Domain * Written by Andre Rodrigues de la Rocha * * Lempel-Ziv-Huffman decompression functions used in Heavy 1 & 2 * compression modes. Based on LZH decompression functions from * UNIX LHA made by Masaru Oki * */ #include "cdata.h" #include "u_heavy.h" #include "getbits.h" #include "maketbl.h" #define NC 510 #define NPT 20 #define N1 510 #define OFFSET 253 USHORT left[2 * NC - 1], right[2 * NC - 1 + 9]; static UCHAR c_len[NC], pt_len[NPT]; static USHORT c_table[4096], pt_table[256]; static USHORT lastlen, np; USHORT heavy_text_loc; static USHORT read_tree_c(void); static USHORT read_tree_p(void); INLINE USHORT decode_c(void); INLINE USHORT decode_p(void); USHORT Unpack_HEAVY(UCHAR *in, UCHAR *out, UCHAR flags, USHORT origsize){ USHORT j, i, c, bitmask; UCHAR *outend; /* Heavy 1 uses a 4Kb dictionary, Heavy 2 uses 8Kb */ if (flags & 8) { np = 15; bitmask = 0x1fff; } else { np = 14; bitmask = 0x0fff; } initbitbuf(in); if (flags & 2) { if (read_tree_c()) return 1; if (read_tree_p()) return 2; } outend = out+origsize; while (out>= 1; } while (j >= N1); DROPBITS(c_len[j] - 12); } return j; } INLINE USHORT decode_p(void){ USHORT i, j, m; j = pt_table[GETBITS(8)]; if (j < np) { DROPBITS(pt_len[j]); } else { DROPBITS(8); i = GETBITS(16); m = 0x8000; do { if (i & m) j = right[j]; else j = left [j]; m >>= 1; } while (j >= np); DROPBITS(pt_len[j] - 8); } if (j != np-1) { if (j > 0) { j = (USHORT)(GETBITS(i=(USHORT)(j-1)) | (1U << (j-1))); DROPBITS(i); } lastlen=j; } return lastlen; } static USHORT read_tree_c(void){ USHORT i,n; n = GETBITS(9); DROPBITS(9); if (n>0){ for (i=0; i0){ for (i=0; i * * Decruncher reinitialization * */ #include #include "cdata.h" #include "u_init.h" #include "u_quick.h" #include "u_medium.h" #include "u_deep.h" #include "u_heavy.h" void Init_Decrunchers(void){ quick_text_loc = 251; medium_text_loc = 0x3fbe; heavy_text_loc = 0; deep_text_loc = 0x3fc4; init_deep_tabs = 1; memset(text,0,0x3fc8); } xdms-1.3.2/src/u_init.h0000600000175000017510000000003710447526026013760 0ustar tarDebian-NM void Init_Decrunchers(void); xdms-1.3.2/src/u_medium.c0000600000175000017510000000217210447526026014272 0ustar tarDebian-NM /* * xDMS v1.3 - Portable DMS archive unpacker - Public Domain * Written by Andre Rodrigues de la Rocha * * Main decompression functions used in MEDIUM mode * */ #include #include "cdata.h" #include "u_medium.h" #include "getbits.h" #include "tables.h" #define MBITMASK 0x3fff USHORT medium_text_loc; USHORT Unpack_MEDIUM(UCHAR *in, UCHAR *out, USHORT origsize){ USHORT i, j, c; UCHAR u, *outend; initbitbuf(in); outend = out+origsize; while (out < outend) { if (GETBITS(1)!=0) { DROPBITS(1); *out++ = text[medium_text_loc++ & MBITMASK] = (UCHAR)GETBITS(8); DROPBITS(8); } else { DROPBITS(1); c = GETBITS(8); DROPBITS(8); j = (USHORT) (d_code[c]+3); u = d_len[c]; c = (USHORT) (((c << u) | GETBITS(u)) & 0xff); DROPBITS(u); u = d_len[c]; c = (USHORT) ((d_code[c] << 8) | (((c << u) | GETBITS(u)) & 0xff)); DROPBITS(u); i = (USHORT) (medium_text_loc - c - 1); while(j--) *out++ = text[medium_text_loc++ & MBITMASK] = text[i++ & MBITMASK]; } } medium_text_loc = (USHORT)((medium_text_loc+66) & MBITMASK); return 0; } xdms-1.3.2/src/u_medium.h0000600000175000017510000000012210447526026014270 0ustar tarDebian-NM USHORT Unpack_MEDIUM(UCHAR *, UCHAR *, USHORT); extern USHORT medium_text_loc; xdms-1.3.2/src/u_quick.c0000600000175000017510000000155410447526026014131 0ustar tarDebian-NM /* * xDMS v1.3 - Portable DMS archive unpacker - Public Domain * Written by Andre Rodrigues de la Rocha * * */ #include #include "cdata.h" #include "u_quick.h" #include "getbits.h" #define QBITMASK 0xff USHORT quick_text_loc; USHORT Unpack_QUICK(UCHAR *in, UCHAR *out, USHORT origsize){ USHORT i, j; UCHAR *outend; initbitbuf(in); outend = out+origsize; while (out < outend) { if (GETBITS(1)!=0) { DROPBITS(1); *out++ = text[quick_text_loc++ & QBITMASK] = (UCHAR)GETBITS(8); DROPBITS(8); } else { DROPBITS(1); j = (USHORT) (GETBITS(2)+2); DROPBITS(2); i = (USHORT) (quick_text_loc - GETBITS(8) - 1); DROPBITS(8); while(j--) { *out++ = text[quick_text_loc++ & QBITMASK] = text[i++ & QBITMASK]; } } } quick_text_loc = (USHORT)((quick_text_loc+5) & QBITMASK); return 0; } xdms-1.3.2/src/u_quick.h0000600000175000017510000000012010447526026014122 0ustar tarDebian-NM USHORT Unpack_QUICK(UCHAR *, UCHAR *, USHORT); extern USHORT quick_text_loc; xdms-1.3.2/src/u_rle.c0000600000175000017510000000136610447526026013600 0ustar tarDebian-NM /* * xDMS v1.3 - Portable DMS archive unpacker - Public Domain * Written by Andre Rodrigues de la Rocha * * Run Length Encoding decompression function used in most * modes after decompression by other algorithm * */ #include #include "cdata.h" #include "u_rle.h" USHORT Unpack_RLE(UCHAR *in, UCHAR *out, USHORT origsize){ USHORT n; UCHAR a,b, *outend; outend = out+origsize; while (out outend) return 1; memset(out,a,(size_t) n); out += n; } } return 0; } xdms-1.3.2/src/u_rle.h0000600000175000017510000000005710447526026013601 0ustar tarDebian-NM USHORT Unpack_RLE(UCHAR *, UCHAR *, USHORT); xdms-1.3.2/src/xdms.c0000600000175000017510000003144710447526026013450 0ustar tarDebian-NM /* * xDMS - Portable DMS archive unpacker - Public Domain * Written by Andre Rodrigues de la Rocha * * */ #include #include #include #include #include #include "cdata.h" #include "pfile.h" #include "crc_csum.h" #ifdef UNDER_DOS #include #include #endif #define FNAME_MAXC 512 static void Usage(void); static int strcmpnc(char *, char *); static void strcpymax(char *, char *, int); static void strcatmax(char *, char *, int); static void ErrMsg(USHORT, char *, char *); int main(int argc, char **argv){ USHORT i, cmd=0, opt=0, ret, PCRC=0, pwd=0; int ext; char iname[FNAME_MAXC+1], oname[FNAME_MAXC+1], cmdstr[FNAME_MAXC+20], *inm, *onm, *p, *q, *destdir=NULL; char tname[FNAME_MAXC]; if (argc < 3) { Usage(); exit(EXIT_FAILURE); } /* proccess options in the command line */ for (i=1; (i2) { fprintf(stderr,"Unknown option !\n"); Usage(); exit(EXIT_FAILURE); } switch (tolower(argv[i][1])) { case 'f': OverrideErrors = 1; break; case 'q' : opt = OPT_QUIET; break; case 'v' : opt = OPT_VERBOSE; break; case 'd' : if (++i == argc) { Usage(); exit(EXIT_FAILURE); } destdir = argv[i]; break; case 'p' : if (++i == argc) { Usage(); exit(EXIT_FAILURE); } PCRC = CreateCRC((UCHAR*)argv[i],(ULONG)strlen(argv[i])); pwd = 1; break; default: fprintf(stderr,"Unknown option !\n"); Usage(); exit(EXIT_FAILURE); } } if ((i == argc) || (strlen(argv[i])>1)) { Usage(); exit(EXIT_FAILURE); } switch (tolower(argv[i][0])) { case 'u': cmd = CMD_UNPACK; break; case 'z': cmd = CMD_UNPKGZ; break; case 'x': cmd = CMD_EXTRACT; break; case 't': cmd = CMD_TEST; break; case 'v': cmd = CMD_VIEW; break; case 'f': cmd = CMD_VIEWFULL; break; case 'd': cmd = CMD_SHOWDIZ; break; case 'b': cmd = CMD_SHOWBANNER; break; default: fprintf(stderr,"Unknown command !\n"); Usage(); exit(EXIT_FAILURE); } if (++i == argc) { Usage(); exit(EXIT_FAILURE); } ext = EXIT_SUCCESS; while (i < argc) { if (!strcmpnc("stdin",argv[i])) { inm = NULL; } else { strcpymax(iname,argv[i],FNAME_MAXC); if ((strlen(iname)<4) || (strcmpnc(".dms",iname+strlen(iname)-4))) strcatmax(iname,".dms",FNAME_MAXC); inm = iname; } i++; /* generate the output filename */ if ((i < argc) && (argv[i][0]=='+')) { if ((!strcmpnc("stdout",argv[i]+1)) || (destdir && (!strcmpnc("stdout",destdir)))) { strcpy(oname,""); onm = NULL; } else { if (destdir) { strcpymax(oname,destdir,FNAME_MAXC-1); p = oname + strlen(oname) - 1; if (!strchr(DIR_SEPARATORS,*p)) { *(p+1) = DIR_CHAR; *(p+2) = '\0'; } } else strcpy(oname,""); strcatmax(oname,argv[i]+1,FNAME_MAXC); if (((cmd == CMD_UNPACK) || (cmd == CMD_UNPKGZ)) && (strlen(oname)>0)) { p = oname + strlen(oname) - 1; if (strchr(DIR_SEPARATORS,*p)) { if (inm) { p = q = iname; while(*p) { if (strchr(DIR_SEPARATORS,*p)) q = p+1; p++; } strcatmax(oname,q,FNAME_MAXC); if ((strlen(oname)>4) && (!strcmpnc(oname+strlen(oname)-4,".dms"))) { if (cmd == CMD_UNPKGZ) strcpy(oname+strlen(oname)-4,".adz"); else strcpy(oname+strlen(oname)-4,".adf"); } else { if (cmd == CMD_UNPKGZ) strcatmax(oname,".adz",FNAME_MAXC); else strcatmax(oname,".adf",FNAME_MAXC); } } else { if (cmd == CMD_UNPKGZ) strcatmax(oname,"stdin.adz",FNAME_MAXC); else strcatmax(oname,"stdin.adf",FNAME_MAXC); } } } onm = oname; } i++; } else if (destdir && (!strcmpnc("stdout",destdir))) { strcpy(oname,""); onm = NULL; } else { if (destdir) strcpymax(oname,destdir,FNAME_MAXC-1); else strcpy(oname,""); if ((cmd == CMD_UNPACK) || (cmd == CMD_UNPKGZ)) { if (strlen(oname)>0) { p = oname + strlen(oname) - 1; if (!strchr(DIR_SEPARATORS,*p)) { *(p+1) = DIR_CHAR; *(p+2) = '\0'; } } if (inm) { p = q = iname; while(*p) { if (strchr(DIR_SEPARATORS,*p)) q = p+1; p++; } strcatmax(oname,q,FNAME_MAXC); if ((strlen(oname)>4) && (!strcmpnc(oname+strlen(oname)-4,".dms"))) { if (cmd == CMD_UNPKGZ) strcpy(oname+strlen(oname)-4,".adz"); else strcpy(oname+strlen(oname)-4,".adf"); } else { if (cmd == CMD_UNPKGZ) strcatmax(oname,".adz",FNAME_MAXC); else strcatmax(oname,".adf",FNAME_MAXC); } } else { if (cmd == CMD_UNPKGZ) strcatmax(oname,"stdin.adz",FNAME_MAXC); else strcatmax(oname,"stdin.adf",FNAME_MAXC); } } onm = oname; } if (opt == OPT_VERBOSE) { if ((cmd == CMD_UNPACK)) { if (inm) fprintf(stderr,"Unpacking file %s to ",inm); else fprintf(stderr,"Unpacking data from stdin to "); if (onm) fprintf(stderr,"%s\n",onm); else fprintf(stderr,"stdout\n"); } else if ((cmd == CMD_EXTRACT) || (cmd == CMD_UNPKGZ)) { if (inm) fprintf(stderr,"Unpacking file %s\n",inm); else fprintf(stderr,"Unpacking data from stdin\n"); } else if (cmd == CMD_TEST) { if (inm) fprintf(stderr,"Testing file %s\n",inm); else fprintf(stderr,"Testing data from stdin\n"); } else if (cmd == CMD_SHOWDIZ) { if (inm) printf("Showing FILEID.DIZ in %s :\n",inm); else printf("Showing FILEID.DIZ in stdin :\n"); } else if (cmd == CMD_SHOWBANNER) { if (inm) printf("Showing Banner in %s :\n",inm); else printf("Showing Banner in stdin :\n"); } } #ifdef UNDER_DOS if (!inm) setmode(fileno(stdin),O_BINARY); if ((cmd == CMD_UNPACK) && (!onm)) setmode(fileno(stdout),O_BINARY); #endif if ((cmd == CMD_UNPKGZ) || (cmd == CMD_EXTRACT)) { int fd; strcpy(tname, "/tmp/xdmsXXXXXX"); fd = mkstemp(tname); if (fd < 0) { fprintf(stderr, "couldn't create a temp file\n"); exit(-1); } close(fd); #ifdef UNDER_DOS p = tname; if (p) { while (*p) { if (*p == '/') *p = '\\'; p++; } } #endif ret = Process_File(inm, tname, CMD_UNPACK, opt, PCRC, pwd); if (opt != OPT_QUIET) ErrMsg(ret, inm, "Temporary file"); if (ret == NO_PROBLEM) { if (cmd == CMD_UNPKGZ) { if (opt == OPT_VERBOSE) { fprintf(stderr,"Repacking unpacked data with gzip\n"); } if (onm) #ifdef UNDER_DOS /* DOS sucks */ sprintf(cmdstr,"gzip -cfqn %s >%s",tname,onm); #else sprintf(cmdstr,"gzip -cfqn \"%s\" >\"%s\"",tname,onm); #endif else #ifdef UNDER_DOS sprintf(cmdstr,"gzip -cfqn %s",tname); #else sprintf(cmdstr,"gzip -cfqn \"%s\"",tname); #endif if (system(cmdstr)) ret = ERR_GZIP; if (opt != OPT_QUIET) ErrMsg(ret, inm, onm); } else { if (opt == OPT_VERBOSE) { fprintf(stderr,"Extracting files from unpacked data with readdisk\n"); } if ((onm) && (strlen(onm)>0)) #ifdef UNDER_DOS sprintf(cmdstr,"readdisk %s %s",tname,onm); #else sprintf(cmdstr,"readdisk \"%s\" \"%s\"",tname,onm); #endif else #ifdef UNDER_DOS sprintf(cmdstr,"readdisk %s",tname); #else sprintf(cmdstr,"readdisk \"%s\"",tname); #endif if (system(cmdstr)) ret = ERR_READDISK; if (opt != OPT_QUIET) ErrMsg(ret, inm, onm); } } remove(tname); } else { ret = Process_File(inm, onm, cmd, opt, PCRC, pwd); if (opt != OPT_QUIET) ErrMsg(ret, inm, onm); } if (ret != NO_PROBLEM) ext = EXIT_FAILURE; if ((ret == NO_PROBLEM) && (opt != OPT_QUIET)) { switch (cmd) { case CMD_UNPACK: if (inm) fprintf(stderr,"File %s was correctly unpacked to ",inm); else fprintf(stderr,"Data from stdin was correctly unpacked to "); if (onm) fprintf(stderr,"%s\n",onm); else fprintf(stderr,"stdout\n"); break; case CMD_UNPKGZ: if (inm) fprintf(stderr,"File %s was correctly converted to ",inm); else fprintf(stderr,"Data from stdin was correctly converted to "); if (onm) fprintf(stderr,"%s\n",onm); else fprintf(stderr,"stdout\n"); break; case CMD_EXTRACT: if (inm) fprintf(stderr,"The files were correctly extracted from %s\n",inm); else fprintf(stderr,"The files were correctly extracted from stdin\n"); break; case CMD_TEST: if (inm) fprintf(stderr,"File %s is ok\n",inm); else fprintf(stderr,"Data from stdin is ok\n"); break; default: break; } } if (opt != OPT_QUIET) fprintf(stderr,"\n"); } return (int) ext; } static int strcmpnc(char *s1, char *s2){ while (*s1 && (tolower(*s1)==tolower(*s2))) {s1++; s2++;} return tolower(*s1)-tolower(*s2); } static void strcpymax(char *s1, char *s2, int max){ if (strlen(s2)>max){ memcpy(s1,s2,max); *(s1+max) = 0; } else strcpy(s1,s2); } static void strcatmax(char *s1, char *s2, int max){ if (strlen(s1)+strlen(s2)>max){ memcpy(s1+strlen(s1),s2,max-strlen(s1)); *(s1+max) = 0; } else strcat(s1,s2); } static void Usage(void) { printf("\n"); printf(" xDMS v%s - Portable DMS archive unpacker - Public Domain\n", VERSION); printf(" Written by Andre Rodrigues de la Rocha \n"); printf(" Maintained by Heikki Orsila \n\n"); printf(" Usage: xdms [options] { [+output]} \n\n"); printf(" Commands :\n"); printf(" t : Test DMS archives\n"); printf(" u : Unpack DMS archives to disk images\n"); printf(" z : Unpack to disk images and compress it with gzip\n"); printf(" x : Extract files inside DMS archives using readdisk\n"); printf(" v : View DMS archives information\n"); printf(" f : View full information\n"); printf(" d : Show attached FILEID.DIZ\n"); printf(" b : Show attached Banner\n\n"); printf(" Options :\n"); printf(" -f : Override errors (for desperate data salvaging)\n"); printf(" -q : Quiet\n"); printf(" -v : Verbose\n"); printf(" -d : Set destination directory\n"); printf(" -p : Decrypt encrypted archives using password\n"); printf("\n"); } static void ErrMsg(USHORT err, char *i, char *o){ if (!i) i = "stdin"; if (!o) o = "stdout"; switch (err) { case NO_PROBLEM: case FILE_END: return; case ERR_NOMEMORY: fprintf(stderr,"Not enough memory for buffers !\n"); break; case ERR_CANTOPENIN: fprintf(stderr,"Can't open %s for reading !\n",i); break; case ERR_CANTOPENOUT: fprintf(stderr,"Can't open %s for writing !\n",o); break; case ERR_NOTDMS: fprintf(stderr,"File %s is not a DMS archive !\n",i); break; case ERR_SREAD: fprintf(stderr,"Error reading file %s : unexpected end of file !\n",i); break; case ERR_HCRC: fprintf(stderr,"Error in file %s : header CRC error !\n",i); break; case ERR_NOTTRACK: fprintf(stderr,"Error in file %s : track header not found !\n",i); break; case ERR_BIGTRACK: fprintf(stderr,"Error in file %s : track too big !\n",i); break; case ERR_THCRC: fprintf(stderr,"Error in file %s : track header CRC error !\n",i); break; case ERR_TDCRC: fprintf(stderr,"Error in file %s : track data CRC error !\n",i); break; case ERR_CSUM: fprintf(stderr,"Error in file %s : checksum error after unpacking !\n",i); fprintf(stderr,"This file seems ok, but the unpacking failed.\n"); fprintf(stderr,"This can be caused by a bug in xDMS. Please contact the author\n"); break; case ERR_CANTWRITE: fprintf(stderr,"Error : can't write to file %s !\n",o); break; case ERR_BADDECR: fprintf(stderr,"Error in file %s : error unpacking !\n",i); fprintf(stderr,"This file seems ok, but the unpacking failed.\n"); fprintf(stderr,"This can be caused by a bug in xDMS. Please contact the author\n"); break; case ERR_UNKNMODE: fprintf(stderr,"Error in file %s : unknown compression mode used !\n",i); break; case ERR_NOPASSWD: fprintf(stderr,"Can't process file %s : file is encrypted !\n",i); break; case ERR_BADPASSWD: fprintf(stderr,"Error unpacking file %s . The password is probably wrong.\n",i); break; case ERR_FMS: fprintf(stderr,"Error in file %s : this file is not really a compressed disk image, but an FMS archive !\n",i); break; case ERR_GZIP: fprintf(stderr,"Can't convert file %s : gzip failed !\n",i); break; case ERR_READDISK: fprintf(stderr,"Can't extract files from %s : readdisk failed !\n",i); break; default: fprintf(stderr,"Error while processing file %s : internal error !\n",i); fprintf(stderr,"This is a bug in xDMS\n"); fprintf(stderr,"Please contact the author\n"); break; } } xdms-1.3.2/xdms.10000600000175000017510000000271410447526026012572 0ustar tarDebian-NM.TH XDMS 1 "December 11, 2005" .SH NAME xdms \- decompressing Amiga DMS files .SH SYNOPSIS .B xdms [-d destdir] [-p passwd] [-q] [-v] dmsfile [outputfile] .br Commands: .TP .B xdms u Unpack file .TP .B xdms b Show attached banner .TP .B xdms d Show attached FILEID.DIZ .TP .B xdms f View full image information .TP .B xdms t Test archive .TP .B xdms v View DMS archive information .TP .B xdms x Extract files inside DMS archives using readdisk .TP .B xdms z Unpack to disk image and compress with gzip .br .SH DESCRIPTION This manual page documents briefly the .B xdms command. .PP \fBxdms\fP is a tool for decompressing Amiga DMS files. DMS files contain disk images that are these days mainly useful for Amiga emulation. It can unpack DMS images to ADF images. .SH OPTIONS .TP .B \-d destdir Unpack to a separate destination directory. .TP .B \-f Override errors. Useful for desperate data salvaging. .TP .B \-p passwd Decrypt with a password. .TP .B \-q Be quiet. .TP .B \-v Be verbose. .SH Examples To unpack a DMS file, do: .TP xdms u foo.dms .SH BUGS Maybe. .br .SH SEE ALSO .BR amigadepacker (1), .BR lha (1), .BR ppcrack (1), .BR uae (1). .BR unadf (1), .BR unlzx (1), .BR xPK (1) .br .SH AUTHOR xdms was written by Andre' Rodrigues de la Rocha, but now hosted and maintained by Heikki Orsila . .PP This manual page was written by G\[:u]rkan Seng\[:u]n , for the Debian project, and Heikki Orsila .