Exemplo n.º 1
0
        static DI()
        {
            log    = new WinFormsUILog();
            config = new KO2Config();

            o2MessageQueue = KO2MessageQueue.getO2KernelQueue();
        }
Exemplo n.º 2
0
        static DI()
        {
            //Apply .NET Network Connection hack
            O2Kernel_Web.ApplyNetworkConnectionHack();

            // all these variables need to be setup
            appDomainsControledByO2Kernel = new Dictionary <string, O2AppDomainFactory>();
            log            = new KO2Log();
            reflection     = new KReflection();
            o2MessageQueue = KO2MessageQueue.getO2KernelQueue();

            // before we load the O2Config data (which is loaded from the local disk)
            config = O2ConfigLoader.getKO2Config();

            //make sure theses values are set (could be a prob due to changed location of these values)
            if (config.LocalScriptsFolder == null)
            {
                config.LocalScriptsFolder       = KO2Config.defaultLocalScriptFolder;
                config.SvnO2RootFolder          = KO2Config.defaultSvnO2RootFolder;
                config.SvnO2DatabaseRulesFolder = KO2Config.defaultSvnO2DatabaseRulesFolder;
            }

            O2KernelProcessName = "Generic O2 Kernel Process";;
            AppDomainUtils.registerCurrentAppDomain();
        }
        //public static string ascx_ScriptControl { get; set; }
        //[STAThread]

        private static void Main()

        {
            if (O2Messages.openAscxGui())
            {
                KO2MessageQueue.getO2KernelQueue().onMessages += ascx_Scripts_onMessages;

                // O2 Debugger
                O2AscxGUI.openAscx(typeof(ascx_O2MdbgShell), O2DockState.DockBottom, ascx_O2MdbgShellName); //this needs to be opened before the ascx_Breakpoints


                // scripts controls
                //O2AscxGUI.openAscx(typeof(ascx_Scripts), O2DockState.Document, ascx_ScriptsName); // this needs to loaded before ascx_ScriptsFolder
                var scriptsFolder = (ascx_ScriptsFolder)O2AscxGUI.openAscx(typeof(ascx_ScriptsFolder), O2DockState.DockLeft, ascx_ScriptsFolderName);
                scriptsFolder.loadSampleScripts();

                O2AscxGUI.openAscx(typeof(ascx_AssemblyInvoke), O2DockState.DockRight, ascx_AssemblyInvokeName);

                /*O2AscxGUI.openAscx(typeof(ascx_Breakpoints), O2DockState.DockRightAutoHide, ascx_BreakpointsName);
                *  O2AscxGUI.openAscx(typeof(ascx_BreakpointCreator), O2DockState.DockRightAutoHide, ascx_BreakpointCreatorName);
                *  O2AscxGUI.openAscx(typeof(ascx_Variables), O2DockState.DockRightAutoHide, ascx_CurrentFrameDetailsName);
                *  O2AscxGUI.openAscx(typeof(ascx_FindingsCreator), O2DockState.DockRight, ascx_FindingsCreatorName);*/
                O2AscxGUI.addControlToMenu(typeof(ascx_Breakpoints), O2DockState.DockRightAutoHide, ascx_BreakpointsName);
                O2AscxGUI.addControlToMenu(typeof(ascx_BreakpointCreator), O2DockState.DockRightAutoHide, ascx_BreakpointCreatorName);
                O2AscxGUI.addControlToMenu(typeof(ascx_Variables), O2DockState.DockRightAutoHide, ascx_CurrentFrameDetailsName);
                O2AscxGUI.addControlToMenu(typeof(ascx_FindingsCreator), O2DockState.DockRight, ascx_FindingsCreatorName);
            }
        }
Exemplo n.º 4
0
 private void ascx_BreakpointCreator_Load(object sender, EventArgs e)
 {
     if (!DesignMode)
     {
         KO2MessageQueue.getO2KernelQueue().onMessages += ascx_BreakpointCreator_onMessages;
     }
 }
 public ascx_AssemblyInvoke()
 {
     InitializeComponent();
     btExecuteMethodWithoutDebugger.Enabled = false;
     btExecuteAssemblyUnderDebug.Enabled    = false;
     btDebugMethod.Enabled = false;
     KO2MessageQueue.getO2KernelQueue().onMessages += ascx_AssemblyInvoke_onMessages;
 }
 private void onLoad()
 {
     if (!DesignMode && runOnLoad)
     {
         KO2MessageQueue.getO2KernelQueue().onMessages += ascx_Breakpoints_onMessages; // Handle O2 messages
         runOnLoad = false;
     }
 }
Exemplo n.º 7
0
        static DI()
        {
            log    = PublicDI.log;    // new WinFormsUILog();
            config = PublicDI.config; //new KO2Config();

            searchEngineAPI = new DotNetWrappers.SearchApi.SearchEngine();
            o2MessageQueue  = KO2MessageQueue.getO2KernelQueue();
            searchEngineAPI = new DotNetWrappers.SearchApi.SearchEngine();
        }
