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.

Corrupted Lua and XMLs when extracting from .pfp

Featured Replies

  • Author
  • Localization

Times New Woman, posted Sun Oct 14, 2018 6:57 am (39530)


(I wasn't sure whether to post this here or in Code Talk, but I feel like it should go here.)

https://drive.google.com/open?id=1NQ6IX ... x7f1YL7TeE

Attached is a .rar containing the .pfp code, an example Lua file and the pfp I extracted it from.
The Lua appears to have the heading "LuaP" but after that it appears as garbled crap in Notepad .
I don't know if it's an issue with the .pfp extraction code or the header. This problem has occurred for all the Lua (and XML, as those are garbled too) files extracted from the pfp.
Does anyone know why this problem happens?
  • Author
  • Localization

aluigi, posted Sun Oct 14, 2018 7:47 am (39531)


I guess you have to post in the topic (if any) that has been open for this specifc game (what game?) and this pfp format.

Your file is not visible to everybody.
  • Author
  • Localization

Times New Woman, posted Sun Oct 14, 2018 9:31 pm (39583)


I've made the .rar file public (because I'm dumb).
The .pfp is the compressed assets file and not the panorama sort.
The .pfp and corresponding ripped (corrupted?) .lua are from a game called Fitness Dash, but I've experienced the same issue with quite a few games I've tried ripping .pfp contents from. I'm pretty certain that the game I'm ripping doesn't have an active topic, and I don't want to necro.

Sorry if I'm being an idiot.
  • Author
  • Localization

aluigi, posted Tue Oct 16, 2018 9:51 am (39610)


ok so you used the pfpk.bms script from my website.

The lua files are simply compiled which is very common in games, therefore you just need a decompiler.
There are various decompilers available, if you need an advice try to search the following on google:
luadec site:zenhax.com
  • Author
  • Localization

aluigi, posted Tue Oct 16, 2018 9:53 am (39611)


xml files are simply compressed.
Try this script on them:
Code:
idstring "ZXML"
get ZSIZE long
get SIZE long
savepos OFFSET
get NAME filename
clog NAME OFFSET ZSIZE SIZE
  • Author
  • Localization

Times New Woman, posted Tue Oct 16, 2018 10:08 am (39612)


Thanks, now the unzipped xml files are readable.
Is there any way to do the same with the Lua files?
The first readable part in all the 'broken' Lua files is "LuaP" if that helps.
  • Author
  • Localization

aluigi, posted Tue Oct 16, 2018 11:18 am (39613)


Eh you missed my previous post :)
  • Author
  • Localization

Times New Woman, posted Tue Oct 16, 2018 8:18 pm (39625)


...So does the zxml script work with the Lua files as well?
  • Author
  • Localization

Times New Woman, posted Fri Nov 09, 2018 10:24 pm (39761)


I've tried searching for a script to unzip the LuaP files, but the one I did find doesn't work at all. The zxml script works perfectly. I'm a huge idiot, so: I'd like to be able to both extract and reimport the Lua files from the LuaP one.
  • Author
  • Localization

Times New Woman, posted Sat Nov 10, 2018 10:47 pm (40271)


sorry, I'm an idiot. I've tried looking for one just now but I can't find anything I know how to use at all. I'm probably just too dumb to try and use any of them. Do you know one that's easy to use for a coding imbecile like me?
  • Author
  • Localization

aluigi, posted Mon Nov 12, 2018 11:10 am (40295)


Come on don't say that.
Often people have problems with lua decompilers due to the various versions and the bugs in the decompilers.

For example Lua 5.0 ("LuaP") can be decompiled by some very old tools like:
http://files.luaforge.net/releases/luadec/luadec/0.6
http://files.luaforge.net/releases/chun ... -bin-0.7.0
http://files.luaforge.net/releases/chun ... -win32-bin
BUT none of them works with your customers.lua returning some "bad code" error.
Maybe just chunkspy gives some results but not exactly what you want.

Honestly I can't help you further so good luck.
  • Author
  • Localization

Visual917, posted Mon May 27, 2019 2:56 am (48059)


I'm working on a PlayFirst game myself...
1. I can decrypt XML files using your script, but how can I put it back to ZXML for the game to use? Can I encrypt it using another script of yours?
2. I still can't decrypt the lua files. It says LuaP in the beginning.

Please help me :(
  • Author
  • Localization

aluigi, posted Tue May 28, 2019 10:09 am (48073)


1)
Code:
comtype zlib_compress
get SIZE asize
log MEMORY_FILE 0 0
putdstring "ZXML" 4 MEMORY_FILE
put 0 long MEMORY_FILE
put SIZE long MEMORY_FILE
savepos OFFSET MEMORY_FILE
append
clog MEMORY_FILE 0 SIZE SIZE
append
get ZSIZE asize MEMORY_FILE
math ZSIZE - OFFSET
goto 4 MEMORY_FILE
put ZSIZE long MEMORY_FILE
get NAME basename
string NAME ".zxml"
get SIZE asize MEMORY_FILE
log NAME 0 SIZE MEMORY_FILE


2)
Maybe try a different lua 5.0 decompiler
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.