Thunder-Menu

Thunder-Menu_Raw.html

Aug 21st, 2023
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.52 KB | Source Code | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Thunder-Menu</title>
  5. </head>
  6. <body>
  7. <a href="https://Thunder-Menu.com" style="font-size: 24px; font-weight: bold; color: blue;">Thunder Menu</a>
  8. <br>
  9. <img id="encodedImage" src="" alt="Image encodée en base64">
  10. <br>
  11. <textarea id="outputTextboxBinary" rows="10" cols="40" readonly></textarea><br>
  12. <textarea id="outputTextboxHex" rows="10" cols="40" readonly></textarea><br>
  13. <textarea id="outputTextboxASCII" rows="10" cols="40" readonly></textarea><br>
  14. <textarea id="outputTextboxPrefix" rows="1" cols="40" readonly></textarea><br>
  15.  
  16. <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.5/jszip.min.js"></script>
  17. <script>
  18. const githubRawURL = "https://raw.githubusercontent.com/3xploitch3ats/Thunder-Menu/v2/ThunderMenuImage.base64.txt";
  19. const encodedImage = document.getElementById("encodedImage");
  20.  
  21. fetch(githubRawURL)
  22. .then(response => response.text())
  23. .then(base64Data => {
  24. encodedImage.src = "data:image/png;base64," + base64Data;
  25. })
  26. .catch(error => console.error("An error occurred:", error));
  27.  
  28. const outputTextboxBinary = document.getElementById("outputTextboxBinary");
  29. const outputTextboxHex = document.getElementById("outputTextboxHex");
  30. const outputTextboxASCII = document.getElementById("outputTextboxASCII");
  31. const outputTextboxPrefix = document.getElementById("outputTextboxPrefix");
  32.  
  33. encodedImage.onload = () => {
  34. const decodeCanvas = document.createElement("canvas");
  35. const decodePictureBox = decodeCanvas.getContext("2d");
  36. decodeCanvas.width = encodedImage.width;
  37. decodeCanvas.height = encodedImage.height;
  38. decodePictureBox.drawImage(encodedImage, 0, 0);
  39. const imageData = decodePictureBox.getImageData(0, 0, decodeCanvas.width, decodeCanvas.height);
  40. const binaryData = generateBinaryPattern(imageData);
  41. outputTextboxBinary.value = binaryData;
  42. outputTextboxHex.value = binaryToHex(binaryData);
  43. outputTextboxASCII.value = binaryToASCII(binaryData);
  44. const asciiText = binaryToASCII(binaryData);
  45. const cleanedText = cleanText(asciiText);
  46. const wordBeforePoint = extractWordBeforePoint(cleanedText);
  47. outputTextboxPrefix.value = wordBeforePoint;
  48.  
  49. const innerFileName = outputTextboxPrefix.value;
  50. generateAndSaveZip(innerFileName, binaryData);
  51. };
  52.  
  53. function binaryToHex(binaryText) {
  54. let hexText = "";
  55. for (let i = 0; i < binaryText.length; i += 8) {
  56. const byte = binaryText.substring(i, i + 8);
  57. const decimalValue = parseInt(byte, 2);
  58. const hexValue = decimalValue.toString(16).padStart(2, "0");
  59. hexText += hexValue.toUpperCase();
  60. }
  61. return hexText;
  62. }
  63.  
  64. function binaryToASCII(binaryText) {
  65. let asciiText = "";
  66. for (let i = 0; i < binaryText.length; i += 8) {
  67. const byte = binaryText.substring(i, i + 8);
  68. const decimalValue = parseInt(byte, 2);
  69. const asciiChar = String.fromCharCode(decimalValue);
  70. asciiText += asciiChar;
  71. }
  72. return asciiText;
  73. }
  74.  
  75. function cleanText(text) {
  76. // Nettoyer le texte de tout ce qui n'est pas une lettre, un chiffre ou un point
  77. const cleanedText = text.replace(/[^a-zA-Z0-9.]/g, ' ');
  78. return cleanedText;
  79. }
  80.  
  81. function extractWordBeforePoint(asciiText) {
  82. const match = asciiText.match(/[a-zA-Z0-9]+(?=\s*\.)/);
  83. if (match) {
  84. return match[0];
  85. }
  86. return "";
  87. }
  88.  
  89. function generateAndSaveZip(innerFileName, binaryData) {
  90. const byteCount = Math.ceil(binaryData.length / 8);
  91. const bytes = new Uint8Array(byteCount);
  92.  
  93. for (let i = 0; i < byteCount; i++) {
  94. const byteStart = i * 8;
  95. const byteEnd = byteStart + 8;
  96. const byte = binaryData.slice(byteStart, byteEnd);
  97. bytes[i] = parseInt(byte, 2);
  98. }
  99.  
  100. const blob = new Blob([bytes], { type: "application/zip" });
  101.  
  102. const a = document.createElement("a");
  103. a.href = URL.createObjectURL(blob);
  104. a.download = innerFileName + ".zip"; // Utilisez le même nom à l'intérieur du fichier comme nom de fichier ZIP
  105. document.body.appendChild(a);
  106. a.click();
  107. document.body.removeChild(a);
  108. URL.revokeObjectURL(a.href);
  109. }
  110.  
  111. function generateBinaryPattern(imageData) {
  112. const threshold = 128;
  113. let binaryText = "";
  114.  
  115. for (let y = 0; y < imageData.height; y++) {
  116. for (let x = 0; x < imageData.width; x++) {
  117. const index = (y * imageData.width + x) * 4;
  118. const r = imageData.data[index];
  119. const g = imageData.data[index + 1];
  120. const b = imageData.data[index + 2];
  121. const luminance = (0.299 * r + 0.587 * g + 0.114 * b);
  122. binaryText += (luminance < threshold) ? "1" : "0";
  123. }
  124. }
  125.  
  126. return binaryText;
  127. }
  128. </script>
  129. </body>
  130. </html>
  131.  
Add Comment
Please, Sign In to add comment