Jump to content

PlayFirst [.pfpk] and [.lua]


Recommended Posts

Posted (edited)

I'm working with the game GeminiLost from playfirst, they have an assets.pfp file that can be extracted using a BMS script [https://aluigi.altervista.org/bms/pfpk.bms].


After extraction it is possible to see lua scripts that were compiled using lua 5.0:
image.png.3beaddc662e46385ca691744c39d627d.png

scripts.zip

I try to use ChunkBake, luadec, unluac and they all always give the same error, using ChunkSpy it is possible to see that you can identify a large part of the file but at the end it shows an error at the end:

Pos   Hex Data           Description or Code
------------------------------------------------------------------------
0000                     ** source chunk: ok.lua
                         ** global header start **
0000  1B4C7561           header signature: "\27Lua"
0004  50                 version (major:minor hex digits)
0005  01                 endianness (1=little endian)
0006  04                 size of int (bytes)
0007  04                 size of size_t (bytes)
0008  04                 size of Instruction (bytes)
0009  06                 size of OP (bits)
000A  08                 size of A (bits)
000B  09                 size of B (bits)
000C  09                 size of C (bits)
000D  08                 size of number (bytes)
000E  B6099368E7F57D41   sample number (double)
                         * x86 standard (32-bit, little endian, doubles)
                         ** global header end **

0016                     ** function [0] definition (level 1)
                         ** start of function **
0016  08000000           string size (8)
001A  3D286E6F6E652900   "=(none)"
                         source name: =(none)
0022  00000000           line defined (0)
0026  00                 nups (0)
0027  00                 numparams (0)
0028  00                 is_vararg (0)
0029  11                 maxstacksize (17)
                         * lines:
002A  00000000           sizelineinfo (0)
                         [pc] (line)
                         * locals:
002E  00000000           sizelocvars (0)
                         * upvalues:
0032  00000000           sizeupvalues (0)
                         * constants:
0036  36000000           sizek (54)
003A  04                 const type 4
003B  08000000           string size (8)
003F  7265717569726500   "require"
                         const [0]: "require"
0047  04                 const type 4
0048  12000000           string size (18)
004C  736372697074732F+  "scripts/"
0054  7374796C652E6C75+  "style.lu"
005C  6100               "a\0"
                         const [1]: "scripts/style.lua"
005E  04                 const type 4
005F  0B000000           string size (11)
0063  4D616B654469616C+  "MakeDial"
006B  6F6700             "og\0"
                         const [2]: "MakeDialog"
006E  04                 const type 4
006F  07000000           string size (7)
0073  4269746D617000     "Bitmap"
                         const [3]: "Bitmap"
007A  04                 const type 4
007B  06000000           string size (6)
007F  696D61676500       "image"
                         const [4]: "image"
0085  04                 const type 4
0086  1A000000           string size (26)
008A  75692F7375726661+  "ui/surfa"
0092  6365732F626C6163+  "ces/blac"
009A  6B5F616C70686137+  "k_alpha7"
00A2  3000               "0\0"
                         const [5]: "ui/surfaces/black_alpha70"
00A4  04                 const type 4
00A5  06000000           string size (6)
00A9  7363616C6500       "scale"
                         const [6]: "scale"
00AF  03                 const type 3
00B0  0000000000007940   const [7]: (400)
00B8  04                 const type 4
00B9  05000000           string size (5)
00BD  6E616D6500         "name"
                         const [8]: "name"
00C2  04                 const type 4
00C3  10000000           string size (16)
00C7  7965736E6F626163+  "yesnobac"
00CF  6B67726F756E6400   "kground\0"
                         const [9]: "yesnobackground"
00D7  04                 const type 4
00D8  19000000           string size (25)
00DC  7375726661636573+  "surfaces"
00E4  2F6D656E752F706F+  "/menu/po"
00EC  7075705F68656C70+  "pup_help"
00F4  00                 "\0"
                         const [10]: "surfaces/menu/popup_help"
00F5  04                 const type 4
00F6  02000000           string size (2)
00FA  7800               "x"
                         const [11]: "x"
00FC  04                 const type 4
00FD  08000000           string size (8)
0101  6B43656E74657200   "kCenter"
                         const [12]: "kCenter"
0109  04                 const type 4
010A  02000000           string size (2)
010E  7900               "y"
                         const [13]: "y"
0110  03                 const type 3
0111  0000000000005940   const [14]: (100)
0119  04                 const type 4
011A  09000000           string size (9)
011E  5365745374796C65+  "SetStyle"
0126  00                 "\0"
                         const [15]: "SetStyle"
0127  04                 const type 4
0128  16000000           string size (22)
012C  4372656174655075+  "CreatePu"
0134  7368427574746F6E+  "shButton"
013C  5374796C6500       "Style\0"
                         const [16]: "CreatePushButtonStyle"
