Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. PlugIns - Preventing Malicious Code...

PlugIns - Preventing Malicious Code...

Scheduled Pinned Locked Moved C#
game-devtutorialquestionannouncement
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Shy Agam
    wrote on last edited by
    #1

    Hello experts, I'm working on a system which would be able to dinamically load all kinds of multiplayer games. In order for the system to know how to handle any game, I set up some ground rules using an abstract class named GameEngine. Among other stuff, it contains an abstract ProcessMessage() method. At first I thought of loading DLLs from a special folder, and analyzing every class which inherits GameEngine. But then came another thought into my mind... What if someone, instead of implementing a game, inherits GameEngine and puts down malicious code into ProcessMessage()? My first solution is not to read DLLs from a directory, but to read only a DLL that I will code... Whenever I want to add another game, I would update the DLL... However, this prevents other programmers from adding games to my program... What can I do? Thanks in advance, Shy.

    P A 2 Replies Last reply
    0
    • S Shy Agam

      Hello experts, I'm working on a system which would be able to dinamically load all kinds of multiplayer games. In order for the system to know how to handle any game, I set up some ground rules using an abstract class named GameEngine. Among other stuff, it contains an abstract ProcessMessage() method. At first I thought of loading DLLs from a special folder, and analyzing every class which inherits GameEngine. But then came another thought into my mind... What if someone, instead of implementing a game, inherits GameEngine and puts down malicious code into ProcessMessage()? My first solution is not to read DLLs from a directory, but to read only a DLL that I will code... Whenever I want to add another game, I would update the DLL... However, this prevents other programmers from adding games to my program... What can I do? Thanks in advance, Shy.

      P Online
      P Online
      PIEBALDconsult
      wrote on last edited by
      #2

      You should allow plugins, regardless of the security risks.

      1 Reply Last reply
      0
      • S Shy Agam

        Hello experts, I'm working on a system which would be able to dinamically load all kinds of multiplayer games. In order for the system to know how to handle any game, I set up some ground rules using an abstract class named GameEngine. Among other stuff, it contains an abstract ProcessMessage() method. At first I thought of loading DLLs from a special folder, and analyzing every class which inherits GameEngine. But then came another thought into my mind... What if someone, instead of implementing a game, inherits GameEngine and puts down malicious code into ProcessMessage()? My first solution is not to read DLLs from a directory, but to read only a DLL that I will code... Whenever I want to add another game, I would update the DLL... However, this prevents other programmers from adding games to my program... What can I do? Thanks in advance, Shy.

        A Offline
        A Offline
        AFSEKI
        wrote on last edited by
        #3

        You should sign your plugins ( DLLs ) using Signcode.exe and also use a Dotfuscator like tool to prevenet (as much as you can) your dlls from being disassembled to their original source code. Don't forget SecurityPermissionAttributes which also add another level of protection to your distributed plug-ins(DLLs). Checkout: Web site: http://msdn2.microsoft.com/en-us/library/ab4eace3(vs.71).aspx MSDN Library: Assembly Security Considerations Hope this helps...

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups