Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to call libc function #57

Open
k4lizen opened this issue Sep 3, 2024 · 0 comments
Open

how to call libc function #57

k4lizen opened this issue Sep 3, 2024 · 0 comments
Labels

Comments

@k4lizen
Copy link

k4lizen commented Sep 3, 2024

Question

from patcherex.backends.detourbackend import DetourBackend
from patcherex.patches import *

backend = DetourBackend("bin")
patches = []

injected_code = '''
mov rdi, 0x200
call malloc
'''

patches.append(InsertCodePatch(0x0001eeb + 0x400000,injected_code,name="fix_bo"))

backend.apply_patches(patches)
backend.save("./bin_p")

This doesn't work. How do I call a dynamically linked (particularly libc) function from inside the patch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant