Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hooking in .Net

Tags:

c#

.net

clr

hook

I want to hook some function in .Net is there a way to do it? I don’t mean windows hooking, I want to hook CLR function like when DataAdapter.Fill is called Thanks,

like image 617
Oded Avatar asked Jan 01 '26 08:01

Oded


1 Answers

This is not possible in general.
For diagnostics purposes, you can use Moles, but I wouldn't recommend it for production use,

In specific cases, you can make an inherited class that overrides a virtual function.

like image 119
SLaks Avatar answered Jan 03 '26 20:01

SLaks



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!