The Forum is up for sale: XeNTaX Forum looking for new owner

identify algorithm

Read or post about compression. And decompression. Or ask questions how to decompress your files.
Post Reply
User avatar
peter2005
advanced
Posts: 42
Joined: Fri Mar 25, 2016 8:26 am
Location: None
Has thanked: 1 time
Been thanked: 9 times

identify algorithm

Post by peter2005 »

This is going to be just a shot in the dark.

I'm looking for a help on decompression algo from an old DOS game.
I've spend several hours of debugging with DOSBOX just to find it and to unsuccessfully rewrite it to my tool.


This is only small part(beginning) of whole code.

Code: Select all


		xor	cl, cl             - iteration loop
		mov	ax, [si]           - 1st and 2nd byte from compressed data
		mov	dx, [si+1]         - 2nd and 3rd byte from compressed data
		shr	dx, cl
		shr	ax, cl
		or	ah, dl
		shr	dx, 1
		shr	ax, 1
		pushf
		or	ah, dl
		inc	cl
		and	cl, 7              - only 7 times
		jnz	short loc_29F16
		inc	si
		call	sub_29FCF
		popf
		jnb	short loc_29F21
		stosb			  - store decompressed byte

Actually algo is is much longer and numerous jump branches are present.

There are also only two constants used 0x1fff 0x3ff.


Any idea what type of algorithm is it?
WRS
ultra-veteran
ultra-veteran
Posts: 603
Joined: Fri Nov 06, 2009 12:13 am
Has thanked: 74 times
Been thanked: 136 times

Re: identify algorithm

Post by WRS »

this isn't enough to go on can you dump the disaassembly with addresses? 8)

also, no idea why this tries shifting right with cl, when cl is 0!
Useful tool links:
User avatar
peter2005
advanced
Posts: 42
Joined: Fri Mar 25, 2016 8:26 am
Location: None
Has thanked: 1 time
Been thanked: 9 times

Re: identify algorithm

Post by peter2005 »

Hi , check the attachment , subroutine calls deal mostly with comparing processed file size to total file size and with reading another pair of data.
You do not have the required permissions to view the files attached to this post.
Post Reply