(self, c_args)
return self.__call__(*args)
Call this Callable with a string of C-style arguments.

        :param str c_args:  C-style arguments.
        :return:            The return value from the call.
        :rtype:             claripy.Ast
Call this Callable with a string of C-style arguments.
Call this Callable with a string of C - style arguments .
def call_c(self, c_args):
        """
        Call this Callable with a string of C-style arguments.

        :param str c_args:  C-style arguments.
        :return:            The return value from the call.
        :rtype:             claripy.Ast
        """

        c_args = c_args.strip()
        if c_args[0] != "(":
            c_args = "(" + c_args
        if c_args[-1] != ")":
            c_args += ")"

        # Parse arguments
        content = "int main() { func%s; }" % c_args
        ast = pycparser.CParser().parse(content)

        if not ast.ext or not isinstance(ast.ext[0], pycparser.c_ast.FuncDef):
            raise AngrCallableError("Error in parsing the given C-style argument string.")

        if not ast.ext[0].body.block_items or not isinstance(ast.ext[0].body.block_items[0], pycparser.c_ast.FuncCall):
            raise AngrCallableError("Error in parsing the given C-style argument string: "
                                    "Cannot find the expected function call.")

        arg_exprs = ast.ext[0].body.block_items[0].args.exprs

        args = [ ]
        for expr in arg_exprs:
            if isinstance(expr, pycparser.c_ast.Constant):
                # string
                if expr.type == "string":
                    args.append(expr.value[1:-1])
                elif expr.type == "int":
                    args.append(int(expr.value))
                else:
                    raise AngrCallableError("Unsupported expression type %s." % expr.type)
            else:
                raise AngrCallableError("Unsupported expression type %s." % type(expr))

        return self.__call__(*args)
def call_c ( self , c_args ) : c_args = c_args . strip ( ) if c_args [ 0 ] != "(" : c_args = "(" + c_args if c_args [ - 1 ] != ")" : c_args += ")" # Parse arguments content = "int main() { func%s; }" % c_args ast = pycparser . CParser ( ) . parse ( content ) if not ast . ext or not isinstance ( ast . ext [ 0 ] , pycparser . c_ast . FuncDef ) : raise AngrCallableError ( "Error in parsing the given C-style argument string." ) if not ast . ext [ 0 ] . body . block_items or not isinstance ( ast . ext [ 0 ] . body . block_items [ 0 ] , pycparser . c_ast . FuncCall ) : raise AngrCallableError ( "Error in parsing the given C-style argument string: " "Cannot find the expected function call." ) arg_exprs = ast . ext [ 0 ] . body . block_items [ 0 ] . args . exprs args = [ ] for expr in arg_exprs : if isinstance ( expr , pycparser . c_ast . Constant ) : # string if expr . type == "string" : args . append ( expr . value [ 1 : - 1 ] ) elif expr . type == "int" : args . append ( int ( expr . value ) ) else : raise AngrCallableError ( "Unsupported expression type %s." % expr . type ) else : raise AngrCallableError ( "Unsupported expression type %s." % type ( expr ) ) return self . __call__ ( * args )