Map Name: invalid Defense v0.3.1
Map Link: https://www.hiveworkshop.com/threads/mo ... -1.346875/
Request: I would like to play this map in singleplayer with saves enabled. Currently, when hosting the map as the only player, this message is shown at the start: "Detected Single Player; Saving is diabled." ("diabled" is a typo in the map, not by me)
I tried to do this myself, but when I used rmpq extractor, and extracted Scripts/war3map.j, THERE IS ALMOST NOTHING IN THE SCRIPT FILE! Is it possible to have multiple script files, some hidden? Thank you!
Language: English
[SP] monster-defense-v0-3-1.346875
Moderator: Cheaters
-
- Newcomer
- Posts: 7
- Joined: May 29th, 2020, 3:12 am
[SP] monster-defense-v0-3-1.346875
You do not have the required permissions to view the files attached to this post.
-
- Newcomer
- Posts: 7
- Joined: May 29th, 2020, 3:12 am
Re: [SP] monster-defense-v0-3-1.346875
Not sure why map name shows as "invalid Defense". I typed M0nst3r Defense, and when I edit the post it shows M0nst3r Defense (without numbers)...
-
- Newcomer
- Posts: 7
- Joined: May 29th, 2020, 3:12 am
Re: [SP] monster-defense-v0-3-1.346875
So I started manually extracting all the unrecognized .xxx files from the MPQ.
File00098.xxx (716K) has 20976 lines of unobfuscated Lua code. Not sure if it's possible to edit it and readd it to the MPQ without knowing its name though?
File00098.xxx (716K) has 20976 lines of unobfuscated Lua code. Not sure if it's possible to edit it and readd it to the MPQ without knowing its name though?
-
- Cheater
- Posts: 133
- Joined: November 21st, 2016, 6:50 pm
Re: [SP] monster-defense-v0-3-1.346875
Unfortunately it's a Lua map. Author seems to have dumped only function calls in Jass script, but everything else is in war3map.lua which is hidden or MPQEditor can't find it.
You can try rebuilding map and searching for as many file names as possible altough it's never 100% accurate.
However, even if you do find it you obviously need to know how to read Lua code, you're also gonna need an IDE such as Visual Studio or Atom, I think Cheat Engine's debugger can also open it but I'd recommend using Notepad++ and LuaScript plugin along with Lua syntax highlighter (I think it's already bundled with default install).
Here is a Lua plugin for Notepad++
There's also this
Lately I see many maps that transcompiled Jass to Lua but there's also maps like this one that seem to be built in Lua from ground up.
Lastly, as you can see this takes incredible amount of work and knowledge just to make the map work in SP or add CP, cheating the map in any way is actually the easiest part of this whole problem.
You can try rebuilding map and searching for as many file names as possible altough it's never 100% accurate.
However, even if you do find it you obviously need to know how to read Lua code, you're also gonna need an IDE such as Visual Studio or Atom, I think Cheat Engine's debugger can also open it but I'd recommend using Notepad++ and LuaScript plugin along with Lua syntax highlighter (I think it's already bundled with default install).
Here is a Lua plugin for Notepad++
And only then you can finally play around with code and see if you can find anything that's related to map's singleplayer if you can read the code that is.
There's also this
but I don't think reverse converter exists.
Lately I see many maps that transcompiled Jass to Lua but there's also maps like this one that seem to be built in Lua from ground up.
Lastly, as you can see this takes incredible amount of work and knowledge just to make the map work in SP or add CP, cheating the map in any way is actually the easiest part of this whole problem.
-
- Newcomer
- Posts: 7
- Joined: May 29th, 2020, 3:12 am
Re: [SP] monster-defense-v0-3-1.346875
Thanks very much for the response! I haven't worked with Lua before but I doubt it'd be a problem. But yea, the issue is finding war3map.lua3nemy_ wrote:Unfortunately it's a Lua map. Author seems to have dumped only function calls in Jass script, but everything else is in war3map.lua which is hidden or MPQEditor can't find it.
You can try rebuilding map and searching for as many file names as possible altough it's never 100% accurate.
However, even if you do find it you obviously need to know how to read Lua code, you're also gonna need an IDE such as Visual Studio or Atom, I think Cheat Engine's debugger can also open it but I'd recommend using Notepad++ and LuaScript plugin along with Lua syntax highlighter (I think it's already bundled with default install).
Here is a Lua plugin for Notepad++And only then you can finally play around with code and see if you can find anything that's related to map's singleplayer if you can read the code that is.
There's also thisbut I don't think reverse converter exists.
Lately I see many maps that transcompiled Jass to Lua but there's also maps like this one that seem to be built in Lua from ground up.
Lastly, as you can see this takes incredible amount of work and knowledge just to make the map work in SP or add CP, cheating the map in any way is actually the easiest part of this whole problem.
![Sad :(](./images/smilies/icon_sad.gif)
Are there any viable bruteforce options that exist? I tried an older version of Ladik's MPQ Editor that allegedly has a 'name breaker' but couldn't get it to work. Also, the feature which listens for used files within the MPQ archive while the game is running unfortunately only seems to work on pre-Reforged -- and this map doesn't work with pre-Reforged (I guess because of the Lua stuff).
~~
My goal isn't to cheat, but just to be able to play in SP. The map involves strategy to survive, and I'd rather do so via solo trial and error, rather than having to wait for randos to join.
I guess I can do so anyway, just without the save feature, but that just makes it a bit annoying that the only way to progress is when there is someone else in-game (you unlock additional races as you progress).
Also, I get that at this point this is more effort than it's worth -- but this process in itself is fun too
![Razz :P](./images/smilies/icon_razz.gif)
-
- Cheater
- Posts: 133
- Joined: November 21st, 2016, 6:50 pm
Re: [SP] monster-defense-v0-3-1.346875
After some time of analyzing and critical thinking I realized the answer was right in front of me the whole time and it just went over my head.
You see, war3map.j is technically a "fake" file meaning there's nothing important in it, it's just some default WE strings that get stored in .j script after you save the map in WE.
As for war3map.lua, I don't know which tools author used to protect the map and MPQ because even though most filenames are missing lua script is entirely intact and not obfuscated whatsoever, my only guess is perhaps because none of the known map optimizers are able to scramble Lua yet.
In any case I deduced lua script file was File00000321.xxx due to its size, the other bigger file 002.xxx is loading screen.
Also it's worth to mention this map was in fact written in TypeScript and then transpiled to Lua
![Image](https://i.imgur.com/R9zwY2N.png)
__TS__New is I believe some kind of object that seems to start before every trigger and PlayerSaveManager is trigger itself, subscribe should be equivalent to TriggerAddAction in Jass, I don't know what TriggerAddCondition would be.
Anyway, you don't need to know any of this in this case because all you have to do is change this line's flag and that will enable saving in SP.
After this, all you need to do is import lua script back to MPQ but since latest MPQ Editor can only open the map in Read Only, you need to use older version, I had luck with 3.6.0.854 version.
Unfortunately since we don't have a full listfile we can't flush the archive to reduce map file size so it will be slightly larger but that's the least of our concerns.
I have also made a small listfile that will search for correct path to war3map.lua so you don't have to look through the list of unknown filenames to find it.
You see, war3map.j is technically a "fake" file meaning there's nothing important in it, it's just some default WE strings that get stored in .j script after you save the map in WE.
As for war3map.lua, I don't know which tools author used to protect the map and MPQ because even though most filenames are missing lua script is entirely intact and not obfuscated whatsoever, my only guess is perhaps because none of the known map optimizers are able to scramble Lua yet.
In any case I deduced lua script file was File00000321.xxx due to its size, the other bigger file 002.xxx is loading screen.
Also it's worth to mention this map was in fact written in TypeScript and then transpiled to Lua
With all that out of the way I started looking for save system and stumbled upon this.
![Image](https://i.imgur.com/R9zwY2N.png)
__TS__New is I believe some kind of object that seems to start before every trigger and PlayerSaveManager is trigger itself, subscribe should be equivalent to TriggerAddAction in Jass, I don't know what TriggerAddCondition would be.
Anyway, you don't need to know any of this in this case because all you have to do is change this line's flag and that will enable saving in SP.
Code: Select all
self.saveLoad.disableSaving = true to false
Unfortunately since we don't have a full listfile we can't flush the archive to reduce map file size so it will be slightly larger but that's the least of our concerns.
I have also made a small listfile that will search for correct path to war3map.lua so you don't have to look through the list of unknown filenames to find it.
You do not have the required permissions to view the files attached to this post.
-
- Newcomer
- Posts: 7
- Joined: May 29th, 2020, 3:12 am
Re: [SP] monster-defense-v0-3-1.346875
Thanks for coming back to post! In my earlier messages I did mention that I found the Lua file (and though I hadn't mentioned it, I found the part of the code dealing with the single-player restriction), but was asking if it is possible to edit it and re-add it to the MPQ without knowing its name in the listfile? Your message above indicates that it seems to be possible, but how please?3nemy_ wrote:After some time of analyzing and critical thinking I realized the answer was right in front of me the whole time and it just went over my head.
You see, war3map.j is technically a "fake" file meaning there's nothing important in it, it's just some default WE strings that get stored in .j script after you save the map in WE.
As for war3map.lua, I don't know which tools author used to protect the map and MPQ because even though most filenames are missing lua script is entirely intact and not obfuscated whatsoever, my only guess is perhaps because none of the known map optimizers are able to scramble Lua yet.
In any case I deduced lua script file was File00000321.xxx due to its size, the other bigger file 002.xxx is loading screen.
Also it's worth to mention this map was in fact written in TypeScript and then transpiled to LuaWith all that out of the way I started looking for save system and stumbled upon this.
__TS__New is I believe some kind of object that seems to start before every trigger and PlayerSaveManager is trigger itself, subscribe should be equivalent to TriggerAddAction in Jass, I don't know what TriggerAddCondition would be.
Anyway, you don't need to know any of this in this case because all you have to do is change this line's flag and that will enable saving in SP.After this, all you need to do is import lua script back to MPQ but since latest MPQ Editor can only open the map in Read Only, you need to use older version, I had luck with 3.6.0.854 version.Code: Select all
self.saveLoad.disableSaving = true to false
Unfortunately since we don't have a full listfile we can't flush the archive to reduce map file size so it will be slightly larger but that's the least of our concerns.
I have also made a small listfile that will search for correct path to war3map.lua so you don't have to look through the list of unknown filenames to find it.
You said:
> After this, all you need to do is import lua script back to MPQ but since latest MPQ Editor can only open the map in Read Only, you need to use older version, I had luck with 3.6.0.854 version.
Does this mean that I can simply use that version of MPQ Editor, and edit the .xxx file even though it is not in the listfile? I didn't realize that it's possible to edit without having the file name in the listfile first.
-
- Newcomer
- Posts: 7
- Joined: May 29th, 2020, 3:12 am
Re: [SP] monster-defense-v0-3-1.346875
Ok I used an older version of MPQ Editor which can open in not "Read Only", and I was able to edit the .xxx file even though it is not part of the listfile.House wrote:Thanks for coming back to post! In my earlier messages I did mention that I found the Lua file (and though I hadn't mentioned it, I found the part of the code dealing with the single-player restriction), but was asking if it is possible to edit it and re-add it to the MPQ without knowing its name in the listfile? Your message above indicates that it seems to be possible, but how please?3nemy_ wrote:After some time of analyzing and critical thinking I realized the answer was right in front of me the whole time and it just went over my head.
You see, war3map.j is technically a "fake" file meaning there's nothing important in it, it's just some default WE strings that get stored in .j script after you save the map in WE.
As for war3map.lua, I don't know which tools author used to protect the map and MPQ because even though most filenames are missing lua script is entirely intact and not obfuscated whatsoever, my only guess is perhaps because none of the known map optimizers are able to scramble Lua yet.
In any case I deduced lua script file was File00000321.xxx due to its size, the other bigger file 002.xxx is loading screen.
Also it's worth to mention this map was in fact written in TypeScript and then transpiled to LuaWith all that out of the way I started looking for save system and stumbled upon this.
__TS__New is I believe some kind of object that seems to start before every trigger and PlayerSaveManager is trigger itself, subscribe should be equivalent to TriggerAddAction in Jass, I don't know what TriggerAddCondition would be.
Anyway, you don't need to know any of this in this case because all you have to do is change this line's flag and that will enable saving in SP.After this, all you need to do is import lua script back to MPQ but since latest MPQ Editor can only open the map in Read Only, you need to use older version, I had luck with 3.6.0.854 version.Code: Select all
self.saveLoad.disableSaving = true to false
Unfortunately since we don't have a full listfile we can't flush the archive to reduce map file size so it will be slightly larger but that's the least of our concerns.
I have also made a small listfile that will search for correct path to war3map.lua so you don't have to look through the list of unknown filenames to find it.
You said:
> After this, all you need to do is import lua script back to MPQ but since latest MPQ Editor can only open the map in Read Only, you need to use older version, I had luck with 3.6.0.854 version.
Does this mean that I can simply use that version of MPQ Editor, and edit the .xxx file even though it is not in the listfile? I didn't realize that it's possible to edit without having the file name in the listfile first.
Thanks so much for the help!
-
- Cheater
- Posts: 133
- Joined: November 21st, 2016, 6:50 pm
Re: [SP] monster-defense-v0-3-1.346875
I uploaded small listfile for lua script and map with SP enabled, I assume you overlooked it since you didn't download it.
As for the rest of my post, it's simply a step by step guide in case you were interested in how I figured it out so you can do it yourself in future for other such maps.
As for the rest of my post, it's simply a step by step guide in case you were interested in how I figured it out so you can do it yourself in future for other such maps.
-
- Newcomer
- Posts: 7
- Joined: May 29th, 2020, 3:12 am
Re: [SP] monster-defense-v0-3-1.346875
Actually I left namebreaker running yesterday and turns out it's literally just "war3map.lua" lol
I thought I had that in my listfile oops xD
But hey! Learnt some things through that oversight
Thanks for everything!
I thought I had that in my listfile oops xD
But hey! Learnt some things through that oversight
Thanks for everything!