This commit is contained in:
hailin 2025-07-30 22:42:06 +08:00
parent e84561752d
commit 8da5e5e5dc
1 changed files with 11 additions and 0 deletions

View File

@ -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);