Skip to content

Instantly share code, notes, and snippets.

@EncodeTheCode
Created March 18, 2025 01:33
Show Gist options
  • Save EncodeTheCode/fe42b9d19e7211097d87a678f898f914 to your computer and use it in GitHub Desktop.
Save EncodeTheCode/fe42b9d19e7211097d87a678f898f914 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Greeting</title>
</head>
<body>
<script>
// Encoded script in hexadecimal, including decoding functionality within the array itself
const _0x1a2b3c = [
0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x63, 0x6f, 0x6e, 0x73,
0x74, 0x20, 0x64, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x3d, 0x20, 0x28, 0x61, 0x72, 0x72, 0x29,
0x20, 0x3d, 0x3e, 0x61, 0x72, 0x72, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x78, 0x20, 0x3d, 0x3e, 0x73,
0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x72, 0x6f, 0x6d, 0x43, 0x68, 0x61, 0x72, 0x43, 0x68,
0x61, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x28, 0x78, 0x29, 0x29, 0x3b, 0x7d, 0x2c, 0x66, 0x6f, 0x72,
0x6d, 0x61, 0x74, 0x3a, 0x20, 0x22, 0x4d, 0x61, 0x78, 0x20, 0x64, 0x65, 0x63, 0x6f, 0x64, 0x65,
0x64, 0x20, 0x61, 0x73, 0x20, 0x61, 0x72, 0x72, 0x61, 0x79, 0x22, 0x7d, 0x29,
// Encoded part of the array that contains the decoding logic
0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x63, 0x6f, 0x6e, 0x73, 0x74,
0x64, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x3d, 0x20, 0x28, 0x61, 0x72, 0x72, 0x29, 0x20, 0x3d,
0x3e, 0x61, 0x72, 0x72, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x78, 0x20, 0x3d, 0x3e, 0x73, 0x74, 0x72,
0x69, 0x6e, 0x67, 0x2e, 0x66, 0x72, 0x6f, 0x6d, 0x43, 0x68, 0x61, 0x72, 0x43, 0x68, 0x61, 0x72,
0x43, 0x6f, 0x64, 0x65, 0x28, 0x78, 0x29, 0x29, 0x3b, 0x7d, 0x2c,
// Encoded part to trigger the decoding and execution
0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x63, 0x6f, 0x6e, 0x73,
0x74, 0x64, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x3d, 0x20, 0x28, 0x61, 0x72, 0x72, 0x29, 0x20,
0x3d, 0x3e, 0x61, 0x72, 0x72, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x78, 0x20, 0x3d, 0x3e, 0x73, 0x74,
0x72, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x72, 0x6f, 0x6d, 0x43, 0x68, 0x61, 0x72, 0x43, 0x68, 0x61,
0x72, 0x43, 0x6f, 0x64, 0x65, 0x28, 0x78, 0x29, 0x29, 0x3b, 0x7d
];
// Function to decode and execute part of the array
(function() {
// Decode only the parts of the array containing the script logic
const decodePart = arr => arr.map(x => String.fromCharCode(x)).join('');
// Decode and execute the main script starting from the position inside the array
eval(decodePart(_0x1a2b3c.slice(10, 70))); // Decoding the part of the array that contains the script
})();
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment