Beispiel #1
0
    public bool Run(string FilePath, bool RunStaticAnalysis)
    {
        if (m_InTask)
        {
            return(false);
        }
        string ProgramName = FilePath;

        if (ProgramName.ToLower().EndsWith(".lnk"))
        {
            ProgramName = LnkHelper.GetShortcutTargetFile(ProgramName);
            if (string.IsNullOrEmpty(ProgramName))
            {
                m_NotifyError("Couldn't resolve symbolic link");
                CleanupVars();
                return(false);
            }
        }

        if (!ProgramName.ToLower().EndsWith(".exe"))
        {
            m_NotifyError("Only *.exe (PE files) are supported");
            CleanupVars();
            return(false);
        }


        m_FilePath = FilePath;

        if (CheckStaticAnalysisResultIsPersent(FilePath))
        {
            m_NotifyStatus("Found the last static analysis result");
            CleanupVars();
            RunStaticAnalysis = false;
        }

        if (!RunStaticAnalysis)
        {
            CreateProcessAndExit(ProgramName);
        }


        m_InTask = true;
        return(RunStaticAnalysisSubProcess(ProgramName));
    }
Beispiel #2
0
    public bool Run(string FilePath)
    {
        string ProgramName = FilePath;

        if (ProgramName.ToLower().EndsWith(".lnk"))
        {
            ProgramName = LnkHelper.GetShortcutTargetFile(ProgramName);
            if (string.IsNullOrEmpty(ProgramName))
            {
                NotifyError("Couldn't resolve symbolic link");
                return(false);
            }
        }

        if (!ProgramName.ToLower().EndsWith(".exe"))
        {
            NotifyError("Only *.exe (PE files) are supported");
            return(false);
        }

        CreateProcessWithDll(FilePath);
        Environment.Exit(0);
        return(true);
    }