Click here to Skip to main content
15,916,463 members
Home / Discussions / C#
   

C#

 
GeneralRe: Help for code Pin
Eddy Vluggen3-Mar-11 6:45
professionalEddy Vluggen3-Mar-11 6:45 
GeneralRe: Help for code Pin
Girish4813-Mar-11 23:48
Girish4813-Mar-11 23:48 
GeneralRe: Help for code Pin
Eddy Vluggen4-Mar-11 12:16
professionalEddy Vluggen4-Mar-11 12:16 
GeneralRe: Help for code Pin
Girish4815-Mar-11 16:56
Girish4815-Mar-11 16:56 
GeneralRe: Help for code Pin
Eddy Vluggen6-Mar-11 0:42
professionalEddy Vluggen6-Mar-11 0:42 
QuestionHow do you protect your app hosting third party dll ...? [modified] Pin
devvvy2-Mar-11 21:32
devvvy2-Mar-11 21:32 
AnswerRe: How do you protect your app hosting third party dll ...? Pin
Eddy Vluggen3-Mar-11 6:58
professionalEddy Vluggen3-Mar-11 6:58 
GeneralRe: How do you protect your app hosting third party dll ...? Pin
devvvy3-Mar-11 15:21
devvvy3-Mar-11 15: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!
<br />
using System;<br />
using System.Collections.Generic;<br />
using System.Linq;<br />
using System.Text;<br />
<br />
using System.Threading;<br />
using System.Reflection;<br />
using System.Security.Policy;<br />
<br />
using UserUtil;<br />
using SimpleUtil;<br />
<br />
namespace SimpleTest<br />
{<br />
    class Program<br />
    {<br />
        public const string KEY1 = "KEY1";<br />
        public static AppDomain UserDomain = null;<br />
        public static SimpleUtil.IServiceProvider UserProvider = null;<br />
<br />
        static void Main(string[] args)<br />
        {<br />
            Assembly UserAssembly = null;<br />
            Object oProvider = null;<br />
            Thread t = null;<br />
<br />
            try<br />
            {<br />
                AppDomain.CurrentDomain.SetData(KEY1, "PrivateKey");<br />
<br />
                UserDomain = AppDomain.CreateDomain("UserDomain");<br />
                UserDomain.SetData(KEY1, "Sh*t!");<br />
                <br />
                UserAssembly = Assembly.LoadFrom("UserUtil.dll");<br />
                <br />
                oProvider = UserDomain.CreateInstanceFrom("UserUtil.dll", "UserUtil.ServiceProvider").Unwrap();<br />
                // oProvider = UserAssembly.CreateInstance("UserUtil.ServiceProvider");<br />
<br />
                if (oProvider != null)<br />
                {<br />
                    if (oProvider is SimpleUtil.IServiceProvider)<br />
                    {<br />
                        UserProvider = (SimpleUtil.IServiceProvider)oProvider;<br />
<br />
                        t = new Thread(new ParameterizedThreadStart(Program.AsyncDoWork));<br />
                        t.Start("Calling UserProvider.DoWork");<br />
                    }<br />
                }<br />
<br />
                while (true)<br />
                {<br />
                    Console.Write(".");<br />
                    Thread.Sleep(1000 * 5);<br />
                }<br />
            }<br />
            catch (Exception Ex)<br />
            {<br />
                Console.WriteLine(Ex.Message);<br />
            }<br />
<br />
            return;<br />
        }<br />
<br />
        public static void AsyncDoWork(object Arg)<br />
        {<br />
            string Message = null;<br />
            Message = (string)Arg;<br />
            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.<br />
            return;<br />
        }<br />
    }<br />
}<br />

dev

GeneralRe: How do you protect your app hosting third party dll ...? Pin
Eddy Vluggen4-Mar-11 11:04
professionalEddy Vluggen4-Mar-11 11:04 
GeneralRe: How do you protect your app hosting third party dll ...? [modified] Pin
devvvy4-Mar-11 22:28
devvvy4-Mar-11 22:28 
GeneralRe: How do you protect your app hosting third party dll ...? Pin
Eddy Vluggen5-Mar-11 3:02
professionalEddy Vluggen5-Mar-11 3:02 
GeneralRe: How do you protect your app hosting third party dll ...? Pin
devvvy5-Mar-11 14:24
devvvy5-Mar-11 14:24 
GeneralRe: How do you protect your app hosting third party dll ...? Pin
Eddy Vluggen7-Mar-11 0:41
professionalEddy Vluggen7-Mar-11 0:41 
GeneralRe: How do you protect your app hosting third party dll ...? Pin
devvvy7-Mar-11 14:27
devvvy7-Mar-11 14:27 
QuestionUpdate progress bar on another form Pin
Etienne_1232-Mar-11 21:28
Etienne_1232-Mar-11 21:28 
AnswerRe: Update progress bar on another form Pin
musefan2-Mar-11 22:29
musefan2-Mar-11 22:29 
GeneralRe: Update progress bar on another form Pin
Etienne_1233-Mar-11 21:17
Etienne_1233-Mar-11 21:17 
AnswerRe: Update progress bar on another form Pin
DaveyM693-Mar-11 1:13
professionalDaveyM693-Mar-11 1:13 
GeneralRe: Update progress bar on another form Pin
Luc Pattyn3-Mar-11 1:36
sitebuilderLuc Pattyn3-Mar-11 1:36 
GeneralRe: Update progress bar on another form Pin
DaveyM693-Mar-11 3:58
professionalDaveyM693-Mar-11 3:58 
GeneralRe: Update progress bar on another form Pin
Etienne_1233-Mar-11 20:00
Etienne_1233-Mar-11 20:00 
QuestionPausing execution for certain amount of time without freezing the form. Pin
john1234512-Mar-11 14:48
john1234512-Mar-11 14:48 
AnswerRe: Pausing execution for certain amount of time without freezing the form. Pin
Luc Pattyn2-Mar-11 15:31
sitebuilderLuc Pattyn2-Mar-11 15:31 
AnswerRe: Pausing execution for certain amount of time without freezing the form. Pin
OriginalGriff2-Mar-11 21:19
mveOriginalGriff2-Mar-11 21:19 
GeneralRe: Pausing execution for certain amount of time without freezing the form. Pin
Luc Pattyn3-Mar-11 0:53
sitebuilderLuc Pattyn3-Mar-11 0: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.