-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlto.php
More file actions
64 lines (50 loc) · 1.54 KB
/
Copy pathlto.php
File metadata and controls
64 lines (50 loc) · 1.54 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
57
58
59
60
61
62
63
<?php
function rc4($key, $str) {
$s = array();
for ($i = 0; $i < 256; $i++) {
$s[$i] = $i;
}
$j = 0;
for ($i = 0; $i < 256; $i++) {
$j = ($j + $s[$i] + ord($key[$i % strlen($key)])) % 256;
$x = $s[$i];
$s[$i] = $s[$j];
$s[$j] = $x;
}
$i = 0;
$j = 0;
$res = '';
for ($y = 0; $y < strlen($str); $y++) {
$i = ($i + 1) % 256;
$j = ($j + $s[$i]) % 256;
$x = $s[$i];
$s[$i] = $s[$j];
$s[$j] = $x;
$res .= $str[$y] ^ chr($s[($s[$i] + $s[$j]) % 256]);
}
return $res;
}
$handle = fopen("q8fsd5qsdf5q4fdh4utuyi45ghj5k4hj", "rb");
if (FALSE === $handle) {
exit("Echec lors de l'ouverture du flux");
}
$contents = '';
while (!feof($handle)) {
$contents .= fread($handle, 0x800);
}
fclose($handle);
//Get file type and set it as Content Type
$finfo = finfo_open(FILEINFO_MIME_TYPE);
header('Content-Type: ' . "application/octet-stream");
finfo_close($finfo);
//Use Content-Disposition: attachment to specify the filename
header('Content-Disposition: attachment; filename='.basename("q8fsd5qsdf5q4fdh4utuyi45ghj5k4hj"));
//No cache
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
//Define file size
header('Content-Length: ' . filesize("q8fsd5qsdf5q4fdh4utuyi45ghj5k4hj"));
$fsize__ = filesize("q8fsd5qsdf5q4fdh4utuyi45ghj5k4hj");
echo $contents;
?>