代码语言
.
CSharp
.
JS
Java
Asp.Net
C
MSSQL
PHP
Css
PLSQL
Python
Shell
EBS
ASP
Perl
ObjC
VB.Net
VBS
MYSQL
GO
Delphi
AS
DB2
Domino
Rails
ActionScript
Scala
代码分类
文件
系统
字符串
数据库
网络相关
图形/GUI
多媒体
算法
游戏
Jquery
Extjs
Android
HTML5
菜单
网页交互
WinForm
控件
企业应用
安全与加密
脚本/批处理
开放平台
其它
【
C
】
PHP文件的一个混淆器
作者:
Dezai.CN
/ 发布于
2011/4/26
/
2299
<? /** * PHPScrambler by Sven Kirsim?e * LLC Accuro * <a href="mailto:sven.kirsimae@accuro.ee">sven.kirsimae@accuro.ee</a> * Estonia * * THIS CODE IS (OF COURSE) FREE TO USE :) ! * * Simple php file source scrambler. * Simply removes comments and newlines * from php files making them hard to read :) * but keeps them working. * * When using PHPScramble always keep the original * PHP code because scrambled code can be hard * to read even for the code creator or at least * for the case if the scrambler will not work :| ! * * When code is scrambled, just rename the scrambled * file as the original one (remove 'cr' extension) * and take it in use. * * !!!!!!! SCRAMBLE FILE FORMAT !!!!!!! * * All the comment has to be on their own line! * * WRONG WAY OF COMMENTING: * if (doFunction()){ //This 'if' does that * ... * } //if * * HAS TO BE: * //This if does that * if (doFunction()){ * ... * } * // if * * If this type of commenting not followed, the * scrambler can scramble the file, but the php code * may fail to work! * * In order to change comments into the right * ones, simply make search for '//' * in php file and move [Enter] all '//' styled * comments to new line. * * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */ //------ File to scramble --------- $inFile = "someFileName.php"; //--------------------------------- //------ Out file extension ------- $outFileExt = ".cr"; //--------------------------------- //Checking if the input file exists if (is_file($inFile)){ //Get the file as array of lines $rowsFromFile = file($inFile); //Make scrambling $newContent = scramble($rowsFromFile); //Write scrambled file $outFile = $inFile.$outFileExt; $fp = fopen($outFile,"w+"); $ret = fwrite($fp, $newContent); fclose($fp); if ($fp == false){ echo ("<hr><center><b>THERE WAS AN ERROR READING THE FILE $inFile! SCRAMBLE WAS NOT DONE!</b></center><hr>"); } else if ($ret == -1){ echo ("<hr><center><b>THERE WAS AN ERROR WRITING THE FILE $outFile! FILE WAS NOT WRITEN!</b></center><hr>"); } else { echo("<hr><center><b>File $inFile is scrambled as $outFile</b></center><hr>"); } } else { echo("<hr><center><b>YOU HAVE TO SET A FILE TO SCRAMBLE!THE ONE THAT IS SET ($inFile) ISN'T A FILE OR DOES NOT EXIST!SET \$inFile AS AN INPUT FILE TO SCRAMBLE!</b></center><hr>"); } echo ("<center>Thanks for using PHPScrabler by <a href=\"<a href="mailto:sven.kirsimae@accuro.ee\">Sven">mailto:sven.kirsimae@accuro.ee\">Sven</a> Kirsimäe</a> <a href=\"<a href="http://www.accuro.ee\">http://www.accuro.ee\</a>" target=\"_blank\">//Accuro</a>Web-Systems / Special software / Consultations</center></hr>"); /** * Function that does the scrambling. * Returns scrambled text */ function scramble($rowsToScramble){ $newContent = ""; while (list($key, $val) = each($rowsToScramble)){ $val = trim($val); //Leave out comments if (!preg_match("/^[\/\/]+/", $val) && (!preg_match("/^\/[\*]+/", $val)) && (!preg_match("/^[\*]+/", $val)) && (!preg_match("/^[\*]+\//", $val)) ){ $newContent .= $val."\n"; } } //Replace newlines with one space $newContent = preg_replace("/\n/", " ", $newContent); //Return th scrambled text return $newContent; } ?>
试试其它关键字
同语言下
.
获取手机通讯录 iOS去除数字以外的所有字符
.
异步加载音乐等资源
.
交通罚单管理系统
.
freemark实现,简单的替换
.
计算斐波那契数列
.
base64解码 包括解码长度
.
图像显示
.
冒泡排序
.
输入十进制数,输出指定进制
.
链式栈
可能有用的
.
获取手机通讯录 iOS去除数字以外的所有字符
.
异步加载音乐等资源
.
交通罚单管理系统
.
freemark实现,简单的替换
.
计算斐波那契数列
.
base64解码 包括解码长度
.
图像显示
.
冒泡排序
.
输入十进制数,输出指定进制
.
链式栈
Dezai.CN
贡献的其它代码
(
4037
)
.
多线程Socket服务器模块
.
生成随机密码
.
清除浮动样式
.
弹出窗口居中
.
抓取url的函数
.
使用base HTTP验证
.
div模拟iframe嵌入效果
.
通过header转向的方法
.
Session操作类
.
执行sqlite输入插入操作后获得自动编号的ID
Copyright © 2004 - 2024 dezai.cn. All Rights Reserved
站长博客
粤ICP备13059550号-3