0142  04                 const type 4
0143  17000000           string size (23)
0147  5374616E64617264+  "Standard"
014F  427574746F6E4772+  "ButtonGr"
0157  61706869637300     "aphics\0"
                         const [17]: "StandardButtonGraphics"
015E  04                 const type 4
015F  13000000           string size (19)
0163  44656661756C7442+  "DefaultB"
016B  7574746F6E536F75+  "uttonSou"
0173  6E6400             "nd\0"
                         const [18]: "DefaultButtonSound"
0176  04                 const type 4
0177  07000000           string size (7)
017B  427574746F6E00     "Button"
                         const [19]: "Button"
0182  04                 const type 4
0183  06000000           string size (6)
0187  636C6F736500       "close"
                         const [20]: "close"
018D  04                 const type 4
018E  06000000           string size (6)
0192  666C61677300       "flags"
                         const [21]: "flags"
0198  03                 const type 3
0199  0000000000001440   const [22]: (5)
01A1  04                 const type 4
01A2  03000000           string size (3)
01A6  6F6B00             "ok"
                         const [23]: "ok"
01A9  04                 const type 4
01AA  05000000           string size (5)
01AE  6B4D617800         "kMax"
                         const [24]: "kMax"
01B3  03                 const type 3
01B4  0000000000004D40   const [25]: (58)
01BC  04                 const type 4
01BD  0B000000           string size (11)
01C1  4372656174655465+  "CreateTe"
01C9  787400             "xt\0"
                         const [26]: "CreateText"
01CC  03                 const type 3
01CD  000000000000F03F   const [27]: (1)
01D5  03                 const type 3
01D6  0000000000001040   const [28]: (4)
01DE  03                 const type 3
01DF  0000000000000000   const [29]: (0)
01E7  04                 const type 4
01E8  10000000           string size (16)
01EC  4372656174655465+  "CreateTe"
01F4  78745374796C6500   "xtStyle\0"
                         const [30]: "CreateTextStyle"
01FC  04                 const type 4
01FD  0C000000           string size (12)
0201  4C6974686F636170+  "Lithocap"
0209  73656400           "sed\0"
                         const [31]: "Lithocapsed"
020D  03                 const type 3
020E  0000000000002C40   const [32]: (14)
0216  04                 const type 4
0217  0B000000           string size (11)
021B  426C61636B436F6C+  "BlackCol"
0223  6F7200             "or\0"
                         const [33]: "BlackColor"
0226  04                 const type 4
0227  09000000           string size (9)
022B  466F6E7447616D65+  "FontGame"
0233  00                 "\0"
                         const [34]: "FontGame"
0234  03                 const type 3
0235  0000000000003440   const [35]: (20)
023D  04                 const type 4
023E  05000000           string size (5)
0242  5465787400         "Text"
                         const [36]: "Text"
0247  04                 const type 4
0248  08000000           string size (8)
024C  6F6B7469746C6500   "oktitle"
                         const [37]: "oktitle"
0254  03                 const type 3
0255  0000000000004E40   const [38]: (60)
025D  03                 const type 3
025E  0000000000004440   const [39]: (40)
0266  04                 const type 4
0267  02000000           string size (2)
026B  7700               "w"
                         const [40]: "w"
026D  04                 const type 4
026E  02000000           string size (2)
0272  6800               "h"
                         const [41]: "h"
0274  04                 const type 4
0275  0E000000           string size (14)
0279  6B56416C69676E43+  "kVAlignC"
0281  656E74657200       "enter\0"
                         const [42]: "kVAlignCenter"
0287  04                 const type 4
0288  0C000000           string size (12)
028C  6B48416C69676E4C+  "kHAlignL"
0294  65667400           "eft\0"
                         const [43]: "kHAlignLeft"
0298  04                 const type 4
0299  06000000           string size (6)
029D  6C6162656C00       "label"
                         const [44]: "label"
02A3  04                 const type 4
02A4  0D000000           string size (13)
02A8  674469616C6F6754+  "gDialogT"
02B0  61626C6500         "able\0"
                         const [45]: "gDialogTable"
02B5  04                 const type 4
02B6  06000000           string size (6)
02BA  7469746C6500       "title"
                         const [46]: "title"
02C0  04                 const type 4
02C1  0B000000           string size (11)
02C5  5768697465436F6C+  "WhiteCol"
02CD  6F7200             "or\0"
                         const [47]: "WhiteColor"
02D0  04                 const type 4
02D1  07000000           string size (7)
02D5  6F6B626F647900     "okbody"
                         const [48]: "okbody"
02DC  03                 const type 3
02DD  0000000000805B40   const [49]: (110)
02E5  03                 const type 3
02E6  0000000000004740   const [50]: (46)
02EE  03                 const type 3
02EF  0000000000005E40   const [51]: (120)
02F7  03                 const type 3
02F8  0000000000805140   const [52]: (70)
0300  04                 const type 4
0301  05000000           string size (5)
0305  626F647900         "body"
                         const [53]: "body"
                         * functions:
030A  00000000           sizep (0)
                         * code:
