1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  4. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  5. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  8. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

What does Vexorian mean by "rig the map?"

Discussion in 'World Editor Help Zone' started by sethmachine, Jun 27, 2014.

  1. sethmachine

    sethmachine

    Joined:
    Aug 7, 2013
    Messages:
    1,318
    Resources:
    0
    Resources:
    0
    Hi,

    In the Map Optimizer v5.0, Vexorian writes this

    What kind of traps is he referring to, without being specific?
     
  2. frettory

    frettory

    Joined:
    Jan 19, 2012
    Messages:
    51
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    Something that makes the map crash upon opening it using WE.
     
  3. edo494

    edo494

    Joined:
    Apr 16, 2012
    Messages:
    3,846
    Resources:
    5
    Spells:
    1
    JASS:
    4
    Resources:
    5
    if he means what I think he means, then he basically changes 4 bytes in the header of the mpq archive to random value so that world editor can no longer open the map
     
  4. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,613
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    In the old days before the type cast exploit was fixed you could use code variables to do such a trap I would imagine. This could do anything from detecting modification of the script via checksums (the place of stuff is no longer as expected) to externally fetching the script from another file.

    However I believe this was Vexorian just blowing his own trumpet trying to sound like he was better than he actually is. Self defending scripts have always been known to perform badly and be easily cracked, just like CD protection in real life.
     
  5. edo494

    edo494

    Joined:
    Apr 16, 2012
    Messages:
    3,846
    Resources:
    5
    Spells:
    1
    JASS:
    4
    Resources:
    5
    he cant use typecasts for protection since 5.0 was released in like 2012, typecasting was fixed before 2011
     
  6. Xonok

    Xonok

    Joined:
    Mar 27, 2012
    Messages:
    3,040
    Resources:
    8
    Spells:
    3
    Tutorials:
    5
    Resources:
    8
    There's many ways really.

    Ways that I've thought of myself.
    1. Use UMSWE functions or custom GUI.
    2. Keep your script files outside the map and just write //! import "Filename.j"
    3. Change the location of war3map.j to a different place that the editor doesn't expect, but game does.
     
  7. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,613
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    And the tool was poorly maintained long before that patch. The comment was likely left in there due to lack of maintenance.
     
  8. EdgeOfChaos

    EdgeOfChaos

    Joined:
    Jan 8, 2014
    Messages:
    639
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    If I remember correctly, if you make a quest with 1023 characters and at least 1 newline, it will prevent map from being edited externally.
     
  9. sethmachine

    sethmachine

    Joined:
    Aug 7, 2013
    Messages:
    1,318
    Resources:
    0
    Resources:
    0
    I think this is what Vexorian meant. A map code that verifies itself. So people did execute arbitrary code using the return bug as a form of map protection?

    Aye, this makes it impossible (or very difficult) of course to recover the vJASS script.
     
  10. Xonok

    Xonok

    Joined:
    Mar 27, 2012
    Messages:
    3,040
    Resources:
    8
    Spells:
    3
    Tutorials:
    5
    Resources:
    8
    Technically this alone doesn't, but I bet most people wouldn't know where to look for it.
    Openable in editor, but can't save.
     
  11. sethmachine

    sethmachine

    Joined:
    Aug 7, 2013
    Messages:
    1,318
    Resources:
    0
    Resources:
    0
    What do you mean? When the map saves, it only keeps the compiled JASS script AFAIK.

    Getting the war3map.j is trivial, but turning that into the original vJASS script (reverse compilation or whatever)? I can't imagine most people would have the knowledge and skill necessary in information theory. Also it would be impossible to recover the variable names, so you'd have to have a complex variable semantics recognizer, and because variable name semantics is open to infinite interpretations, you would have to name each variable by hand.

    Or are there tools that actually do turn a JASS script into a vJASS script (barring getting correct variable names)?
     
  12. Xonok

    Xonok

    Joined:
    Mar 27, 2012
    Messages:
    3,040
    Resources:
    8
    Spells:
    3
    Tutorials:
    5
    Resources:
    8
    Think about it. How does the editor know to show you vJASS when you've saved it?
    The code is there, just not in map script.
     
  13. Dat-C3

    Dat-C3

    Joined:
    Mar 15, 2012
    Messages:
    2,469
    Resources:
    10
    Models:
    1
    Maps:
    5
    Spells:
    3
    Tutorials:
    1
    Resources:
    10
    Does 2. work in wc3? As well the only possible spot you can move it is scripts/ isn't it?

    Does this really work? I have a method similar to it I have been trying to test.

    Oh, and almost every method you guys have already brought up has tutorials for it. . . Not here of course. Only the things I questioned don't have tutorials/answers too.
    I do know one thing though, there is superb methods of protection almost nobody else knows. Chinese and Russian maps/sites seem to have odd methods. Same for Korean's.

    Someone should try testing a double .j script. =) See if you can get it to read one instead of the other, though I don't think that works because it will read folder/ second.
     
  14. Xonok

    Xonok

    Joined:
    Mar 27, 2012
    Messages:
    3,040
    Resources:
    8
    Spells:
    3
    Tutorials:
    5
    Resources:
    8
    JNGPE has a folder named "jass". Files inside that can be used with //! import. I wonder if models can be imported that way.
    Only in scripts? Probably yes.
     
  15. Dat-C3

    Dat-C3

    Joined:
    Mar 15, 2012
    Messages:
    2,469
    Resources:
    10
    Models:
    1
    Maps:
    5
    Spells:
    3
    Tutorials:
    1
    Resources:
    10
    There is another public method of protection barely known because not many people made use of it and that is using VJass from a model file. Though that is cool, didn't know newgen could do that however how does that exactly work?
     
  16. edo494

    edo494

    Joined:
    Apr 16, 2012
    Messages:
    3,846
    Resources:
    5
    Spells:
    1
    JASS:
    4
    Resources:
    5
    No matter how hardly hard you try, if game can read your game script, so can anyone else with a little bit of effort and good mpqviewer
     
  17. sethmachine

    sethmachine

    Joined:
    Aug 7, 2013
    Messages:
    1,318
    Resources:
    0
    Resources:
    0
    The vJASS scripts gets deleted when the map is optimized. And also there is no vJASS to show in the map, because I use an import statement for the whole script.

    Yes this is true. But nobody can ever recover the readable vJASS script.
     
  18. Xonok

    Xonok

    Joined:
    Mar 27, 2012
    Messages:
    3,040
    Resources:
    8
    Spells:
    3
    Tutorials:
    5
    Resources:
    8
    Only if optimized, yep. This is what I was getting at. The optimization removes editor-only files, including the one where the source code is.
    It is also possible (tested today) to create editor-only maps, although I don't know what the point would be.
     
  19. PurgeandFire

    PurgeandFire

    Code Moderator

    Joined:
    Nov 11, 2006
    Messages:
    7,426
    Resources:
    18
    Icons:
    1
    Spells:
    4
    Tutorials:
    9
    JASS:
    4
    Resources:
    18
    People don't normally care about getting the source vJASS script. They usually just care to add cheats to the map.

    There are a lot of ways to protect your map, but you have to think like a map hacker. Prevent ways to get easy gold, prevent iseedeadpeople code, etc. Look at current anti maphack systems (e.g. PandaMine's old AMHS on wc3c.net). As for actual file protection, you just need to look at the popular deprotection tools. Beat the MPQ editors, beat the map reconstructors (e.g. the one that rebuilds the triggers and object files), and other deprotection tools, and you're set for the most part. Of course, there will always be a way to hack into it (how do you think people reverse engineered the mpq format?), but if they managed to get past all your protection, maybe they deserve to cheat. ;) But in all seriousness, you only need to protect it so that the majority cannot get in. A lot of people won't have the knowledge or experience to get the files they need.

    Anyway, be creative. You can mess around with your script and add preventative measures in random areas. With code obfuscation, it'll be difficult to reverse it. And don't be blatant by crashing the game. Be creative: you can essentially bug the map if you detect something that goes wrong. Those are harder to look for in an obfuscated script opposed to some division by 0 or some function that crashes.

    Still, you should not get too caught up in protection. It is mostly fun to think of ways (for me), but I don't really care about ultra-protecting maps. And neither should anyone, imo. There was one guy who made a thread a while back asking for the best protection method, and we gave him the cold hard truth that "no matter what you do, if the game can read it, someone else can edit your map". At that idea, he decided to quit modding. If you have that mentality, then you lose sight of the whole purpose behind modding. It is supposed to be fun, and it is more or less a privilege if people play and enjoy your map. That should be rewarding enough.