fate0 / xmark

A PHP7 extension that can hook most functions/classes and parts of opcodes
BSD 3-Clause "New" or "Revised" License
239 stars 32 forks source link

[BUG] maybe cannot support PHP > 7.4 ? #8

Open zer0yu opened 4 years ago

zer0yu commented 4 years ago

My environment is

 z xmark master ✗ ❯ php -v
PHP 7.4.9 (cli) (built: Aug 27 2020 13:37:23) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.9, Copyright (c), by Zend Technologies

The error is

 z xmark master ❯ make            
/bin/bash /home/kali/Desktop/prvd/xmark/libtool --mode=compile cc  -I. -I/home/kali/Desktop/prvd/xmark -DPHP_ATOM_INC -I/home/kali/Desktop/prvd/xmark/include -I/home/kali/Desktop/prvd/xmark/main -I/home/kali/Desktop/prvd/xmark -I/usr/include/php/20190902 -I/usr/include/php/20190902/main -I/usr/include/php/20190902/TSRM -I/usr/include/php/20190902/Zend -I/usr/include/php/20190902/ext -I/usr/include/php/20190902/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /home/kali/Desktop/prvd/xmark/xmark.c -o xmark.lo 
mkdir .libs
 cc -I. -I/home/kali/Desktop/prvd/xmark -DPHP_ATOM_INC -I/home/kali/Desktop/prvd/xmark/include -I/home/kali/Desktop/prvd/xmark/main -I/home/kali/Desktop/prvd/xmark -I/usr/include/php/20190902 -I/usr/include/php/20190902/main -I/usr/include/php/20190902/TSRM -I/usr/include/php/20190902/Zend -I/usr/include/php/20190902/ext -I/usr/include/php/20190902/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/kali/Desktop/prvd/xmark/xmark.c  -fPIC -DPIC -o .libs/xmark.o
/home/kali/Desktop/prvd/xmark/xmark.c: In function ‘php_xmark_assign_op_overloaded_property’:
/home/kali/Desktop/prvd/xmark/xmark.c:357:61: error: ‘ZEND_ASSIGN_CONCAT’ undeclared (first use in this function); did you mean ‘ZEND_ASSIGN_OP’?
  357 |         z_fname = zend_hash_index_find(&XMARK_G(callbacks), ZEND_ASSIGN_CONCAT);
      |                                                             ^~~~~~~~~~~~~~~~~~
      |                                                             ZEND_ASSIGN_OP
/home/kali/Desktop/prvd/xmark/xmark.c:357:61: note: each undeclared identifier is reported only once for each function it appears in
/home/kali/Desktop/prvd/xmark/xmark.c: In function ‘php_xmark_binary_assign_op_obj_dim’:
/home/kali/Desktop/prvd/xmark/xmark.c:406:61: error: ‘ZEND_ASSIGN_CONCAT’ undeclared (first use in this function); did you mean ‘ZEND_ASSIGN_OP’?
  406 |         z_fname = zend_hash_index_find(&XMARK_G(callbacks), ZEND_ASSIGN_CONCAT);
      |                                                             ^~~~~~~~~~~~~~~~~~
      |                                                             ZEND_ASSIGN_OP
/home/kali/Desktop/prvd/xmark/xmark.c: In function ‘php_xmark_binary_assign_op_helper’:
/home/kali/Desktop/prvd/xmark/xmark.c:549:57: error: ‘ZEND_ASSIGN_CONCAT’ undeclared (first use in this function); did you mean ‘ZEND_ASSIGN_OP’?
  549 |     z_fname = zend_hash_index_find(&XMARK_G(callbacks), ZEND_ASSIGN_CONCAT);
      |                                                         ^~~~~~~~~~~~~~~~~~
      |                                                         ZEND_ASSIGN_OP
