Location: PHPKode > projects > Ptk-forensics > ptk/lib/get_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");

$offset = sanitize($_GET['arg1'],INT);
$inode = sanitize($_GET['arg2'],PARANOID);
$type = preg_replace("/[^a-z]/", "",$_GET['arg3']);
if(isset($_GET['arg4'])){
	$path = get_image_path_from_partition(sanitize($_GET['arg4'],INT));
	$test = user_can_load_this_partition(sanitize($_GET['arg4'],INT));
}else{
	$path = sanitize($_SESSION['image_path'],PARANOID);
	$test = user_can_load_this_image($_SESSION['image_id']);
}

if (test == true){
	if($type=='ascii'){
		$output = get_file_content_ascii($path, $offset, $inode);
	}
	elseif($type=='hex'){
		$output = get_file_content_hex($path, $offset, $inode);	
	}	
	elseif($type=='asciistrings'){
		$output = get_file_content_asciistrings($path, $offset, $inode);		
	}

	$output = preg_replace("/\\\n/", "<br>", $output);	
	if($output=='') $output = "File recovery not possible";

	echo $output;
}else{
	new AuditLog('Unauthorized access to get_file_content');
	header("location: goto_home.php");
}
?>
Return current item: Ptk-forensics