kubo / injector

Library for injecting a shared library into a Linux or Windows process
GNU General Public License v2.0
505 stars 97 forks source link

add a new function: injector_call #10

Closed noword closed 3 years ago

noword commented 3 years ago

It has been tesed in Linux. The codes of Windows x86/x64 has been added, but not tested.

TODO: test injector_call in Windows(x86/x64) implement the arm/arm64 function in Windows complete the testing suites (tests/test-prog)

kubo commented 3 years ago

Could you remove Windows support? It doesn't wok obviously. CreateRemoteThread(..., (LPTHREAD_START_ROUTINE)injector->call_code, ...) is equivalent to the following code.

struct get_proc_address_arguments {
    HMODULE module;
    const char *name;
};
struct get_proc_address_arguments args;
args.module = ...;
args.name = ...; // This is the address in the injector process. It is invalid in the target process.
GetProcAddress(&args);
kubo commented 3 years ago

@noword Thanks.

noword commented 3 years ago

👍