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.
Zero Tolerance for Disrespect

Dies Irae - make import script from python export script

Featured Replies

  • Author
  • Localization

masagrator, posted Thu Feb 21, 2019 6:03 am (45070)


Hello. I got working export script for game Dies Irae from github Inori/*SPAM*
Someone could help to make it importing text? This script can bring english translation for Dies Irae to Switch and Android version.

Code:
# -*- coding:utf-8 -*-

import struct,os,fnmatch,re,tempfile

def byte2int(byte):
    long_tuple=struct.unpack('L',byte)
    long = long_tuple[0]
    return long

def int2byte(num):
    return struct.pack('L',num)

def FormatString(string, count):
    res = "Lined\n%s\n"%(count, string '\n')
   
    return res

def GetEntry(src):
    start = 0x338CED
    src.seek(start)
    end = 0x389250 -4
    count = (end-start)//8

    entry_list = []
    for i in range(0, count):
        offset = byte2int(src.read(4))
        length = byte2int(src.read(4))
        entry_list.append([offset, length])
    return entry_list

src = open('exec.dat', 'rb')
dst = open('switch.dat.txt', 'w', encoding='utf16')
entry = GetEntry(src)

j = 0
for [offset, length] in entry:
    src.seek(offset 0x389250)
    bstring = src.read(length)
    string = bstring.decode('sjis', errors='ignore')
    dst.write(FormatString(string,j))
    #dst.write(string[:-2] '\n')
    j = 1

src.close()
dst.close()   


And in exec.zip from attachment is exec.dat.
  • Author
  • Localization

masagrator, posted Mon Feb 25, 2019 1:55 pm (45266)


I made cleaner export script for people who got afraid of dictionary.
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.