background image

printf(".");
if(!decode){
if(realbufsize<PHP_CACHESIZE){
for(i=realbufsize;i<PHP_CACHESIZE;i++){
((char *)block_buffer)[i]=' ';
}
}
mcrypt_ecb (td, block_buffer, PHP_CACHESIZE);
} else {
mdecrypt_ecb (td, block_buffer, realbufsize);
}
memcpy(file_buffer+j*PHP_CACHESIZE,block_buffer,PHP_CACHESIZE);
j++;
}
close(readfd);
if((ifp=fopen(filename,"wb"))==NULL){
printf("FATAL: file access error.n");
exit(3);
}
fwrite ( file_buffer, inputfilesize, 1, ifp);
free(block_buffer);
free(file_buffer);
free(filestat);
fclose(ifp);
printf("n");
return 0;
}
/*--- end of ecb.c ------------------------------------*/
因为 ECB

 

模式是块长度确定的块加密,这里填充了一 些空字符。

然后,修改 php

 

代码中 Zend/zend-scanner.c 如下:

(我的 php 版本是 4.01pl2, SUNsparc/solaris 2.7, gcc 2.95;)
文件前加入:
#define MCRYPT_BACKWARDS_COMPATIBLE 1
#include <mcrypt.h>
然后,注释掉大约 3510 行前后的 YY_INPUT 的定义。

 

然后, 修改大约 5150 行前后的 yy_get_next_buffer()函数:
函数头加上定义:
void *tempbuf;
char *key;
char debugstr[255];
int td,keysize;
int x,y;
FILE *fp;

 

然后 ,注释掉