Click here to Skip to main content
12,629,860 members (29,056 online)
   

C#

 
GeneralRe: Help for code Pin
Eddy Vluggen3-Mar-11 7:45
memberEddy Vluggen3-Mar-11 7:45 
GeneralRe: Help for code Pin
Girish4814-Mar-11 0:48
memberGirish4814-Mar-11 0:48 
GeneralRe: Help for code Pin
Eddy Vluggen4-Mar-11 13:16
memberEddy Vluggen4-Mar-11 13:16 
GeneralRe: Help for code Pin
Girish4815-Mar-11 17:56
memberGirish4815-Mar-11 17:56 
GeneralRe: Help for code Pin
Eddy Vluggen6-Mar-11 1:42
memberEddy Vluggen6-Mar-11 1:42 
QuestionHow do you protect your app hosting third party dll ...? [modified] Pin
devvvy2-Mar-11 22:32
memberdevvvy2-Mar-11 22:32 
AnswerRe: How do you protect your app hosting third party dll ...? Pin
Eddy Vluggen3-Mar-11 7:58
memberEddy Vluggen3-Mar-11 7:58 
GeneralRe: How do you protect your app hosting third party dll ...? Pin
devvvy3-Mar-11 16:21
memberdevvvy3-Mar-11 16:21 
"can third party examine application memory."
> I know reflection can enumerate types of assemblies. I also know if you pass in any object (For example, a LicenseController sitting in AppDomain.Current.Get/Set), reflection can basically enumerage types/properties (set/get any "private" members and methods!). So basically anything sitting in AppDomain.Current.Get/Set is UNSECURED.
One further question out of curiosity - can third party dll can a raw byte[] image of process memory...?

"and I can access the source-code of the VM if need be."
> Access source code? Even if I use an obfuscator..!?

So all this jazz about AppDomain are *practically useless* from security stand point. I've also tried to throw an exception from code from another appDomain, it crashes the whole app (see below).

Sounds like all theories surrounding appDomain completely b*llsh*t!
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Threading;
using System.Reflection;
using System.Security.Policy;

using UserUtil;
using SimpleUtil;

namespace SimpleTest
{
class Program
{
public const string KEY1 = "KEY1";
public static AppDomain UserDomain = null;
public static SimpleUtil.IServiceProvider UserProvider = null;

static void Main(string[] args)
{
Assembly UserAssembly = null;
Object oProvider = null;
Thread t = null;

try
{
AppDomain.CurrentDomain.SetData(KEY1, "PrivateKey");

UserDomain = AppDomain.CreateDomain("UserDomain");
UserDomain.SetData(KEY1, "Sh*t!");

UserAssembly = Assembly.LoadFrom("UserUtil.dll");

oProvider = UserDomain.CreateInstanceFrom("UserUtil.dll", "UserUtil.ServiceProvider").Unwrap();
// oProvider = UserAssembly.CreateInstance("UserUtil.ServiceProvider");

if (oProvider != null)
{
if (oProvider is SimpleUtil.IServiceProvider)
{
UserProvider = (SimpleUtil.IServiceProvider)oProvider;

t = new Thread(new ParameterizedThreadStart(Program.AsyncDoWork));
t.Start("Calling UserProvider.DoWork");
}
}

while (true)
{
Console.Write(".");
Thread.Sleep(1000 * 5);
}
}
catch (Exception Ex)
{
Console.WriteLine(Ex.Message);
}

return;
}

public static void AsyncDoWork(object Arg)
{
string Message = null;
Message = (string)Arg;
UserProvider.DoWork(Message); << If inside third party "DoWork" throws an exception, it'd crash the hosting app even it's instantiated from different AppDomain! Also it can access AppDomain.Current.GetData("SomeSecret"). On these two reasons - all this talk about AppDomain isolation are quite pointless.
return;
}
}
}

dev

GeneralRe: How do you protect your app hosting third party dll ...? Pin
Eddy Vluggen4-Mar-11 12:04
memberEddy Vluggen4-Mar-11 12:04 
GeneralRe: How do you protect your app hosting third party dll ...? [modified] Pin
devvvy4-Mar-11 23:28
memberdevvvy4-Mar-11 23:28 
GeneralRe: How do you protect your app hosting third party dll ...? Pin
Eddy Vluggen5-Mar-11 4:02
memberEddy Vluggen5-Mar-11 4:02 
GeneralRe: How do you protect your app hosting third party dll ...? Pin
devvvy5-Mar-11 15:24
memberdevvvy5-Mar-11 15:24 
GeneralRe: How do you protect your app hosting third party dll ...? Pin
Eddy Vluggen7-Mar-11 1:41
memberEddy Vluggen7-Mar-11 1:41 
GeneralRe: How do you protect your app hosting third party dll ...? Pin
devvvy7-Mar-11 15:27
memberdevvvy7-Mar-11 15:27 
QuestionUpdate progress bar on another form Pin
Etienne_1232-Mar-11 22:28
memberEtienne_1232-Mar-11 22:28 
AnswerRe: Update progress bar on another form Pin
musefan2-Mar-11 23:29
membermusefan2-Mar-11 23:29 
GeneralRe: Update progress bar on another form Pin
Etienne_1233-Mar-11 22:17
memberEtienne_1233-Mar-11 22:17 
AnswerRe: Update progress bar on another form Pin
DaveyM693-Mar-11 2:13
mentorDaveyM693-Mar-11 2:13 
GeneralRe: Update progress bar on another form Pin
Luc Pattyn3-Mar-11 2:36
mvpLuc Pattyn3-Mar-11 2:36 
GeneralRe: Update progress bar on another form Pin
DaveyM693-Mar-11 4:58
mentorDaveyM693-Mar-11 4:58 
GeneralRe: Update progress bar on another form Pin
Etienne_1233-Mar-11 21:00
memberEtienne_1233-Mar-11 21:00 
QuestionPausing execution for certain amount of time without freezing the form. Pin
john1234512-Mar-11 15:48
memberjohn1234512-Mar-11 15:48 
AnswerRe: Pausing execution for certain amount of time without freezing the form. Pin
Luc Pattyn2-Mar-11 16:31
mvpLuc Pattyn2-Mar-11 16:31 
AnswerRe: Pausing execution for certain amount of time without freezing the form. Pin
OriginalGriff2-Mar-11 22:19
mvpOriginalGriff2-Mar-11 22:19 
GeneralRe: Pausing execution for certain amount of time without freezing the form. Pin
Luc Pattyn3-Mar-11 1:53
mvpLuc Pattyn3-Mar-11 1:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.161205.3 | Last Updated 7 Dec 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid