Esempio n. 1
0
        public virtual Parser build()
        {
            Parser parser = new Parser();

            AAction.displaySemi  = true;
            AAction.displayStack = false;  // this is default so redundant
            PushStack       push     = new PushStack(repo);
            DetectNamespace detectNS = new DetectNamespace();

            detectNS.add(push);
            parser.add(detectNS);
            DetectClass detectCl = new DetectClass();

            detectCl.add(push);
            parser.add(detectCl);
            DetectFunction detectFN = new DetectFunction();

            detectFN.add(push);
            parser.add(detectFN);
            DetectScope detectScop = new DetectScope();

            detectScop.add(push);
            parser.add(detectScop);
            DetectScopeWithoutBraces detectScopWB = new DetectScopeWithoutBraces();

            detectScopWB.add(push);
            parser.add(detectScopWB);
            DetectAnonymousScope anon = new DetectAnonymousScope();

            anon.add(push);
            parser.add(anon);
            DetectLeavingScopeWithoutBraces leaveWB = new DetectLeavingScopeWithoutBraces();
            PopStack popWB = new PopStack(repo);

            leaveWB.add(popWB);
            parser.add(leaveWB);
            DetectLeavingScope leave = new DetectLeavingScope();
            PopStack           pop   = new PopStack(repo);

            leave.add(pop);
            parser.add(leave);

            return(parser);
        }
Esempio n. 2
0
        public virtual Parser build()
        {
            Parser parser = new Parser();

            // decide what to show
            AAction.displaySemi  = true;
            AAction.displayStack = false;  // this is default so redundant

            // action used for namespaces, classes, and functions
            PushStack push = new PushStack(repo);

            // capture namespace info
            DetectNamespace detectNS = new DetectNamespace();

            detectNS.add(push);
            parser.add(detectNS);

            // capture class info
            DetectClass detectCl = new DetectClass();

            detectCl.add(push);
            parser.add(detectCl);

            // capture function info
            DetectFunction detectFN = new DetectFunction();

            detectFN.add(push);
            parser.add(detectFN);

            // handle these scopes -  "if", "for", "foreach", "while", "catch", "try", "switch" among others
            DetectScope detectScop = new DetectScope();

            detectScop.add(push);
            parser.add(detectScop);

            // handle these scopes without braces-  "if", "for", "foreach", "while", "catch", "try", "switch" among others
            DetectScopeWithoutBraces detectScopWB = new DetectScopeWithoutBraces();

            detectScopWB.add(push);
            parser.add(detectScopWB);

            // handle entering anonymous scopes, e.g., if, while, etc.
            DetectAnonymousScope anon = new DetectAnonymousScope();

            anon.add(push);
            parser.add(anon);

            // handle leaving scopes
            DetectLeavingScopeWithoutBraces leaveWB = new DetectLeavingScopeWithoutBraces();
            PopStack popWB = new PopStack(repo);

            leaveWB.add(popWB);
            parser.add(leaveWB);

            // handle leaving scopes
            DetectLeavingScope leave = new DetectLeavingScope();
            PopStack           pop   = new PopStack(repo);

            leave.add(pop);
            parser.add(leave);

            // parser configured
            return(parser);
        }
Esempio n. 3
0
        public virtual Parser build()
        {
            Parser parser = new Parser();
            AAction.displaySemi = true;
            AAction.displayStack = false;  // this is default so redundant
            PushStack push = new PushStack(repo);
            DetectNamespace detectNS = new DetectNamespace();
            detectNS.add(push);
            parser.add(detectNS);
            DetectClass detectCl = new DetectClass();
            detectCl.add(push);
            parser.add(detectCl);
            DetectFunction detectFN = new DetectFunction();
            detectFN.add(push);
            parser.add(detectFN);
            DetectScope detectScop = new DetectScope();
            detectScop.add(push);
            parser.add(detectScop);
            DetectScopeWithoutBraces detectScopWB = new DetectScopeWithoutBraces();
            detectScopWB.add(push);
            parser.add(detectScopWB);
            DetectAnonymousScope anon = new DetectAnonymousScope();
            anon.add(push);
            parser.add(anon);
            DetectLeavingScopeWithoutBraces leaveWB = new DetectLeavingScopeWithoutBraces();
            PopStack popWB = new PopStack(repo);
            leaveWB.add(popWB);
            parser.add(leaveWB);
            DetectLeavingScope leave = new DetectLeavingScope();
            PopStack pop = new PopStack(repo);
            leave.add(pop);
            parser.add(leave);

            return parser;
        }
Esempio n. 4
0
        public virtual Parser build()
        {
            Parser parser = new Parser();

            // decide what to show
            AAction.displaySemi = true;
            AAction.displayStack = false;  // this is default so redundant

            // action used for namespaces, classes, and functions
            PushStack push = new PushStack(repo);

            // capture namespace info
            DetectNamespace detectNS = new DetectNamespace();
            detectNS.add(push);
            parser.add(detectNS);

            // capture class info
            DetectClass detectCl = new DetectClass();
            detectCl.add(push);
            parser.add(detectCl);

            // capture function info
            DetectFunction detectFN = new DetectFunction();
            detectFN.add(push);
            parser.add(detectFN);

            // handle these scopes -  "if", "for", "foreach", "while", "catch", "try", "switch" among others
            DetectScope detectScop = new DetectScope();
            detectScop.add(push);
            parser.add(detectScop);

            // handle these scopes without braces-  "if", "for", "foreach", "while", "catch", "try", "switch" among others
            DetectScopeWithoutBraces detectScopWB = new DetectScopeWithoutBraces();
            detectScopWB.add(push);
            parser.add(detectScopWB);

            // handle entering anonymous scopes, e.g., if, while, etc.
            DetectAnonymousScope anon = new DetectAnonymousScope();
            anon.add(push);
            parser.add(anon);

            // handle leaving scopes
            DetectLeavingScopeWithoutBraces leaveWB = new DetectLeavingScopeWithoutBraces();
            PopStack popWB = new PopStack(repo);
            leaveWB.add(popWB);
            parser.add(leaveWB);

            // handle leaving scopes
            DetectLeavingScope leave = new DetectLeavingScope();
            PopStack pop = new PopStack(repo);
            leave.add(pop);
            parser.add(leave);

            // parser configured
            return parser;
        }