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.

Noitu Love: Devolution

Featured Replies

  • Author
  • Localization

DPS2004, posted Sat Apr 06, 2019 9:20 pm (46538)


Hello! I am having trouble with getting sprites from this game. I know that this game is in the same engine as Freedom Planet, but the .bms I found did not work. I have attached the assets.dat file.
  • Author
  • Localization

akintos, posted Sun Apr 07, 2019 11:30 am (46544)


Code:
comtype zlib_noerror

goto 0x1c6a #0x83fa #0x841e
for i = 0
    get OFFSET long
    if i == 0
        math MAX_OFF = OFFSET
    endif
    savepos TMP
    if TMP >= MAX_OFF
        break
    endif
    putarray 0 -1 OFFSET
next i

get OFFSET asize
putarray 0 -1 OFFSET
sortarray 0

math FILES = i
for i = 0 < FILES
    getarray OFFSET 0 i
    math i 1
    getarray SIZE   0 i
    math SIZE - OFFSET

    # some files are compressed (probably compressed textures)
    # I try to dump them automatically using this trick

    if SIZE <= 0x10
        log "" OFFSET SIZE
    else
        xmath XOFFSET "OFFSET 0x11"
        xmath XSIZE   "SIZE   - 0x11"
        clog MEMORY_FILE XOFFSET XSIZE XSIZE
        get TMP asize MEMORY_FILE
        if TMP == XSIZE
            log "" OFFSET SIZE
        else
            log "" 0 TMP MEMORY_FILE
        endif
    endif
next
  • Author
  • Localization

DPS2004, posted Sun Apr 07, 2019 12:27 pm (46546)


That just gave me a bunch of other .dat files. Is there anyway to get images out of this?
  • Author
  • Localization

akintos, posted Mon Apr 08, 2019 10:44 am (46627)


Well then try this python script I made. Don't ask me how to run python script.

Code:
from __future__ import print_function

import zlib
import os
import struct

from PIL import Image


OFFSETS_START = 0x1C6A

f = open("Assets.dat", "rb")

offsets = []
f.seek(OFFSETS_START)

start_pos = struct.unpack('offsets.append(start_pos)

while f.tell() <= start_pos:
    offset = struct.unpack('    offsets.append(offset)

if not os.path.isdir('img'):
    os.makedirs('img')

print("Extracting images...")

count = 0
for offset in offsets:
    print(count, end='\r')
    f.seek(offset),
    width, height, comp_size = struct.unpack('
    if width == 0 or height == 0:
        break

    img_data = zlib.decompress(f.read(comp_size))
    img = Image.frombytes("RGBA", (width, height), img_data)
    img.save("img/0xX.png" % offset)

    count = 1

print("\nExtracted %d images from Assets.dat" % count)
  • Author
  • Localization

Doctor Loboto, posted Fri Apr 12, 2019 4:25 pm (46845)


Does this python script work? I've tried it myself with no results, which version of python does it require? I might be too far behind on updates.
  • Author
  • Localization

akintos, posted Fri Apr 12, 2019 4:41 pm (46847)


Doctor Loboto wrote:
which version of python does it require?


I tested on 2.7 and 3.6 with the Assets.dat attached on original post.

Image

You have to put the script and assets file in same directory
and install 'Pillow' python package first (with 'python -m pip install Pillow' command)
  • Author
  • Localization

DPS2004, posted Wed Apr 17, 2019 9:23 pm (47036)


It worked! Thank you so much!
Guest
This topic is now closed to further replies.

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.