1
我試圖編寫一個PHP模塊,用於檢測在php cgi文件中調用的zend內部函數。喜歡的代碼如下所示,我想在我的代碼中找到它的名字 - 'printf'。如何獲取函數名稱,當我把它掛在一個php擴展中
<?php printf("Hello SO!");?>
Now我hooked與一個named function此function「zend_set_user_opcode_handler'.However我am not able到get which was hooked的function name。(它是 'printf' 在這個example。)So,what should如果我想在函數hook_handler()中實現'printf',我會這樣做嗎?
這裏的代碼。
int shellhook_handler(ZEND_OPCODE_HANDLER_ARGS){
/* What should I do to catch function name here*/
return ZEND_USER_OPCODE_DISPATCH;
}
PHP_MINIT_FUNCTION(shellhook)
{
REGISTER_INI_ENTRIES();
zend_set_user_opcode_handler(ZEND_DO_FCALL, hook_handler);
return SUCCESS;
}