开发者

DLL Injection, threads and memory releasing

I have a following situation - i inject a dll written in C into another process, that dll loads CLR and starts a thread calling a method from managed class library.

My question is - how and when should I release memory of all these objects, so that target process (in which I inject dll initially) can successfully exit and free it's resour开发者_运维百科ces, including releasing a lock from my dll which was injected?


how about this:

since you are already DLL injecting your code its only small step further to hook the exit / cleanup call of your target process and do:

  • Jump to your code
  • stop threads
  • cleanup mem
  • jump back
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