Example #1
0
    def do_dcl(self, params):
        """Draw calls. Type '--help' for more information."""
        try:
            args = self.dcl_parser.parse_args(params.split())
            results = self.get_calls(args)

            # Create new graph
            calls_graph = CallGraph()
            for r in results:
                calls_graph.add_call(r)

            # Finalize graph
            calls_graph.finalize()

            # Write output
            if args.output:
                if results:
                    calls_graph.write(args.output_format, args.output,
                                      args.output_prog, args.output_args)
                    log.info("Wrote results to %s" % args.output)
                else:
                    log.info("No results :(")

        except SystemExit:
            pass
Example #2
0
    def do_dcl(self, params):
        """Draw calls. Type '--help' for more information."""
        try:
            args = self.dcl_parser.parse_args(params.split())
            results = self.get_calls(args)

            # Create new graph
            calls_graph = CallGraph()
            for r in results:
                calls_graph.add_call(r)

            # Finalize graph
            calls_graph.finalize()

            # Write output
            if args.output:
                if results:
                    calls_graph.write(
                        args.output_format, args.output,
                        args.output_prog, args.output_args)
                    log.info("Wrote results to %s" % args.output)
                else:
                    log.info("No results :(")

        except SystemExit:
            pass
Example #3
0
    def do_dxcl(self, params):
        """Draw cross calls. Type '--help' for more information."""
        try:
            args = self.dxcl_parser.parse_args(params.split())
            calls_args = argparse.Namespace()

            if args.class_name:
                if args.direction == 'to':
                    calls_args.to_class = args.class_name
                elif args.direction == 'from':
                    calls_args.from_class = args.class_name

            if args.method_name:
                if args.direction == 'to':
                    calls_args.to_method = args.method_name
                elif args.direction == 'from':
                    calls_args.from_method = args.method_name

            log.info(calls_args)
            # Get calls
            results = self.get_calls(calls_args)

            # Get cross-references
            xresults = self.analysis.xref_call(results, args.direction,
                                               args.xref_depth)

            # Create new graph
            calls_graph = CallGraph()

            for r in xresults:
                calls_graph.add_call(r)

            # Finalize graph
            calls_graph.finalize()

            # Write output
            if args.output:
                calls_graph.write(args.output_format, args.output,
                                  args.output_prog, args.output_args)
                log.info("Wrote results to %s" % args.output)

        except SystemExit:
            pass
Example #4
0
    def do_dxcl(self, params):
        """Draw cross calls. Type '--help' for more information."""
        try:
            args = self.dxcl_parser.parse_args(params.split())
            calls_args = argparse.Namespace()

            if args.class_name:
                if args.direction == 'to':
                    calls_args.to_class = args.class_name
                elif args.direction == 'from':
                    calls_args.from_class = args.class_name

            if args.method_name:
                if args.direction == 'to':
                    calls_args.to_method = args.method_name
                elif args.direction == 'from':
                    calls_args.from_method = args.method_name

            log.info(calls_args)
            # Get calls
            results = self.get_calls(calls_args)

            # Get cross-references
            xresults = self.analysis.xref_call(results, args.direction, args.xref_depth)

            # Create new graph
            calls_graph = CallGraph()

            for r in xresults:
                calls_graph.add_call(r)

            # Finalize graph
            calls_graph.finalize()

            # Write output
            if args.output:
                calls_graph.write(args.output_format, args.output, args.output_prog, args.output_args)
                log.info("Wrote results to %s" % args.output)

        except SystemExit:
            pass