Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

Deadly Premonition Directors Cut (PC) DPSerial

Featured Replies

  • Supporter

The dirty way.... Thing is each resource is aligned to 16 bytes and i don't know how to do it in bms. I tried padding but it fails.

get FileSize asize
get BaseFileName basename
get FileExtension extension


for
	FindLoc ResOffset string "\x44\x3A\x5C\x70\x72\x6F\x67\x72\x61\x6D\x6D\x65\x72\x5F\x50\x43"
	goto ResOffset
	savepos StrOffset
	get FilePath string
	goto StrOffset
	getdstring Dummy 0x100
	get ResourceSize uint32
	savepos ResourceOffset
	getdstring ResourceData ResourceSize
	
	string Name p "%s/%s/%s" BaseFileName FileExtension FilePath
	#print "%Name%"
	log Name ResourceOffset ResourceSize
next

Also i can see some files uses zlib/deflate compression.

Edited by h3x3r

  • Localization
19 hours ago, h3x3r said:

The dirty way.... Thing is each resource is aligned to 16 bytes and i don't know how to do it in bms. I tried padding but it fails.

In most games, if the file data is already a multiple of 16 bytes, the padding is 0 bytes, but in this one it's actually 16 bytes. It implies that there must be a single null byte after the file data, and then the padding is calculated. So perhaps you just need to work out the padding based on (length+1)%16 . I don't know how that's written in BMS.

So I wrote the specs like this:

+--------------------------------------+
| Deadly Premonition *.001 *.002 *.003 |
+--------------------------------------+

// DETAILS AND FILE DATA
  // for each file
    256 - Filename (null terminated, filled with (byte)204)
    4 - File Length
    X - File Data
    1 - null
    X - null Padding so that (FileData+null) is a multiple of 16 bytes

As you pointed out, many of the files seem to use ZLib compression - these are 2 of them...

XPC seems to be a texture archive, where each file is a compressed DDS image.

+--------------------------+
| Deadly Premonition *.xpc |
+--------------------------+

// HEADER
  4 - Header (XPC2)
  4 - File Length
  2 - Unknown
  2 - Unknown
  4 - Unknown (1)
  4 - Unknown (1)
  12 - null
  4 - Directory Offset (64)
  4 - File Data Offset
  24 - null
  
// DIRECTORY
  // for each file
    16 - Filename (null terminated, filled with nulls)
    4 - File Offset
    4 - Compressed File Length
    4 - Unknown
    4 - Decompressed File Length [>>8]
    
// FILE DATA
  // for each file
    X - File Data (ZLib Compression)

The XAM file seems to be a 3D Model made up of multiple parts, where each part if ZLib compressed. This differs from the XMD files which seem to be a 3D Model with only a single part in it. The individual "files" (or meshes) in the XAM have the same format as the XMD files.

+--------------------------+
| Deadly Premonition *.xam |
+--------------------------+

// HEADER
  4 - Header (XAM2)
  4 - File Length
  2 - Unknown
  2 - Unknown
  4 - Unknown
  4 - Unknown (256)
  12 - null
  4 - Unknown
  4 - Unknown
  4 - Unknown
  4 - Directory Offset (80)
  4 - File Data Offset
  24 - null
  4 - Unknown
  
// DIRECTORY
  // for each file
    15 - Filename (null terminated, filled with nulls)
    1 - Unknown ID?
    
// FILE DATA
  // for each file
    4 - Header (XZP1)
    4 - File Length (including these header fields)
    4 - Compressed File Length (File Data only)
    4 - Decompressed File Length
    X - File Data (ZLib Compression)
    X - null padding so the compressed data is a multiple of 16 bytes

Edited by wattostudios

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.