[CrackMonkey] STAR TACK
Seth David Schoen
schoen at loyalty.org
Sun Jan 20 13:52:46 PST 2002
Nick Moffitt writes:
> [wrapper forwards out playing with THEDRAW]
> ---------- Forwarded message ----------
> Date: Sun, 20 Jan 2002 03:38:01 -0500 (EST)
> From: Kragen Sitaker <kragen at pobox.com>
> To: kragen-hacks at canonical.org
> Subject: record-movie, play-movie
> I've often wanted something that can record byte streams with timing
> intact and play them back with the timing intact. So someone FoRKed a
> site you could telnet to (towel.blinkenlights.nl, I think) to get
> played an ASCII-art movie of Star Wars, and after watching a bit of
> it, I knew I wanted a copy.
> So I wrote these programs, and recorded a few sessions. But,
> unfortunately, the telnet site was unreliable --- it would close the
> connection partway through the movie. I looked around, found the
> source of the movie, and translated it from the idiosyncratic format
> it was in to the idiosyncratic format I was using.
> And then I realized that a low-baud-rate simulator, useful for playing
> back animated ASCII art from old BBSes, would be a cinch, so I wrote
> that too.
That is really cool. I was looking at some similar things because I
was interested in writing a virtual sound card for Linux (software to
let you record the audio output from a program and play it back later,
especially handy for obnoxious programs which try to _prevent_ you
from making such a recording, like the RealPlayer).
It turns out that there is one and has been for a long time, by the
name of vsound:
but in the meantime I discovered Subterfugue [sic]:
which lets you intercept (and optionally rewrite/interfere with/take
some other action based on) syscalls from any program. (And you can
script that in Python.)
The Python scripts which modify the behavior of a process's system
calls are known as "tricks" (because they can be ways of "tricking"
the process, deceiving it about what is actually happening on the
system around it). (Unix processes now have a Cartesian epistemology
problem. Especially if they are implementing DRM and think of
themselves as having a moral responsibility to acquire reliable
knowledge of the external world.)
Two of the sample tricks supplied with Subterfugue do time-warping
things: the TimeWarp trick, which adjusts the process's perception of
the passage of real time, including things like the duration of sleep
calls, and the Delay trick, which adds a specified latency to each
system call (making the process run some proportion slower whenever it
does any kind of I/O).
Subterfugue also makes it easy to capture a process's I/O at a low
level, below stdio. That is what I was working on before I learned
about vsound (which takes a slightly different approach, using
LD_PRELOAD instead of ptrace, so it's at the libc layer instead of
the syscall layer). You can therefore theoretically log _other_
things than just output along with time and produce software which can
replay the entire behavior of a process it monitored. (Unfortunately,
this might not work right with network and X11 apps, because their
environment is not really static.)
The low baud rate simulator would be nice for watching some of the
ANSI movies from Trade Wars 2002.
Seth David Schoen <schoen at loyalty.org> | Reading is a right, not a feature!
http://www.loyalty.org/~schoen/ | -- Kathryn Myronuk
More information about the Crackmonkey