[英]Intercept c++ class constructor with LD_PRELOAD
我按照此示例截取了類中的C ++函數。
但是,現在我想截取該類的構造函數和析構函數,而不僅僅是成員函數。
在該示例中,他確實使用typedef unsigned int (Foo::*methodType)() const;
。 我認為您不能在C ++中使用typedef構造函數/析構函數。
我該怎么做呢?
我嘗試了typedef void (QDBusConnection::*MyFunction)();
它可以工作,我可以用(this->*origMethod)();
即使origMethod是析構函數且沒有返回說明符。
我在這里寫了關於如何攔截析構函數和靜態類函數的步驟
http://www.osletek.com/learning-center/150/Intercepting_C%2B%2B_functions_using_LD_PRELOAD
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.