This repository was archived by the owner on Apr 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhex.php
More file actions
executable file
·56 lines (45 loc) · 1.56 KB
/
Copy pathhex.php
File metadata and controls
executable file
·56 lines (45 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
/**
*
* @package stckr framework (based on phpBB)
* @version $Id: hex.php
* @copyright (c) 2018 Kenny Cameron
* Developed using the phpBB template engine
*
*/
// Include all the relevant files we need
$root_path = (defined('ROOT_PATH')) ? ROOT_PATH : './';
require_once($root_path . 'inc/start.php');
$Convrtr = new Convrtr();
$template = new Template(); // Needs to be done on every page we are setting up
$template->set_custom_template($root_path . 'theme/html', 'default'); // This is important as it states where the template files are located
include_once($root_path . 'inc/language.php');
$page = "{$root_path}hex.php";
$mode = (isset($_GET['m'])) ? (string) $_GET['m'] : '';
$encode = (isset($_POST['encode'])) ? true : false;
$hexpattern = $hex_pattern = '';
$section = 'Hex';
if($encode) { include($root_path . 'inc/decoders/hexpattern.php'); }
foreach ($_SESSION as $key => $value) {
$_SESSION[$key] = stripslashes($value);
}
// Serve up downloads
if (isset($_GET['hex_download'])) {
header("Content-type: text/plain");
header("Content-Disposition: attachment; filename=HexPattern");
header("Content-Description: Convrts Data");
echo $_SESSION['hexpattern'];
exit;
}
page_header($section);
$template->assign_vars(array(
'ROOT_PATH' => $root_path,
'ORIG_HEX' => (isset($_REQUEST['hexpattern'])) ? stripslashes($_REQUEST['hexpattern']) : '',
'POST_HEX' => stripslashes($hex_pattern),
));
// Set up the html file for the page
$template->set_filenames(array(
'body' => 'hex_body.html',
));
// Assign the html file to the display
$template->display('body');