Exemplo n.º 8
0
 private void onLoad()
 {
     if (DesignMode == false && runOnLoad)
     {
         runOnLoad = false;
         KO2MessageQueue.getO2KernelQueue().onMessages += handleKernelMessage;
         createNewDynamicO2Finding();
     }
 }
Exemplo n.º 9
0
        static DI()
        {
            log            = PublicDI.log; // _note that when the O2GuiWithDockPanel is create it will overide the PublicDI log with WinFormsUILog() object
            reflection     = PublicDI.reflection;
            config         = PublicDI.config;
            o2MessageQueue = KO2MessageQueue.getO2KernelQueue();

            new O2MessagesHandler(); // set up O2Message hook

            autoAddLogViewerToGui = true;
        }
        //private string guiXmlFormat = Path.Combine(PublicDI.o2CorLibConfig.O2TempDir, "GuiFormat.xml");

        public O2GuiWithDockPanel()
        {
            InitializeComponent();
            if (DesignMode == false)
            {
                // set the logRedirection in the  publicDI log so that all messages go to the GUIs Log (and visible by the LogViewer)
                PublicDI.log.LogRedirectionTarget = new WinFormsUILog(); // first create the one we are going to use locally
                KO2MessageQueue.getO2KernelQueue().onMessages += o2MessageQueue_onMessages;
                O2AscxGUI.o2GuiWithDockPanel  = this;
                cbAutoSendLogsOnClose.Checked = false; // ClickOnceDeployment.isApplicationBeingExecutedViaClickOnceDeployment();
            }
        }
Exemplo n.º 11
0
 private void onLoad()
 {
     if (DesignMode == false && runOnLoad)
     {
         XRules_DatabaseSetup.installXRulesDatabase();
         runOnLoad = false;
         // for performance reasons don't compile on load
         //compileXRules();
         KO2MessageQueue.getO2KernelQueue().onMessages += o2Kernel_onMessages;
         findingsViewer_XRulesExecution._ShowNoEnginesLoadedAlert = false;
         setRecompileRulesOnGlobalRecompileEvent(false);
     }
 }
        private void O2GuiWithDockPanel_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (cbAutoSendLogsOnClose.Checked)
            {
                sendEmailToO2Support("On Form Closing", "Closed at: " + DateTime.Now.ToShortTimeString(), false);
            }
            PublicDI.log.LogRedirectionTarget = null;

            KO2MessageQueue.getO2KernelQueue().onMessages -= o2MessageQueue_onMessages;
            O2AscxGUI.o2GuiWithDockPanel = null;                  // reset this value since this GUI is not available anymore
            O2AscxGUI.guiClosed.Set();                            // set flag to the treads on WaitFor() can continute
            PublicDI.log.info("O2GuiWithDockPanel form Closing"); // this log entry should now go to the Debug View
        }
Exemplo n.º 13
0
        static void Main()
        {
            KO2MessageQueue.getO2KernelQueue().onMessages +=
                o2Message => HandleO2MessageOnSD.o2MessageHelper_Handle_IM_FileOrFolderSelected(o2Message, DI.staticViewerControlName);

            ascx_FindingsViewer.o2AssessmentLoadEngines.Add(new O2AssessmentLoad_OunceV6());
            ascx_FindingsViewer.o2AssessmentLoadEngines.Add(new O2AssessmentLoad_OunceV6_1());
            ascx_FindingsViewer.o2AssessmentLoadEngines.Add(new O2AssesmentLoad_FindBugs());
            ascx_FindingsViewer.o2AssessmentLoadEngines.Add(new O2AssesmentLoad_CodeCrawler());
            //ascx_FindingsViewer.o2AssessmentLoadEngines.Add(new O2AssesmentLoad_Fortify());
            ascx_FindingsViewer.o2AssessmentLoadEngines.Add(new O2AssesmentLoad_AppScanDE());
            ascx_FindingsViewer.o2AssessmentLoadEngines.Add(new O2AssesmentLoad_WebScarab());

            ascx_FindingsViewer.o2AssessmentSave = new O2AssessmentSave_OunceV6();

            if (O2AscxGUI.launch("Findings Viewer"))
            {
                O2AscxGUI.openAscx(typeof(ascx_FindingsViewer), O2DockState.Document, DI.staticViewerControlName);
                //O2AscxGUI.openAscx(typeof(ascx_Scripts), O2DockState.Document, "Scripts");
            }
        }
 public static void setO2MessageMdbgListener()
 {
     KO2MessageQueue.getO2KernelQueue().onMessages += o2KernelQueue_onMessages;
 }
Exemplo n.º 15
0
 public static void setO2MessageFileEventListener(string staticViewerControlName)
 {
     KO2MessageQueue.getO2KernelQueue().onMessages +=
         o2Message => o2MessageHelper_Handle_IM_FileOrFolderSelected(o2Message, staticViewerControlName);
 }
 static O2MessagesHandler()
 {
     KO2MessageQueue.getO2KernelQueue().onMessages += (o2MessageQueue_onMessages);
 }