Exemple #1
0
    def test_syscall_retval(self):
        zml_object = self.zml_parser.parse_zml_string(
            "syscall=brk,retval=0x20")

        self.assertTrue(
            zml_object.is_satisfied(self.zelos, "brk",
                                    Args([Arg("type", "name1", 0x10, "")]),
                                    0x20))

        self.assertFalse(
            zml_object.is_satisfied(self.zelos, "brk",
                                    Args([Arg("type", "name1", 0x10, "")]),
                                    0x21))
Exemple #2
0
    def test_syscall_basic(self):
        zml_object = self.zml_parser.parse_zml_string("syscall=brk")

        self.assertTrue(
            zml_object.is_satisfied(self.zelos, "brk",
                                    Args([Arg("type", "name", 0x10, "")]),
                                    0x20))
        # Check that it continues to be satisfied.
        self.assertTrue(
            zml_object.is_satisfied(self.zelos, "brk",
                                    Args([Arg("type", "name", 0x10, "")]),
                                    0x20))

        self.assertFalse(
            zml_object.is_satisfied(self.zelos, "open",
                                    Args([Arg("type", "name", 0x10, "")]),
                                    0x20))