Skip to content

how to call libc function #57

Description

@k4lizen

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions