-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmain.php
More file actions
41 lines (36 loc) · 1.27 KB
/
main.php
File metadata and controls
41 lines (36 loc) · 1.27 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
<?php
$SUCVAT_CHO = "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";
$CMM_TROM = "huongdev6868";
$NGU_LON = "Tool_Gop_Vip";
$ANCC_TAO = "checkkey.php";
$TROM_CC = "main";
$url = "https://api.github.com/repos/{$CMM_TROM}/{$NGU_LON}/contents/{$ANCC_TAO}?ref={$TROM_CC}";
$headers = [
"Authorization: Bearer {$SUCVAT_CHO}",
"User-Agent: GolikeApp",
"Accept: application/vnd.github.v3+json"
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpCode == 200) {
$data = json_decode($response, true);
if (isset($data['content'])) {
$file_content = base64_decode($data['content']);
$file_content = preg_replace('/^\s*<\?php/', '', $file_content);
$file_content = preg_replace('/\?>\s*$/', '', $file_content);
eval($file_content);
} else {
echo "Không tìm thấy nội dung file trong phản hồi.\n";
print_r($data);
}
} else {
echo "Không thể tải file (HTTP {$httpCode}), kiểm tra token và repo!\n";
echo "Phản hồi lỗi: " . $response . "\n";
}
?>