Skip to content

Commit

Permalink
add test for #8
Browse files Browse the repository at this point in the history
  • Loading branch information
DennyDai committed Feb 13, 2024
1 parent 6765fba commit b3cfa1b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Binary file added tests/test_binaries/x86_64/issue8
Binary file not shown.
13 changes: 13 additions & 0 deletions tests/test_x86_64.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit b3cfa1b

Please sign in to comment.