Closed enty8080 closed 1 year ago
I implemented this functionality.
@enty8080 i want use this feature with ur fork, can u add a doc to use it? thanks
@zhiying8710 I just pass an argument of type int
to injector__call_function
here - https://github.com/enty8080/injector/blob/9e8a34eafce49042546881ef8c442982031d6b15/src/linux/injector.c#L187
Hey @kubo,
Love your tool so much and tend to use it for my experiments! I was just wondering, is it possible to pass an argument to a shared object which is being injected. For example, I need to pass
sockfd
which isint
to myinit
function.How can I do this? Or, if it can be implemented, can you suggest me how to do this and I fork your repository and add this by myself.
I also found
injector_call
, but it works only withvoid(*)(void)
, I just want to add a support forvoid(*)(int)
. Is it possible?I really need this for my new project, so I'll be glad if you help me.
Thanks in advance.
P.S. Another question that comes to my mind: Will injector work within statically linked executable (compiled with libinjector and
-static
)?P.P.S. I checked it with
-static
and it works. It's a surprise for me, because I thought thatdlopen
works only with dynamic linking. Turns out, if you compilecmd/main.c
with-static
injection will work.