Location: PHPKode > projects > Ptk-forensics > ptk/lib/file_content.php
<?
/*
PTK  - DFLabs
Copyright (C) 2008 - DFLabs srl - All rights reserved
hide@address.com
*/
include("check_session.php");
include("check_session_image.php");
include("lib_commands.php");
include("lib_std.php");
include("loggerClass.php");
if (!isset($_SESSION['folder_token']) or strcmp($_SESSION['folder_token'],$_GET['tk'])!=0){
  new AuditLog('Unauthorized access to file_content '.sanitize(RemoveXSS($_GET['arg3']),PARANOID));
  header("location: goto_home.php");
}else{
$offset = sanitize($_GET['arg1'],INT);
$inode = sanitize($_GET['arg2'],PARANOID);
$name = $_GET['arg3'];
$name = sanitize($name,PARANOID);
$name = preg_replace("/\//", "", $name);
$partition_id = sanitize($_GET['arg4'],INT);
$page_offset = 100;
unset($_SESSION['is_graphic']);
$type = get_file_type($_SESSION['image_path'], $offset, $inode);
$nm = preg_replace("/\s/", "_", $name);
$is_bookmark = check_bookmark($_SESSION['user'], $_SESSION['case_id'], $partition_id, $inode, 0, '');
$name = urlencode($name);
$n = urlencode(htmlentities($_GET['arg3']));
?>

<div style="float:left">
	<button onclick="hideDiv('picture<?=$inode;?>'); showDiv('pagination<?=$inode;?>'); showDiv('<?=$inode;?>'); document.getElementById('curr_page').innerHTML=1; document.getElementById('total_page').innerHTML=1; document.getElementById('analysis_type').value='ascii'; ajax_request_file_content('get_file_content.php?arg1=<?=$offset;?>&arg2=<?=$inode;?>&arg3=ascii', '<?=$inode;?>', 'false', 0); ">Ascii</button>
	<button onclick="hideDiv('picture<?=$inode;?>'); showDiv('pagination<?=$inode;?>'); showDiv('<?=$inode;?>'); document.getElementById('curr_page').innerHTML=1; document.getElementById('total_page').innerHTML=1; document.getElementById('analysis_type').value='hex';ajax_request_file_content('get_file_content.php?arg1=<?=$offset;?>&arg2=<?=$inode;?>&arg3=hex', '<?=$inode;?>', 'false', 0); ">Hex</button>
	<button onclick="hideDiv('picture<?=$inode;?>'); showDiv('pagination<?=$inode;?>'); showDiv('<?=$inode;?>'); document.getElementById('curr_page').innerHTML=1; document.getElementById('total_page').innerHTML=1; document.getElementById('analysis_type').value='asciistrings';ajax_request_file_content('get_file_content.php?arg1=<?=$offset;?>&arg2=<?=$inode;?>&arg3=asciistrings', '<?=$inode;?>', 'false', 0); ">Ascii strings</button>
	<?if($_SESSION['is_graphic']){?>
	<button onclick="hideDiv('<?=$inode;?>'); hideDiv('pagination<?=$inode;?>'); showDiv('picture<?=$inode;?>');">Preview</button>
	<?}?>
	<button onclick="window.location = 'export_file.php?arg1=<?=$offset;?>&arg2=<?=$inode;?>&arg3=<?=$n;?>';">Export</button>
	<?if($is_bookmark==0){?>
	<button onclick="displayMessage('modal_bookmark.php?arg1=0&arg2=<?=$inode;?>&arg3=<?=$partition_id;?>&arg4=<?=$name;?>', '340', '250');return false">Bookmark</button>
	<?}?>
</div>

<input type="hidden" id="analysis_type" value="ascii">
<?if($_SESSION['is_graphic']){?>
	<div id="pagination<?=$inode;?>" style="float:left; margin-left: 20px; text-align:center;display:none">
<?}else{?>
	<div id="pagination<?=$inode;?>" style="float:left; margin-left: 20px; text-align:center;">
<?}?>
	<img src="../img/left.png" style="cursor:pointer" onclick="contentBack('<?=$offset?>', '<?=$inode?>', 'false')">
	<b id="curr_page">0</b>/<b id="total_page">0</b>
	<img src="../img/arrow.png" style="cursor:pointer" onclick="contentForward('<?=$offset?>', '<?=$inode?>', 'false')">
	&nbsp;
	<tag style="font-size:8pt">Go to page: </tag><input type="text" id="goto_page" style="width: 50px; height: 20px; margin-top: 5px" onchange="gotoPage(this.value, '<?=$offset?>', '<?=$inode?>', 'false')">
	&nbsp;
	<tag style="font-size:8pt">Page size: </tag><input type="text" id="page_size" value="<?=$page_offset?>" style="width: 50px; height: 20px; margin-top: 5px" onchange=""><tag style="font-size:8pt"> Unit</tag>
	&nbsp;<input type="checkbox" id="show_all" onclick="switchPageSize()"><tag style="font-size:8pt"> Show all</tag>	
</div>


<img src='../img/progress.gif'  style="float: right; display: none;z-index: 10000000;margin-right: 10px" id="progress<?=$inode;?>">
<div style="margin-top: 30px;font-size:8pt" id="file_type_<?=$inode;?>"><?=$type;?></div>

<?if($_SESSION['is_graphic']){?>
	<a id="picture<?=$inode;?>" href="picture.php?offset=<?=$offset;?>&inode=<?=$inode;?>&name=<?=$name;?>" class="menu" target="blank"><img class="analysis" src="picture.php?offset=<?=$offset;?>&inode=<?=$inode;?>&name=<?=$name;?>"></a>
	<div id="<?=$inode;?>" class="file_content" style="display:none;float:left;height:80%"></div>
	<?
	unset($_SESSION['is_graphic']);
}else{?>
	<img id="picture<?=$inode;?>" style="display:none">
	<div id="<?=$inode;?>" class="file_content" style="float:left;height:80%"><?=$content;?></div>
<?}?>
<?}?>
Return current item: Ptk-forensics