diff --git a/tests/test_binaries/x86_64/issue8 b/tests/test_binaries/x86_64/issue8 new file mode 100755 index 0000000..032c884 Binary files /dev/null and b/tests/test_binaries/x86_64/issue8 differ diff --git a/tests/test_x86_64.py b/tests/test_x86_64.py index 7527ffc..d1e547e 100644 --- a/tests/test_x86_64.py +++ b/tests/test_x86_64.py @@ -159,6 +159,19 @@ def test_replace_function_patch_with_function_reference_and_rodata(self): expected_returnCode=0, ) + def test_insert_instruction_patch_with_force_insert(self): + instrs = """ + mov rdi, rax + add rdi, 3 + call {puts} + """ + self.run_one( + "issue8", + [InsertInstructionPatch(0x117A, instrs, force_insert=True)], + expected_output=b"ched failed\n", + expected_returnCode=0, + ) + def run_one( self, filename,