System25 / drxtract

Macromedia Director 5 DRI and DRX files data extractor
GNU General Public License v2.0
22 stars 4 forks source link

Can't extract images #7

Closed gmarty closed 4 years ago

gmarty commented 4 years ago

I'm using dxrxtract on a 275 KB .dxr file that contains, among other assets, 4 images. I get empty bitmap files and this kind of error messages:

INFO:root:Casting element number 21 is 52.CASt file!
DEBUG:root:data_type = 00000001
DEBUG:root:additional_size = 00000024
DEBUG:root:header_size = 0000001c
DEBUG:root:contentMarker? = 00000014
DEBUG:root:basic_data00 = 00000000
DEBUG:root:basic_data01 = 00000000
DEBUG:root:basic_data02 = 00000000
DEBUG:root:basic_data03: 00000000
DEBUG:root:number of structures contained = 2
DEBUG:root:stindx[0] = 00000000
DEBUG:root:stindx[1] = 00000000
DEBUG:root:stindx[2] = 00000002
DEBUG:root:The 0 element of the structure is 0 bytes long
DEBUG:root:The 1 element of the structure is 2 bytes long
DEBUG:root:Cast member name: ''
DEBUG:root:../brf/bin/52.CASt: data_type = 1
INFO:root:../brf/bin/52.CASt: is a image file
DEBUG:root:flags = 130
WARNING:root:Unknown BPP value: 136
DEBUG:root:bmp_bpp = 8
DEBUG:root:unknown_11 = 0
DEBUG:root:h_padding = 26880
DEBUG:root:w_padding = -21759
DEBUG:root:bmp_height = 23553
DEBUG:root:bmp_width = -4352
DEBUG:root:top = 2304
DEBUG:root:left = 0
DEBUG:root:bottom = 0
DEBUG:root:right = 0
DEBUG:root:center_y = -2559
DEBUG:root:center_x = 19720
DEBUG:root:bitdepth = 4351
DEBUG:root:palette = -257
DEBUG:root:Related file: 61.BITD
DEBUG:root:Using a default palette: none
INFO:root:Saving file content to: 61.bmp
ERROR:root:Bad BPP value (4351)
DEBUG:root:Related file: 55.THUM
WARNING:root:There is no ../brf/bin/55.THUM file (maybe empty file)
INFO:root:Casting element number 22 is 97.CASt file!
DEBUG:root:data_type = 0000000e
DEBUG:root:additional_size = 00000000
DEBUG:root:header_size = 00000006
DEBUG:root:../brf/bin/97.CASt: data_type = 14
INFO:root:../brf/bin/97.CASt: is a transition
DEBUG:root:smoothness = 4
Traceback (most recent call last):
  File "./casxtract", line 972, in <module>
    lctx_elements, lnam_file)
  File "./casxtract", line 793, in parse_cast_file
    transition =  struct.unpack(cast_bit_order+"B", header_data[idx])[0]
TypeError: a bytes-like object is required, not 'int'
DEBUG:root:./vwscxtract ../brf

When I use other decompilation methods, this image should have dimensions of 324 × 243.

The image is detected but the dimensions are obviously wrong. I'm happy to provide the .dxr file if that helps.

System25 commented 4 years ago

It seems that there is some problem with the CASt files. The DXR file is a Macromedia Director 4 or 5 file? At this moment I'm focused in Director 4.

Best regards!

gmarty commented 4 years ago

This is possible. How can I find out the version used?

System25 commented 4 years ago

Check if a "config.json" file was generated inside the "cas" directory. If was parsed successfully It would contain a "version" value:

{
    "castArrayEnd": 8,
    "castArrayStart": 1,
    "currentFrameRate": 3840,
    "palette": "systemMac",
    "stageBottom": 624,
    "stageColor": 0,
    "stageLeft": 192,
    "stageRight": 832,
    "stageTop": 144,
    "version": "dir4"
}

In this example you can see a Director 4 config.json file.

gmarty commented 4 years ago

The version says published. It's from a CD-rom released on September 1998. According this Wikipedia article, it must be version 6.5 since it uses QuickTime and Xtra.

So unfortunately it doesn't seem to be compatible with drxtract :-( Good job on this tool and I hope you implement support for versions above 5 at some point.