Author Topic: Aurora C# Code Protection  (Read 5459 times)

0 Members and 1 Guest are viewing this topic.

Offline Retropunch

  • Petty Officer
  • **
  • R
  • Posts: 15
  • Thanked: 5 times
Re: Aurora C# Code Protection
« Reply #45 on: December 06, 2018, 04:05:05 PM »
I'd completely agree with a checksum - I'd also add that putting a bug report button in the program itself may help; it could automatically deliver the checksum (as well as any other variables you wanted it to pass) and save a lot of hassle.


There already is decent enough mod support built in (or there was) in terms of naming/flags/colours etc. The thing most people want to do in terms of modding is play as their own race/kingdom against other preset ones (Stargate/Star Wars/Trek etc.) - as such I don't think there's any need to cover anything else which would be a lot more work.
 

Offline Alucard

  • Leading Rate
  • *
  • A
  • Posts: 10
Re: Aurora C# Code Protection
« Reply #46 on: December 09, 2018, 04:01:54 PM »
Quote from: Retropunch link=topic=10217. msg111281#msg111281 date=1544133905
There already is decent enough mod support built in (or there was) in terms of naming/flags/colours etc.  The thing most people want to do in terms of modding is play as their own race/kingdom against other preset ones (Stargate/Star Wars/Trek etc. ) - as such I don't think there's any need to cover anything else which would be a lot more work.

There are many different types of mods, that could be made, if there is source or at least no protection against injection. 
One type I can imagine being popular is a mod, that would bring the game mechanics to correspond closer to some fictional universe. For example Battlestar Galactica mod making point defense for large ships next to useless while making missile interception by fighters much easier + making missiles much more expensive.  It could also add sort of fleet persuit similar to the show and maybe change hangars and on-board production modules.
 

Offline ab9rf

  • Able Ordinary Rate
  • a
  • Posts: 2
  • Thanked: 2 times
Re: Aurora C# Code Protection
« Reply #47 on: January 18, 2019, 01:58:36 PM »
Quote from: Barkhorn link=topic=10217. msg110990#msg110990 date=1541824500
I understand you want control over the code, but I'd just like to point out what another dev has done in a similar situation.

Dwarf Fortress is a similarly complex game made mostly by one guy, Tarn Adams.   He protects his game with licensing, not code obfuscation.   He also allows some pretty serious modding, but hasn't actually endorsed most of it.   I don't fully understand it, but DFHack is a very popular utility that allows third-party scripts to access Dwarf Fortress's RAM.   This utility allows the player to use tons of scripts that drastically improve their quality of life.   A few examples include quicker bugfixes, mouse support, even 3D graphics.

I am totally fine with it if you don't want other people toying with your code, but just know that other games with similar communities have greatly benefited from openness.
I'm a minor participant in the DFHack project.  Dwarf Fortress is in C++, which makes it much harder to decompile than something written in C#.  Tarn takes no specific steps to obfuscate his code because he doesn't have to: it's compiled to native machine code, and with modern compilers, that makes it essentially fully obfuscated by default.  We can't even reliably identify classes that don't have virtual methods.  Even identifying function boundaries in the compiled machine code is challenging, due to inlining.  Despite all that, DFHack exists.  Tarn seems to tolerate us fairly well.  We've done a lot to help with this by being persistently respectful of his efforts and by providing useful feedback about the bugs we find in the course of our explorations.

C# code (when compiled to the CIL, at least, which is the default) is frankly trivial to decompile.  About all you can do is obfuscate variable names.  With baseline obfuscation, all (or essentially all) of the classes and methods you define in your source will be recoverable from the compiled code; all that will be lost is the names you gave them (and possibly also any code the compiler has identified as dead).  This is, essentially, the same obfuscation that Mojang uses to obfuscate Minecraft.  The thousands of mods that exist for Minecraft should tell you how successful that has been. 
Some of the . NET obfuscators do things to your code that make it harder to decompile (with varying degrees of success), but also make it slower.  But all of these methods are reversible, and frankly none of them is more difficult to reverse than the "obfuscation" that compiling C++ to machine language does.

It is essentially impossible to stop people from modding a managed . NET executable.  However, at the same time, it's unlikely that the people who do such modding will be dicks about it.  However, the fact that decompiling C# is much easier than decompiling C++ does suggest that the probability of at least one asshole modder popping up is somewhat higher than it is for the C++ case exemplified by Dwarf Fortress.
 
The following users thanked this post: Steve Walmsley, Karlito

Offline Whitecold

  • Commander
  • *********
  • W
  • Posts: 310
  • Thanked: 74 times
Re: Aurora C# Code Protection
« Reply #48 on: January 19, 2019, 10:55:04 AM »
Quote from: Barkhorn link=topic=10217. msg110990#msg110990 date=1541824500
I understand you want control over the code, but I'd just like to point out what another dev has done in a similar situation.

Dwarf Fortress is a similarly complex game made mostly by one guy, Tarn Adams.   He protects his game with licensing, not code obfuscation.   He also allows some pretty serious modding, but hasn't actually endorsed most of it.   I don't fully understand it, but DFHack is a very popular utility that allows third-party scripts to access Dwarf Fortress's RAM.   This utility allows the player to use tons of scripts that drastically improve their quality of life.   A few examples include quicker bugfixes, mouse support, even 3D graphics.

I am totally fine with it if you don't want other people toying with your code, but just know that other games with similar communities have greatly benefited from openness.
I'm a minor participant in the DFHack project.  Dwarf Fortress is in C++, which makes it much harder to decompile than something written in C#.  Tarn takes no specific steps to obfuscate his code because he doesn't have to: it's compiled to native machine code, and with modern compilers, that makes it essentially fully obfuscated by default.  We can't even reliably identify classes that don't have virtual methods.  Even identifying function boundaries in the compiled machine code is challenging, due to inlining.  Despite all that, DFHack exists.  Tarn seems to tolerate us fairly well.  We've done a lot to help with this by being persistently respectful of his efforts and by providing useful feedback about the bugs we find in the course of our explorations.

C# code (when compiled to the CIL, at least, which is the default) is frankly trivial to decompile.  About all you can do is obfuscate variable names.  With baseline obfuscation, all (or essentially all) of the classes and methods you define in your source will be recoverable from the compiled code; all that will be lost is the names you gave them (and possibly also any code the compiler has identified as dead).  This is, essentially, the same obfuscation that Mojang uses to obfuscate Minecraft.  The thousands of mods that exist for Minecraft should tell you how successful that has been. 
Some of the . NET obfuscators do things to your code that make it harder to decompile (with varying degrees of success), but also make it slower.  But all of these methods are reversible, and frankly none of them is more difficult to reverse than the "obfuscation" that compiling C++ to machine language does.

It is essentially impossible to stop people from modding a managed . NET executable.  However, at the same time, it's unlikely that the people who do such modding will be dicks about it.  However, the fact that decompiling C# is much easier than decompiling C++ does suggest that the probability of at least one asshole modder popping up is somewhat higher than it is for the C++ case exemplified by Dwarf Fortress.

DFhack is a wonderful project making Dwarf Fortress much more user friendly with some of the management tools that make you forget that it is not actually part of vanilla. But DFhack is insofar officially endorsed as it has its own section on the forums. Without the forum and mentions on the wiki, I doubt many people would even know about it.
So as far as the problem of bug reports caused by mods go it should be sufficient to just not offer any platform. It tends to be the people that downloaded a mod, installed it and it does a weird thing that come running back claiming a bug. If you do any modding work yourself, you know very well any bug is most likely created by yourself.
 
The following users thanked this post: Karlito

 

Sitemap 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54