Exploit databaseDownload repository ZIP
GH-f1ca9c11b8ef6a486ff865162bf281b2
volksrat71/react2shellexploitvisualized
Sources for CVE-2025-55182
257 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files4
volksrat71/react2shellexploitvisualizedRevision e780d6fc4556
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
src/lib/utils/whisper-types.ts
TypeScript · 3,029 bytes// Shared Whisper types and utilities
// This file has no dependencies on other project files to avoid circular imports
import type { CaptionCue } from '$lib/stores/timeline.svelte';
export interface WhisperWord {
word: string;
start: number;
end: number;
probability?: number;
}
export interface WhisperSegment {
id: number;
start: number;
end: number;
text: string;
words?: WhisperWord[];
}
export interface WhisperOutput {
text: string;
segments: WhisperSegment[];
words?: WhisperWord[]; // Top-level words array (from newer whisper models)
language: string;
}
// Convert Whisper segments to caption cues
export function whisperToCaptions(whisper: WhisperOutput): CaptionCue[] {
return whisper.segments.map(segment => ({
start: segment.start,
end: segment.end,
text: segment.text.trim()
}));
}
// Find the timestamp when a specific phrase is spoken
export function findPhraseTime(whisper: WhisperOutput, phrase: string): number | null {
const lowerPhrase = phrase.toLowerCase();
const allWords = getAllWords(whisper);
// First, try to find word-level timing from the words array
if (allWords.length > 0) {
const phraseWords = lowerPhrase.split(' ').map(w => w.replace(/[^a-z]/g, ''));
// Sliding window search through all words - require exact word match
for (let i = 0; i <= allWords.length - phraseWords.length; i++) {
let matches = true;
for (let j = 0; j < phraseWords.length; j++) {
const wordText = allWords[i + j].word.toLowerCase().replace(/[^a-z]/g, '');
// Require exact match (after removing punctuation)
if (wordText !== phraseWords[j]) {
matches = false;
break;
}
}
if (matches) {
return allWords[i].start;
}
}
}
// Fall back to segment-level timing
for (const segment of whisper.segments) {
if (segment.text.toLowerCase().includes(lowerPhrase)) {
return segment.start;
}
}
return null;
}
// Find timestamp for a word
export function findWordTime(whisper: WhisperOutput, word: string): number | null {
const lowerWord = word.toLowerCase().replace(/[^a-z]/g, '');
for (const segment of whisper.segments) {
if (segment.words) {
for (const w of segment.words) {
if (w.word.toLowerCase().replace(/[^a-z]/g, '') === lowerWord) {
return w.start;
}
}
}
}
return null;
}
// Get total duration from whisper data
export function getAudioDuration(whisper: WhisperOutput): number {
const lastSegment = whisper.segments[whisper.segments.length - 1];
return lastSegment ? lastSegment.end : 0;
}
// Get all words from whisper data (prefers top-level words array, falls back to segment words)
export function getAllWords(whisper: WhisperOutput): WhisperWord[] {
// If top-level words array exists, use it
if (whisper.words && whisper.words.length > 0) {
return whisper.words;
}
// Otherwise, flatten words from all segments
const allWords: WhisperWord[] = [];
for (const segment of whisper.segments) {
if (segment.words) {
allWords.push(...segment.words);
}
}
return allWords;
}