deguix 65 Report post Posted September 13, 2017 (edited) It decompiles the .bin files from many top/pko versions. Easy to use: just extract, edit user.lua file (documentation of functions are in there) and run the bat file. I didn't test this with all versions (technically, only versions 4 and 5 were tested, but other versions should work). Here's the link: https://drive.google.com/file/d/0B0QOetVFt_yXX0N5d0t4OFJwcGs/view?usp=sharing&resourcekey=0-AAK4j3hDVILCb5hi-Y8o7Q The latest version can be found with the top-recode project: https://gitlab.com/deguix/top-recode/-/tree/master/helpers. To get it to work in standalone (like with the old version), download the old version first, and just replace the old "decompiler.lua" file with the new one. (so far no changes afaik) Discord: https://discord.gg/uwcR74E (same as top-recode project, go to "#top-decompiler" channel). I don't develop much for it anymore because TOP/KOP/PKO are all gone, but I'm still updating version "9" which is for decompiling top-recode .bins themselves. --- (section refering to its first lua version) The 7z has the LuaJit 2.1.0-beta3 binary files with forward lua 5.2 compatibility (compatibility is not needed for these files though, its just that I use it for everything). This is a new version with the same version number as last release in s*****d**, except I added texture decrypting functions (along with the updated luajit). Now for some personal comments: - It originally was made in Python. It is better and faster in luajit than in Python. I've had many issues with Python, mostly syntax-wise. Lua is not perfect, but from what i've seen, it's the best for me. Believe me, I'm very picky with the syntax. - The Python version had many extra version numbers for top/pko versions that don't exist anymore. I didn't add them because no files use old TOP/PKO versions. If there's a version you need, tell me, I'll re-add it. - I didn't publish it here earlier because I wanted to make the syntax even better - but lately I've been busy with other projects. - item.lit is a bin file (in scripts/txt folder) - this can't decompile it because the sub-items are also binary files (the size of an item varies, all other bins have invariant items). - I've even made a version that could run on lua 5.0 (what server runs), but won't release it anymore because server/client source code is available and i'm fixing the client. So far both the server and client are both running luajit. - Re-release of other projects will have to wait until I finish the above. Please comment if it's not working. I know that I've tested it with an older luajit build, but I didn't do it yet with the newer one. Edited October 3, 2021 by deguix updated link 3 Quote Share this post Link to post Share on other sites
Crescendo 0 Report post Posted September 14, 2017 I'm getting " luajit: decompiler.lua:589: ´end´ expected to <to close ´function´ at line 580> near ´return´ ". Double checked the bins file path and all, but won't decompile. Quote Share this post Link to post Share on other sites
deguix 65 Report post Posted September 15, 2017 (edited) oh, remove "return n", it should work (function sub_f is not used yet). EDIT: I just tested it with top2 files and it seems that I got some weird strings on skillinfo, and 1 at terraininfo for 1 item. Everything else seems fine though. I'm going to try to fix them today. EDIT#2: Fixed. Version 1.0.5: - Fixed: lua syntax error above ^^. - Fixed: static function flag parameter wasn't being used. - Fixed: TerrainInfo uses byte instead of ulong for the 1? and 2? params (sry no good names yet). Edited September 15, 2017 by deguix Quote Share this post Link to post Share on other sites
Crescendo 0 Report post Posted September 24, 2017 (edited) Tried decompiling certain iteminfo, but kept getting the error below. Tested with a different iteminfo and works fine. Any idea if it is because the iteminfo is a different version or in some way encrypted?. Edited September 24, 2017 by Crescendo Quote Share this post Link to post Share on other sites
deguix 65 Report post Posted September 25, 2017 Did you try using other version numbers? From the error I see, it's highly probable that the version needed is 1 (TOPI 1.3.5), because that one has shorter description messages (thus it runs out of chars - lack of chars results in a nil - a nil will have that error pop up). Quote Share this post Link to post Share on other sites
Crescendo 0 Report post Posted September 25, 2017 (edited) - Edited September 28, 2017 by Crescendo Quote Share this post Link to post Share on other sites
deguix 65 Report post Posted September 26, 2017 Does that even work with the client? If it does then you can store the .bin online and put the link here or send through pm. I can attempt to decompile it. From the result from gemini, it seems there are some extra invalid bytes in the beginning. Taking them out should make it able to work. Quote Share this post Link to post Share on other sites
deguix 65 Report post Posted September 27, 2017 (edited) Ok... the version is 2, but the file is corrupted. There are many missing bytes in it. Must have been a faulty internet. EDIT: Version 1.0.6: - Added: version 9 for the compiled client. This compiled client with fixed binaries is not released yet. So it basically means nothing for you guys right now. - Fixed: crash on having missing binary files when decompiling whole folder. If having extra binary files not supported by the version number, the .txt outputs will only have a comment line. - Fixed: whole folder texture decryption only decrypted half of the files on Windows. [fix thanks to: @Wrexor ] EDIT #2 (10/2/17): Woops, forgot to remove myfile:close() at if myfile == nil then block. Edited October 2, 2017 by deguix Quote Share this post Link to post Share on other sites
deguix 65 Report post Posted October 19, 2017 (edited) (Added new post because of importance) Version 1.0.7: - Fixed a bug on sceneobjinfo which caused the addition of 6, anytime the type of scenery was 6. Bug applies to all versions of top-decompiler. It affects items 480 to 489. This is what it should look like (remove 6, from env_* and 2500) - from top2: 480 yyyy080.lmo Wave Sound Effe 6 env_surf 2500 0 1 0 200 0 1 0 481 yyyy080.lmo Worm Sound Effe 6 env_insect 2500 0 1 0 200 0 1 0 482 yyyy080.lmo Cicada Sound Ef 6 env_cicada 2500 0 1 0 200 0 1 0 483 yyyy080.lmo Chirping Sound 6 env_bird1 2500 0 1 0 200 0 1 0 484 yyyy080.lmo Chirping Sound 6 env_bird2 2500 0 1 0 200 0 1 0 485 yyyy080.lmo Chilling Sound 6 env_bise 2500 0 1 0 200 0 1 0 486 yyyy080.lmo Shipyard Sound 6 env_ship 2500 0 1 0 200 0 1 0 487 yyyy080.lmo Factory Sound E 6 env_BlackS 2500 0 1 0 200 0 1 0 488 yyyy080.lmo Fountain Sound 6 env_founta 2500 0 1 0 200 0 1 0 489 yyyy080.lmo River Sound Eff 6 env_ghyll 2500 0 1 0 200 0 1 0 - Fixed something on version 9 but forgot. - Added a message if binary file doesn't exist (when decompiling and decrypting). - Fixed crash on decrypting if file doesn't exist. Edited October 19, 2017 by deguix Quote Share this post Link to post Share on other sites
willewallo 8 Report post Posted April 25, 2019 hi, im new to the whole TOP scripts and all that fancy sql stuff, i been learning alot in this forum, but ¿can anyone tell what's the porpuse of doing this? thanks. Quote Share this post Link to post Share on other sites
V3ct0r 2,145 Report post Posted May 2, 2019 On 4/25/2019 at 8:52 PM, willewallo said: hi, im new to the whole TOP scripts and all that fancy sql stuff, i been learning alot in this forum, but ¿can anyone tell what's the porpuse of doing this? thanks. Hello! This tool allows you to get the source .txt files from .bin tables (which are located in Client\scripts\table folder). These tables contain information about items, monsters, skills, and so on. This way you can edit these things for your client. Quote Some useful links / Полезные ссылки Tips for making a topic in 'Questions & Help' / Рекомендации по созданию тем в разделе "Помощь" Server Advertising Section Rules / Правила раздела "Реклама серверов" Available e-mail domains for registration / Допустимые e-mail домены для регистрации User groups / Группы пользователей User ranks / Звания пользователей "Broken" pictures on the forum / "Битые" изображения на форуме Beware of scammers! / Осторожно, мошенники! My developments / Мои разработки Mods for client and server / Моды для клиента и сервера PKOdev.NET website for Tales of Pirates Server / PKOdev.NET веб-обвязка для сервера Пиратии I do not provide any help in private messages and outside the forum. Use 'Questions & Help' section please. Thank you for understanding! Я не оказываю какую-либо помощь в личных сообщениях и вне форума. Пожалуйста, используйте раздел "Пиратия: Помощь". Благодарю за понимание! Share this post Link to post Share on other sites
willewallo 8 Report post Posted May 2, 2019 41 minutes ago, V3ct0r said: Hello! This tool allows you to get the source .txt files from .bin tables (which are located in Client\scripts\table folder). These tables contain information about items, monsters, skills, and so on. This way you can edit these things for your client. thanks v3t0r, once one saving the day, btw answer my direct message i want some of your top services. Quote Share this post Link to post Share on other sites
dominic363 1 Report post Posted June 21, 2019 could someone kindly explain to me how can i use this to decompile the bin files Quote Share this post Link to post Share on other sites
emilianof21 0 Report post Posted November 14, 2020 On 9/13/2017 at 3:28 AM, deguix said: It decompiles the .bin files from many top/pko versions. Easy to use: just extract, edit user.lua file (documentation of functions are in there) and run the bat file. I didn't test this with all versions (technically, only versions 4 and 5 were tested, but other versions should work). Here's the link: https://drive.google.com/open?id=0B0QOetVFt_yXX0N5d0t4OFJwcGs The 7z has the LuaJit 2.1.0-beta3 binary files with forward lua 5.2 compatibility (compatibility is not needed for these files though, its just that I use it for everything). This is a new version with the same version number as last release in s*****d**, except I added texture decrypting functions (along with the updated luajit). Now for some personal comments: - It originally was made in Python. It is better and faster in luajit than in Python. I've had many issues with Python, mostly syntax-wise. Lua is not perfect, but from what i've seen, it's the best for me. Believe me, I'm very picky with the syntax. - The Python version had many extra version numbers for top/pko versions that don't exist anymore. I didn't add them because no files use old TOP/PKO versions. If there's a version you need, tell me, I'll re-add it. - I didn't publish it here earlier because I wanted to make the syntax even better - but lately I've been busy with other projects. - item.lit is a bin file (in scripts/txt folder) - this can't decompile it because the sub-items are also binary files (the size of an item varies, all other bins have invariant items). - I've even made a version that could run on lua 5.0 (what server runs), but won't release it anymore because server/client source code is available and i'm fixing the client. So far both the server and client are both running luajit. - Re-release of other projects will have to wait until I finish the above. Please comment if it's not working. I know that I've tested it with an older luajit build, but I didn't do it yet with the newer one. hi,bro u got discord? need ur help Quote Share this post Link to post Share on other sites
kyleflow 36 Report post Posted September 25, 2021 can anyone reupload the rar files for the decompiler. the link from deguix need access level Quote Share this post Link to post Share on other sites
deguix 65 Report post Posted October 3, 2021 I renewed the link to the file. For some reason google prevented downloading from the old link. 1 Quote Share this post Link to post Share on other sites
MolSlangX 0 Report post Posted December 19, 2021 Hi Guys im in need of some help,, when decompiling I get the following : Folder decompiled successfully in 0.492s: C:/Program Files (x86)/Tales of Pirates II/scripts/table/ C:\Program Files (x86)\Tales of Pirates II\scripts\table>pause Press any key to continue . . . then when i go look for the decompiled text files, i cannot seem to find them,, can someone please assist? Quote Share this post Link to post Share on other sites
V3ct0r 2,145 Report post Posted December 20, 2021 Hello @MolSlangX! Show your script for decompiling Quote Some useful links / Полезные ссылки Tips for making a topic in 'Questions & Help' / Рекомендации по созданию тем в разделе "Помощь" Server Advertising Section Rules / Правила раздела "Реклама серверов" Available e-mail domains for registration / Допустимые e-mail домены для регистрации User groups / Группы пользователей User ranks / Звания пользователей "Broken" pictures on the forum / "Битые" изображения на форуме Beware of scammers! / Осторожно, мошенники! My developments / Мои разработки Mods for client and server / Моды для клиента и сервера PKOdev.NET website for Tales of Pirates Server / PKOdev.NET веб-обвязка для сервера Пиратии I do not provide any help in private messages and outside the forum. Use 'Questions & Help' section please. Thank you for understanding! Я не оказываю какую-либо помощь в личных сообщениях и вне форума. Пожалуйста, используйте раздел "Пиратия: Помощь". Благодарю за понимание! Share this post Link to post Share on other sites
Dan 189 Report post Posted December 20, 2021 10 hours ago, MolSlangX said: Hi Guys im in need of some help,, when decompiling I get the following : Folder decompiled successfully in 0.492s: C:/Program Files (x86)/Tales of Pirates II/scripts/table/ C:\Program Files (x86)\Tales of Pirates II\scripts\table>pause Press any key to continue . . . then when i go look for the decompiled text files, i cannot seem to find them,, can someone please assist? Quote Share this post Link to post Share on other sites
oldwise2 1 Report post Posted March 22, 2022 some1 know how to decrypt texture with deguix ? Quote Share this post Link to post Share on other sites
Jonathan 36 Report post Posted March 22, 2022 1 hour ago, oldwise2 said: some1 know how to decrypt texture with deguix ? All guidance on how to use this is contained in user.lua; notably, the guidance you are looking for: Quote --[[ decrypt_texture(source_image_file[,target_image_file]) Decrypts the specified source image file to target file. Does nothing but copy if file is already decrypted. Replaces itself if target_image_file is not specified. Parameters: source_binary_file: the full path to the source image file using foward slashes. Example: 'C:/Games/TOP/texture/terrain/abrick01.bmp'. (optional) target_decrypted_binary_file: the full path to the target decrypted image file using foward slashes. Example: 'C:/Games/TOP/texture/terrain/abrick01_decrypted.bmp'. --]] --[[ decrypt_folder_texture(folder[,linux]) Decrypts all image files in a folder if they're not decrypted already. Sub-folders are not followed (yet). Parameters: folder: path to the folder using foward slashes and no ending slash. Example: 'C:/Games/TOP/texture/terrain'. (optional) linux: set to true if using this in a linux system (cmdline program in linux is named differently). Example: true. --]] Does that answer your question? Else, what further guidance do you need and what have you tried so far? Quote Share this post Link to post Share on other sites
oldwise2 1 Report post Posted March 22, 2022 when i open the decompiler . bat this appears ,,, luajit is not recognized as an internal or external command Quote Share this post Link to post Share on other sites
Jonathan 36 Report post Posted March 22, 2022 37 minutes ago, oldwise2 said: when i open the decompiler . bat this appears ,,, luajit is not recognized as an internal or external command Could you post a screenshot of your folder structure for the decompiler please? And just to double check - you are running the bat file by double clicking it? Quote Share this post Link to post Share on other sites
oldwise2 1 Report post Posted March 22, 2022 I'm opening the bat by 2 click , I tried in admin too, but gave the same error Quote Share this post Link to post Share on other sites
Jonathan 36 Report post Posted March 22, 2022 I would advise you first try downloading the decompiler from the Google Drive link and extract all of the contents to a separate, new directory. It looks like you have downloaded the decompiler from the source code repository and are trying to use it as a standalone version; if you wish to do this you should download the Google Drive link, extract the contents, then replace the decompiler.lua in the Google Drive release with the same file from the source code repository, per the original post: Quote To get it to work in standalone (like with the old version), download the old version first, and just replace the old "decompiler.lua" file with the new one. (so far no changes afaik) As it stands, you are missing some crucial files. Once you extract the contents from the Google Drive link, the folder should have the following contents: (This directory structure is straight from the current Google Drive download link in the original post of this thread) Once you have: 1. Re-downloaded and extracted the entirety of the contents to a fresh folder; 2. Modified the user.lua file to: i) adjust the functions called (make sure you are decrypting textures and not decompiling bins) ii) adjust the target directory path 3. Run decompile.bat again (in the same manner, by double clicking it) (note: if the target directory is protected / requires admin rights to make files, then you will need to run decompile.bat as admin) Let me know if it worked, what hurdle we need to cross next (include any error messages, etc.), or if you need clarification on anything I said. If it worked, then you can (but don't necessarily need to) replace the decompiler.lua with the same file from the source code repository, as previously instructed. Quote Share this post Link to post Share on other sites