<?
/*
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("loggerClass.php");
if (isset($_SESSION['data_token']) && strcmp($_SESSION['data_token'],$_GET['tk']) == 0 ){
$offset = sanitize($_GET['arg1'],INT);
$sector = sanitize($_GET['arg2'],PARANOID);
$total = sanitize($_GET['arg3'],PARANOID);
$type = sanitize($_GET['arg4'],PARANOID);
if($type=='ascii'){
$output = get_sector_content_ascii($_SESSION['image_path'], $offset, $sector, $total);
}
elseif($type=='hex'){
$output = get_sector_content_hex($_SESSION['image_path'], $offset, $sector, $total);
}
elseif($type=='asciistrings'){
$output = get_sector_content_asciistrings($_SESSION['image_path'], $offset, $sector, $total);
}
$output = preg_replace("/\\\n/", "<br>", $output);
echo RemoveXSS($output);
}else{
new AuditLog('Unauthorized access to get_sector_content');
header("location: goto_home.php");
}?>