wzLeonardo

Untitled

Nov 15th, 2025
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.20 KB | None | 0 0
  1. // Configuração de UI Avançada
  2. const createStealthElement = (tag, styles) => {
  3. const el = document.createElement(tag);
  4. Object.assign(el.style, {
  5. position: 'fixed',
  6. zIndex: '2147483647',
  7. padding: '8px 16px',
  8. background: '#2c3e50',
  9. color: 'white',
  10. border: 'none',
  11. borderRadius: '4px',
  12. cursor: 'pointer',
  13. boxShadow: '0 2px 5px rgba(0,0,0,0.3)',
  14. fontSize: '14px',
  15. right: '10px',
  16. ...styles
  17. });
  18. return el;
  19. };
  20.  
  21. const button = createStealthElement('button', { top: '10px' });
  22. button.textContent = 'Selecionar Vídeo';
  23. const deleteButton = createStealthElement('button', { top: '50px' });
  24. deleteButton.textContent = 'Remover Vídeo';
  25. deleteButton.style.display = 'none';
  26. document.body.append(button, deleteButton);
  27.  
  28. // Estado Global Seguro
  29. let customStream = null;
  30. let videoBlob = null;
  31. let originalAPIs = {};
  32.  
  33. // Sobrescrita de APIs Críticas
  34. const overrideMediaAPIs = () => {
  35. originalAPIs.getUserMedia = navigator.mediaDevices.getUserMedia;
  36. originalAPIs.createObjectURL = URL.createObjectURL;
  37. originalAPIs.mediaDevices = navigator.mediaDevices;
  38.  
  39. navigator.mediaDevices.getUserMedia = async constraints => {
  40. if (constraints.video && customStream) {
  41. return customStream.clone();
  42. }
  43. return originalAPIs.getUserMedia(constraints);
  44. };
  45.  
  46. URL.createObjectURL = function(blob) {
  47. if (blob instanceof Blob && videoBlob) {
  48. return originalAPIs.createObjectURL(videoBlob);
  49. }
  50. return originalAPIs.createObjectURL(blob);
  51. };
  52. };
  53.  
  54. // Sistema de Streaming Híbrido
  55. const createHybridStream = async (file) => {
  56. const video = document.createElement('video');
  57. video.src = URL.createObjectURL(file);
  58. await new Promise(resolve => video.onloadedmetadata = resolve);
  59.  
  60. // Configuração do Canvas
  61. const canvas = document.createElement('canvas');
  62. const ctx = canvas.getContext('2d');
  63. [canvas.width, canvas.height] = [video.videoWidth, video.videoHeight];
  64.  
  65. // Renderização de Vídeo
  66. video.play();
  67. const drawFrame = () => {
  68. if (!video.paused && !video.ended) {
  69. ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
  70. requestAnimationFrame(drawFrame);
  71. }
  72. };
  73. drawFrame();
  74.  
  75. // Captura de Áudio
  76. const audioContext = new AudioContext();
  77. const source = audioContext.createMediaElementSource(video);
  78. const destination = audioContext.createMediaStreamDestination();
  79. source.connect(audioContext.destination);
  80. source.connect(destination);
  81.  
  82. // Combinação de Streams
  83. const stream = canvas.captureStream(30);
  84. stream.addTrack(destination.stream.getAudioTracks()[0]);
  85.  
  86. return stream;
  87. };
  88.  
  89. // Sistema de Monitoramento Reforçado
  90. const initAdvancedObserver = () => {
  91. const observer = new MutationObserver(mutations => {
  92. mutations.forEach(({target, attributeName}) => {
  93. // Detecção de elementos de vídeo
  94. if (target instanceof HTMLVideoElement) {
  95. if (target.src.startsWith('blob:') && videoBlob) {
  96. target.src = URL.createObjectURL(videoBlob);
  97. }
  98.  
  99. // Substituição silenciosa de streams
  100. if (target.srcObject && !target.srcObject.getTracks().some(t => t.label === 'custom')) {
  101. target.srcObject = customStream;
  102. }
  103. }
  104. });
  105. });
  106.  
  107. observer.observe(document, {
  108. subtree: true,
  109. childList: true,
  110. attributes: true,
  111. attributeFilter: ['src', 'srcObject']
  112. });
  113. };
  114.  
  115. // Controles Interativos
  116. button.onclick = async () => {
  117. try {
  118. const [file] = await new Promise(resolve => {
  119. const input = document.createElement('input');
  120. input.type = 'file';
  121. input.accept = 'video/*';
  122. input.onchange = () => resolve(input.files);
  123. input.click();
  124. });
  125.  
  126. videoBlob = file;
  127. customStream = await createHybridStream(file);
  128. overrideMediaAPIs();
  129. initAdvancedObserver();
  130.  
  131. // Atualização de UI
  132. button.textContent = 'Transmissão Ativa ✅';
  133. deleteButton.style.display = 'block';
  134.  
  135. // Injeção contínua de metadados
  136. const injectMetadata = () => {
  137. if (customStream) {
  138. customStream.getTracks().forEach(track => {
  139. track.contentHint = 'detailed';
  140. if (track.kind === 'video') {
  141. track.applyConstraints({
  142. advanced: [{ width: 1280, height: 720 }]
  143. });
  144. }
  145. });
  146. }
  147. };
  148. setInterval(injectMetadata, 1000);
  149.  
  150. } catch (error) {
  151. console.error('Erro na transmissão:', error);
  152. }
  153. };
  154.  
  155. deleteButton.onclick = () => {
  156. customStream?.getTracks().forEach(track => {
  157. track.stop();
  158. track.enabled = false;
  159. });
  160. customStream = null;
  161. videoBlob = null;
  162.  
  163. // Restauração gradual das APIs
  164. setTimeout(() => {
  165. navigator.mediaDevices.getUserMedia = originalAPIs.getUserMedia;
  166. URL.createObjectURL = originalAPIs.createObjectURL;
  167. }, 1000);
  168.  
  169. button.textContent = 'Selecionar Vídeo';
  170. deleteButton.style.display = 'none';
  171. };
  172.  
  173. // Inicialização Segura
  174. window.addEventListener('load', () => {
  175. setTimeout(() => {
  176. if (!document.querySelector('#stealth-overlay')) {
  177. overrideMediaAPIs();
  178. initAdvancedObserver();
  179. }
  180. }, 3000);
  181. });
Advertisement
Add Comment
Please, Sign In to add comment