Location: PHPKode > projects > Ptk-forensics > ptk/lib/analysis_keyword.php
<?
/*
PTK  - DFLabs
Copyright (C) 2008 - DFLabs srl - All rights reserved
hide@address.com
*/
include("header.php");
include("check_session_image.php");

$inv_token = md5(uniqid(rand(), TRUE));
$_SESSION['key_token'] = $inv_token;

?>
<link rel="stylesheet" type="text/css" href="../css/file_table.css"/>
<link rel="stylesheet" type="text/css" href="../css/keyword_table.css"/>

<div id="container_left" style="padding: 0px; width: 230px;">
	<div id="tab_view_left" style="margin-top:-10px">
		<?if($_SESSION["partition0_filesystem"]!='ram_dump'){?>
		<div class="dhtmlgoodies_aTab">
			String:<br>
			<input type="text" name="string" id="string" style="width:200px; font-size:9pt"><br><br>
			<input type="checkbox" name="regexp" id="regexp" onclick="switchAppearDiv('templates')"> Regular expression<br><br>
			<button onclick="var str=document.getElementById('string').value; if(str.length>30){var title = str.substr(0,30)+'...'}else{var title=str;}; var regexp=document.getElementById('regexp').checked; if(str!=''){createNewTab('tab_view_right',urlencode(title),'','get_search.php?tk=<?=$inv_token?>&string='+str+'&regexp='+regexp,true)}else{alert('Please, type a string to search for.');}">  Search  </button>
			<table class="regex" style="display:none" id="templates">
				<th>Regex templates</th>
				<?
				$fp =fopen($INSTALLDIR."/regex.txt", "r");
				while(!feof($fp)){
					$line = fgets($fp);
					if(preg_match("/(.+)\:\s(.+)/", $line, $out)){
						$out[2] = preg_replace("/\\\/", "\\\\\\", $out[2]);
						echo "<tr onclick=\"set_regex('".$out[2]."', 'string')\"><td>".$out[1]."</td></tr>";
					}
				}
				fclose($fp);
				?>
			</table>
		</div>
		<div class="dhtmlgoodies_aTab">
			 String:<br>
                        <input type="text" name="string_live" id="string_live" style="width:200px; font-size:9pt"><br><br>
			<input checked type="checkbox" name="ascii_string" id="ascii_string">ASCII String<br>
			<input type="checkbox" name="unicode_string" id="unicode_string">Unicode string<br>
			<input type="checkbox" name="regexp_string" id="regexp_string" onclick="switchAppearDiv('templates_live_s')">Regular expression<br>
			<input type="checkbox" name="case_sensitive" id="case_sensitive_op">Case sensitive<br><br>
			<input type="hidden" name="token" id="token" value="<?=$inv_token?>"/>
                        <button onclick="startLiveSearch()">  Search  </button>
			<table class="regex" style="display:none" id="templates_live_s">
                        	<th>Regex templates</th>
                                <?
                                $fp =fopen($INSTALLDIR."/regex.txt", "r");
                                while(!feof($fp)){
                                        $line = fgets($fp);
                                        if(preg_match("/(.+)\:\s(.+)/", $line, $out)){
                                                $out[2] = preg_replace("/\\\/", "\\\\\\", $out[2]);
						echo "<tr onclick=\"set_regex('".$out[2]."', 'string_live')\"><td>".$out[1]."</td></tr>";
}
                                }
                                fclose($fp);
                                ?>
                        </table>
		</div>
		<?}else{?>
		<div class="dhtmlgoodies_aTab">
			String:<br>
			<input type="text" name="string_live" id="string_live" style="width:200px; font-size:9pt"><br><br>
			<input type="checkbox" name="ascii" id="ascii" checked>Ascii
			<input type="checkbox" name="unicode" id="unicode">Unicode<br><br>			
			<input type="checkbox" name="regexp" id="regexp" onclick="switchAppearDiv('templates_live')"> Regular expression<br><br>
 			<input type="hidden" name="token" id="token" value="<?=$inv_token?>"/>
			<button onclick="startRamSearch()">  Search  </button>
			<table class="regex" style="display:none" id="templates_live">
				<th>Regex templates</th>
				<?
				$fp =fopen($INSTALLDIR."/regex.txt", "r");
				while(!feof($fp)){
					$line = fgets($fp);
					if(preg_match("/(.+)\:\s(.+)/", $line, $out)){
						$out[2] = preg_replace("/\\\/", "\\\\\\", $out[2]);
						echo "<tr onclick=\"set_regex('".$out[2]."', 'string_live')\"><td>".$out[1]."</td></tr>";
					}
				}
				fclose($fp);
				?>
			</table>		
		</div>		
		<?}?>
	</div>	
</div>

<div id="analysis_left_handle" onclick="switchScrollH('container_left')"></div>

<div id="container_right" style="overflow:auto">
	<div id="tab_view_right" style="margin-top:-10px">
		<div class="dhtmlgoodies_aTab">			
		</div>		
	</div>
</div>

<script type="text/javascript">
<?if($_SESSION["partition0_filesystem"]=='ram_dump'){?>
initTabs('tab_view_left',Array('Live search'),0,"100%","",Array(false));
<?}else{?>
initTabs('tab_view_left',Array('Indexed search','Live search'),0,"100%","",Array(false,false));
<?}?>
initTabs('tab_view_right',Array('Tab'),0,"100%","",Array(false));
deleteTab('Tab');
</script>
<?include("footer.php");?>
Return current item: Ptk-forensics