API & Backend Routes

Mounted during npm run dev

  • POST /api/reverse-engineer/analyse — analyze a single binary.
  • POST /api/reverse-engineer/analyse-batch — batch binary analysis → JSONL.
  • ALL /api/audio/youtube — YouTube audio fetch (yt-dlp + puppeteer fallback).
  • POST /api/scrape — website scrape to text.

Notes

  • Puppeteer: install Chrome if missing (npx puppeteer browsers install chrome).
  • yt-dlp: must be on PATH for YouTube fetch stage.
  • These routes are surfaced through Vite dev middleware; no extra server needed unless you run npm run reverse-backend.

Examples

Single binary analyse (/api/reverse-engineer/analyse)

curl -X POST http://localhost:5173/api/reverse-engineer/analyse \
  -F "file=@/path/to/binary.exe" \
  -H "Accept: application/json"

Batch reverse engineer (/api/reverse-engineer/analyse-batch)

multipart/form-data with multiple file parts; returns JSONL.

curl -X POST http://localhost:5173/api/reverse-engineer/analyse-batch \
  -H "Accept: application/json" \
  -F "file=@/path/to/bin1.exe" \
  -F "file=@/path/to/bin2.dll" \
  -o analysis.jsonl

YouTube audio fetch (/api/audio/youtube)

Supports GET/POST; provide URL (and cookies if needed for restricted videos).

curl "http://localhost:5173/api/audio/youtube?url=https://www.youtube.com/watch?v=dQw4w9WgXcQ" \
  -H "Accept: audio/*" \
  -o audio.m4a
# For restricted videos, send cookies:
# -H "Cookie: YSC=...; VISITOR_INFO1_LIVE=..."

Website scrape (/api/scrape)

POST JSON with the target URL; returns scraped text.

curl -X POST http://localhost:5173/api/scrape \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com"}'