Пример #1
0
    def n_opcode_set_symbol_trailing_flags_imm_helper(self, teststr, immediate):
        s = BindingState(is_64=True)

        s.index = 0
        blob = teststr + b"\x00"

        n_opcode_set_trailing_flags_imm(s, None, immediate, blob)
        self.assertEqual(s.sym_name, teststr.decode('ascii'))
        # plus one because there is the 0 byte at the end
        self.assertEqual(s.index, len(teststr) + 1)
        self.assertEqual(s.sym_flags, immediate)
Пример #2
0
 def n_opcode_set_addend_sleb_helper(self, blob, expected):
     s = BindingState(is_64=True)
     s.index = 0
     n_opcode_set_addend_sleb(s, None, None, blob)
     self.assertEqual(s.addend, expected)
Пример #3
0
    def n_opcode_set_dylib_ordinal_uleb_helper(self, blob, expected):
        s = BindingState(is_64=True)

        s.index = 0
        n_opcode_set_dylib_ordinal_uleb(s, None, None, blob)
        self.assertEqual(s.lib_ord, expected)