简体   繁体   English

在注入的过程中从DLL调用函数

[英]Calling a function from DLL, in an injected process

Is there a way to call a function, that resides in a dll, (the dll is injected into a process) from that process? 有没有办法从该进程中调用驻留在dll中的函数(该dll注入到进程中)?

By this I mean if i have myDLL.dll that exports a function, lets say void f(){do sth} and a process myProcess , "myDLL.dll" is injected using CreateRemoteThread() , can I call f() from myProcess so actually myProcess is the "user" that initiated the call to this function ? 我的意思是,如果我有导出函数的myDLL.dll ,可以说是void f(){do sth}和一个进程myProcess ,则使用CreateRemoteThread()注入了“ myDLL.dll”,我可以从myProcess调用f() myProcess因此,实际上myProcess是发起对此函数调用的“用户”吗?

I need to do this because I want the function f() not to be dependent by a certain program that can be killed in Task Manager, since employes can find the process and kill it. 我之所以需要这样做,是因为我希望函数f()不受某个可以在任务管理器中终止的程序的依赖,因为员工可以找到该进程并将其终止。 My manager asked me to do this because he thinks employees are doing other things than work. 我的经理要求我这样做,因为他认为员工除了工作以外还做其他事情。

只需使用通常的LoadLibrary()GetProcAddress()

What you want to do probably won't work, and isn't the right approach anyway. 您想做的事情可能行不通,而且也不是正确的方法。 The correct solution for preventing users from killing a process can be found here . 此处可以找到防止用户终止进程的正确解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM