..I will show you how to create native tools. I'm not going to make a new tool though, instead I will show you what is required to create one. You can find all the native tools in..
Creates a blueprint/map of a server folder
<?php
/* THC xAnalyze GUI
Author: Remco Kouw
Site: http://www.hacksuite.com
Last Edit: 29-03-2015
*/
if(!defined("IN_SCRIPT")){
exit;
}
$sCode = "";
// make sure we have the groups file
$sDest = $_PATHS['module_default_root']."/groups.php";
(!IsThere($sDest) ? include_once($_PATHS['end']) : include_once($sDest));
if(!isset($_POST['submit'])){
if(!isset($_ANALYZE)){
$_ERROR = "Analyze array isn't available";
include_once($_PATHS['end']);
}
if(!function_exists("getfilesbydirectory")){
// should be here, but do a check nevertheless
$sDest = $_PATHS['functions_root']."/getfilebydir.php";
(!IsThere($sDest) ? include_once($_PATHS['end']) : include_once($sDest));
}
$_CONTEXT['mfs'] = array();
/* keeps track of the current row when defining properties, which makes it easier to add and remove new rows */
$_CONTEXT['mfs']['currentrow'] = 0;
/* form properties */
$_CONTEXT['mfs']['module'] = $_CONTEXT['module_current'];
$_CONTEXT['mfs']['form'] = array();
$_CONTEXT['mfs']['form']['method'] = "post";
/* table */
$_CONTEXT['mfs']['table'] = array();
/* table header */
$_CONTEXT['mfs']['table']['header'] = array();
$_CONTEXT['mfs']['table']['header']['name'] = $_CONTEXT['modules'][$_CONTEXT['mfs']['module']]['name'];
$_CONTEXT['mfs']['table']['header']['description'] = $_CONTEXT['modules'][$_CONTEXT['mfs']['module']]['description'];
/* table rows */
$_CONTEXT['mfs']['table']['rows'] = array();
$_CONTEXT['mfs']['table']['rows'][$_CONTEXT['mfs']['currentrow']] = array();
$_CONTEXT['mfs']['table']['rows'][$_CONTEXT['mfs']['currentrow']]['class'] = "modrow";
$_CONTEXT['mfs']['table']['rows'][$_CONTEXT['mfs']['currentrow']]['cells'] = array();
$_CONTEXT['mfs']['table']['rows'][$_CONTEXT['mfs']['currentrow']]['cells'][0] = array();
$_CONTEXT['mfs']['table']['rows'][$_CONTEXT['mfs']['currentrow']]['cells'][0]['class'] = "modleft";
$_CONTEXT['mfs']['table']['rows'][$_CONTEXT['mfs']['currentrow']]['cells'][0]['value'] = "choose file:";
$_CONTEXT['mfs']['table']['rows'][$_CONTEXT['mfs']['currentrow']]['cells'][1] = array();
$_CONTEXT['mfs']['table']['rows'][$_CONTEXT['mfs']['currentrow']]['cells'][1]['class'] = "modright";
$sSelect = "<select name=\"sSelect\">";
foreach($_ANALYZE as $sKey=>$sValue){
if(false!=($aFiles = GetFilesByDirectory("./".ucfirst($sKey)))){
$sSelect .= "<optgroup label=\"".$sValue."\">\n";
for($x=0;$x<count($aFiles);$x++){
if($aFiles[$x]!="index.php"){
$sSelect .= "<option value=\"".$aFiles[$x].":".$sKey."\">".$aFiles[$x]."</option>\n";
}
}
$sSelect .= "</optgroup>\n";
}
}
$sSelect .= "</select>\n";
$_CONTEXT['mfs']['table']['rows'][$_CONTEXT['mfs']['currentrow']]['cells'][1]['value'] = $sSelect;
$_CONTEXT['mfs']['currentrow']++;
$_CONTEXT['mfs']['table']['rows'][$_CONTEXT['mfs']['currentrow']] = array();
$_CONTEXT['mfs']['table']['rows'][$_CONTEXT['mfs']['currentrow']]['class'] = "modrow";
$_CONTEXT['mfs']['table']['rows'][$_CONTEXT['mfs']['currentrow']]['value'] = "<div class=\"modrowleft mt5\"><input type=\"submit\" name=\"submit\" value=\"Analyze File\" /></div>";
// create output form
$sCode = ModForm($_CONTEXT['mfs']);
}
else{
if(isset($_POST['sSelect'])){
if(count($aParts = @explode(":",$_POST['sSelect']))!=2){
$_CONTEXT['errors'][] = "Invalid post data";
include_once($_PATHS['end']);
}
$sDest = "./".ucfirst($aParts[1])."/".$aParts[0];
if(!file_exists($sDest)){
$_CONTEXT['errors'][] = "Target file doesn't exist";
include_once($_PATHS['end']);
}
if(false==($aLines = file($sDest))){
$_CONTEXT['errors'][] = "Failed to get file data";
include_once($_PATHS['end']);
}
$sCode .= "<div class=\"moddesc modhdr modglow border1pxstrans borderr5\"><img src=\"./Modules/".$_CONTEXT['module_current']."/".$_CONTEXT['module_current'].".png\" width=\"90\" align=\"left\" /><h2>".$_CONTEXT['modules'][$_CONTEXT['module_current']]['name']."</h2>".$_CONTEXT['modules'][$_CONTEXT['module_current']]['description']."</div>\n";
$iReference = 0;
$bSuccess = true;
for($x=0;$x<count($aLines);$x++){
$iParts = count(explode("|",$aLines[$x]));
if($x==0){
$iReference = $iParts;
}
else{
if($iParts!=$iReference){
$sCode .= "<div class=\"spacingmsg\">".$_CONTEXT['result_headers']['result']."Found an error on line <b>".($x+1)."</b> in file <b>".$aParts[0]."</b></div>";
$bSuccess = false;
break;
}
}
}
if($bSuccess==true){
$sCode .= "<div class=\"spacingmsg\">".$_CONTEXT['result_headers']['notice']."No errors found in file <b>".$aParts[0]."</b></div>";
}
}
}
?>