030E  6F000000           sizecode (111)
0312  05000000           [001] getglobal  0   0        ; require
0316  41000001           [002] loadk      1   1        ; "scripts/style.lua"
031A  5D000100           [003] tforloop   0       1    ; to [5] if exit
031E  85000000           [004] getglobal  0   2        ; MakeDialog
0322  0A800001           [005] newtable   1   1   0    ; array=1, hash=0
0326  C5000002           [006] getglobal  2   3        ; Bitmap
032A  8A800003           [007] newtable   3   1   2    ; array=1, hash=4
032E  C93F7F03           [008] settable   3   254 255  ; "image" "ui/surfaces/black_alpha70"
0332  49408003           [009] settable   3   256 257  ; "scale" 400
0336  C5000004           [010] getglobal  4   3        ; Bitmap
033A  CA000305           [011] newtable   5   6   3    ; array=6, hash=8
033E  C9408105           [012] settable   5   258 259  ; "name" "yesnobackground"
0342  09417F05           [013] settable   5   254 260  ; "image" "surfaces/menu/popup_help"
0346  05030006           [014] getglobal  6   12       ; kCenter
034A  89818205           [015] settable   5   261 6    ; "x"
034E  05030006           [016] getglobal  6   12       ; kCenter
0352  0D420306           [017] sub        6   6   264  ; 100
0356  89818305           [018] settable   5   263 6    ; "y"
035A  C5030006           [019] getglobal  6   15       ; SetStyle
035E  05040007           [020] getglobal  7   16       ; CreatePushButtonStyle
0362  45040008           [021] getglobal  8   17       ; StandardButtonGraphics
0366  85040009           [022] getglobal  9   18       ; DefaultButtonSound
036A  1D800107           [023] tforloop   7       0    ; to [25] if exit
036E  9D000006           [024] tforloop   6       2    ; to [26] if exit
0372  C5040007           [025] getglobal  7   19       ; Button
0376  CA800108           [026] newtable   8   3   3    ; array=3, hash=8
037A  02800009           [027] loadbool   9   1   0    ; true
037E  49028708           [028] settable   8   270 9    ; "close"
0382  09C48708           [029] settable   8   271 272  ; "flags" 5
0386  49448108           [030] settable   8   258 273  ; "name" "ok"
038A  05030009           [031] getglobal  9   12       ; kCenter
038E  49828208           [032] settable   8   261 9    ; "x"
0392  05060009           [033] getglobal  9   24       ; kMax
0396  CDC40409           [034] sub        9   9   275  ; 58
039A  49828308           [035] settable   8   263 9    ; "y"
039E  85060009           [036] getglobal  9   26       ; CreateText
03A2  C106000A           [037] loadk      10  27       ; 1
03A6  0107000B           [038] loadk      11  28       ; 4
03AA  C105000C           [039] loadk      12  23       ; "ok"
03AE  4107000D           [040] loadk      13  29       ; 0
03B2  4107000E           [041] loadk      14  29       ; 0
03B6  9D000309           [042] tforloop   9       2    ; to [44] if exit
03BA  C503000A           [043] getglobal  10  15       ; SetStyle
03BE  8507000B           [044] getglobal  11  30       ; CreateTextStyle
03C2  C507000C           [045] getglobal  12  31       ; Lithocapsed
03C6  0108000D           [046] loadk      13  32       ; 14
03CA  4508000E           [047] getglobal  14  33       ; BlackColor
03CE  1D00020B           [048] tforloop   11      0    ; to [50] if exit
03D2  9D00000A           [049] tforloop   10      2    ; to [51] if exit
03D6  8506000B           [050] getglobal  11  26       ; CreateText
03DA  4107000C           [051] loadk      12  29       ; 0
03DE  4107000D           [052] loadk      13  29       ; 0
03E2  C105000E           [053] loadk      14  23       ; "ok"
03E6  4107000F           [054] loadk      15  29       ; 0
03EA  41070010           [055] loadk      16  29       ; 0
03EE  1D00030B           [056] tforloop   11      0    ; to [58] if exit
ChunkSpy: A Lua 5.0.2 binary chunk disassembler
Version 0.9.7 (20050605)  Copyright (c) 2004-2005 Kein-Hong Man
The COPYRIGHT file describes the conditions under which this
software may be distributed (basically a Lua 5-style license.)

* Run with option -h or --help for usage information
ChunkSpy:392: bad argument #1 to `len' (string expected, got nil)

ChunkBake:
 

ChunkBake: A Lua 5 binary chunk assembler
Version 0.7.0 (20050512)  Copyright (c) 2005 Kein-Hong Man
The COPYRIGHT file describes the conditions under which this
software may be distributed (basically a Lua 5-style license.)

* Run with option -h or --help for usage information
ChunkBake:260: ok.lua:1: Error: unknown character or control character

 

I'm confused, do I need to make any changes to all the .lua files in the game or is there an error when unzipping the .pfp file?

Edited by JeanxPereira
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...