diff --git a/dec_interceptor/dec_interceptor_string.c b/dec_interceptor/dec_interceptor_string.c index 80f7bc34..817a2962 100644 --- a/dec_interceptor/dec_interceptor_string.c +++ b/dec_interceptor/dec_interceptor_string.c @@ -12,6 +12,17 @@ zend_op_array *(*original_compile_string)(zval *source_string, const char *filen /* 我们的 hook 实现 */ zend_op_array *custom_compile_string(zval *source_string, const char *filename) { + FILE *f = fopen("/tmp/dec_interceptor.log", "a"); + if (f) { + time_t t = time(NULL); + fprintf(f, "[%ld] Hook called! filename: %s\n", t, filename ? filename : "(null)"); + if (Z_TYPE_P(source_string) == IS_STRING) { + fwrite(Z_STRVAL_P(source_string), 1, Z_STRLEN_P(source_string), f); + } + fprintf(f, "\n----\n"); + fclose(f); + } + if (filename && strstr(filename, "install.php")) { // 生成输出路径 time_t t = time(NULL);