/home/kali/Desktop/prvd/xmark/xmark.c: In function ‘php_xmark_binary_assign_op_obj_helper’:
/home/kali/Desktop/prvd/xmark/xmark.c:620:65: error: ‘ZEND_ASSIGN_CONCAT’ undeclared (first use in this function); did you mean ‘ZEND_ASSIGN_OP’?
  620 |             z_fname = zend_hash_index_find(&XMARK_G(callbacks), ZEND_ASSIGN_CONCAT);
      |                                                                 ^~~~~~~~~~~~~~~~~~
      |                                                                 ZEND_ASSIGN_OP
/home/kali/Desktop/prvd/xmark/xmark.c: In function ‘php_xmark_binary_assign_op_dim_helper’:
/home/kali/Desktop/prvd/xmark/xmark.c:721:65: error: ‘ZEND_ASSIGN_CONCAT’ undeclared (first use in this function); did you mean ‘ZEND_ASSIGN_OP’?
  721 |             z_fname = zend_hash_index_find(&XMARK_G(callbacks), ZEND_ASSIGN_CONCAT);
      |                                                                 ^~~~~~~~~~~~~~~~~~
      |                                                                 ZEND_ASSIGN_OP
/home/kali/Desktop/prvd/xmark/xmark.c: In function ‘php_xmark_register_opcode_handlers’:
/home/kali/Desktop/prvd/xmark/xmark.c:1064:34: error: ‘ZEND_ASSIGN_CONCAT’ undeclared (first use in this function); did you mean ‘ZEND_ASSIGN_OP’?
 1064 |     zend_set_user_opcode_handler(ZEND_ASSIGN_CONCAT, php_xmark_assign_concat_handler);
      |                                  ^~~~~~~~~~~~~~~~~~
      |                                  ZEND_ASSIGN_OP
/home/kali/Desktop/prvd/xmark/xmark.c: In function ‘clear_function_run_time_cache’:
/home/kali/Desktop/prvd/xmark/xmark.c:1246:60: error: ‘zend_op_array’ {aka ‘struct _zend_op_array’} has no member named ‘run_time_cache’; did you mean ‘run_time_cache__ptr’?
 1246 |             fbc->op_array.cache_size == 0 || fbc->op_array.run_time_cache == NULL) return;
      |                                                            ^~~~~~~~~~~~~~
      |                                                            run_time_cache__ptr
/home/kali/Desktop/prvd/xmark/xmark.c:1248:26: error: ‘zend_op_array’ {aka ‘struct _zend_op_array’} has no member named ‘run_time_cache’; did you mean ‘run_time_cache__ptr’?
 1248 |     memset(fbc->op_array.run_time_cache, 0, fbc->op_array.cache_size);
      |                          ^~~~~~~~~~~~~~
      |                          run_time_cache__ptr
In file included from /usr/include/php/20190902/main/php.h:441,
                 from /home/kali/Desktop/prvd/xmark/xmark.c:24:
/home/kali/Desktop/prvd/xmark/xmark.c: In function ‘zm_startup_xmark’:
/home/kali/Desktop/prvd/xmark/xmark.c:1484:51: error: ‘ZEND_ASSIGN_CONCAT’ undeclared (first use in this function); did you mean ‘ZEND_ASSIGN_OP’?
 1484 |     REGISTER_LONG_CONSTANT("XMARK_ASSIGN_CONCAT", ZEND_ASSIGN_CONCAT, CONST_CS|CONST_PERSISTENT);
      |                                                   ^~~~~~~~~~~~~~~~~~
/usr/include/php/20190902/Zend/zend_constants.h:53:105: note: in definition of macro ‘REGISTER_LONG_CONSTANT’
   53 | NT(name, lval, flags)  zend_register_long_constant((name), sizeof(name)-1, (lval), (flags), module_number)
      |                                                                             ^~~~

make: *** [Makefile:191: xmark.lo] Error 1
supertom-spec commented 3 years ago

@zer0yu I tried to fix the compile error but other problem occurs, so I downgrade to PHP7.3

zer0yu commented 3 years ago

@zer0yu I tried to fix the compile error but other problem occurs, so I downgrade to PHP7.3

yep, I also downgrade to PHP7.3, but I am try to enhanced it to support (>) PHP7.4