PSOBB Quest Assembler, Disassembler + Source

Sodaboy

Sodabob
Staff member
Gender
Male
Guildcard
11111111
UPDATE 6/20/2022:

- Made the quest_disasm tool export strings by default.
- Using quest_asm tool with -s parameter will import strings from .pasm.strings file for the quest.
- Maybe some bug fixes? (I don't recall how old the public version was before this, but I don't think it was TOO different.)
- Loads asm.txt from the same folder that quest*.exe is launched from.

UPDATE 6/15/2019:

- Fixed a crashing bug with quest_asm when a percent sign is inside of a string of a PASM script.
- Fixed a disassembly bug with quest_disasm when arguments are register values but the argument type isn't defined as a register in the asm.txt file (First seen in Gallon's Shop "particle2" command.)

UPDATE 5/23/2019:

Updated again 5/23/2019 to fix a spacing issue when a function definition had a command after a "TAB" for quest_asm. Also fixed detection of HEX and STR functions when they're pushed as ARGS for quest_disasm.

Updated again 5/12/2019 to fix bug with STR and HEX with quest_asm.

OK, now the assembler and disassembler output and processing has been done again.

Now the disassembler exports .pasm files that can be directly imported into Qedit. (It also fixes the problem with va_start and va_end arguments not being written to the .pasm file.)

Also, the assembler will import .pasm files that are spaced as Qedit spaces them. (Though it's still less picky about spacing compared to Qedit.)

When the disassembler is ran, a file with the extension .pasm.header is also created, which contains the quest name, quest number, short and long descriptions.

If you run the disassembler against a .QST file instead of a .BIN file, it will also extract the .DAT file.

All three, the .pasm.header, .pasm, and .DAT are required for the assembler to create a compressed .QST for server use. If the .DAT file is missing, the assembler will only create a .BIN file.

You can download both the ASM and DISASM tool from https://files.pioneer2.net/quest_asmdisasm.zip

The source code for the disassembler is at https://files.pioneer2.net/quest_disasm.cpp

The source code for the assembler is at https://files.pioneer2.net/quest_asm.cpp

Both the assembler and disassembler require asm.txt, which Qedit also recognizes, which can be found in the ZIP file above or you can just grab it from https://files.pioneer2.net/asm.txt

Cheers!

P.S. The PRS library used in the .EXE and code was from the Sylverant server code. It's PRS library is free to use but I would never distribute it since it's not mine to distribute. If you need a PRS library, you can download it from https://sourceforge.net/p/sylverant/pso_tools/ci/master/tree/prstool/
 
Last edited:
Thanks, this helped me figure out the .qst file format and where quest names etc. are located in .bin files.
 
Would you be willing to comment the code a bit or jot down some documentation here on the forums? I'm looking into .bin files again and I'm wondering what hex/str/... functions are for example. Str functions are functions like message, add_msg, window_msg,...? What does scriptOffset and binOfs exactly stand for?

I'm mainly trying to figure out which episode the quest is for and which map versions should be used (set_episode, BB_Map_Designate, map_designate, map_designate_ex,...).

Any help would be much appreciated.

And if you don't mind I'd like to add the information to this document: https://docs.google.com/document/d/1B8bQsCJ9gU005INzePoK8fekj0O3Vootsq1FEpa8m6Y/edit#

Eventually I want to turn this into a wiki so anyone can contribute and all this info will easily be found in one place.
 
I was looking for a tool to extract .pasm files in batch, thanks!
 
Updated the disassembler to extract the .dat too.
EDIT: Updated again to make arguments pushed on the same line as the called procedure.
 
Last edited:
Updated this today.

Changes:

- Made the quest_disasm tool export strings by default.
- Using quest_asm tool with -s parameter will import strings from .pasm.strings file for the quest.
- Maybe some bug fixes? (I don't recall how old the public version was before this, but I don't think it was TOO different.)
- Loads asm.txt from the same folder that quest*.exe is launched from.
 
Last edited:
Back
Top