The first part is a hack to allow deliberate control of the 4th arg to readsectors/writesectors rather than depending on accidental values. --- util.c.dist Mon Jan 26 22:58:31 2004 +++ util.c Sun Jan 25 00:56:13 2004 @@ -7,6 +7,8 @@ #include "mfs.h" #include +int decode = 0; + void read_all(int fd, void *buf, int size) { while (size) { @@ -128,7 +130,7 @@ req.num_sectors = count; req.deadline = 0; - return syscall(__NR_readsectors, fd, &vec, 1, &req); + return syscall(__NR_readsectors, fd, &vec, 1, &req, decode); #else llseek(fd, ((u64)sector)<>SECTOR_SHIFT; @@ -147,7 +149,7 @@ req.num_sectors = count; req.deadline = 0; - return syscall(__NR_writesectors, fd, &vec, 1, &req); + return syscall(__NR_writesectors, fd, &vec, 1, &req, 0); #else llseek(fd, ((u64)sector)<>SECTOR_SHIFT; And the second is a hack to do an unscramble single-pass of a fsid with a few seatbelts to make sure that you really have the keys, and it really works, and that you're not about to trash valid code. Note.. unscramble.o will keep on caching the keys and will cause all the mfs_stream/mfs_export stuff to mistakenly re-scramble the already unscrambled data. rmmod/insmod unscramble.o to flush its caches, and then run a csoscout.tcl pass to clear the cso values so that tivoapp can play it. /* media-filesystem unscramble utility developed by tivodvlpr@hotmail.com, August 2002 released under the Gnu GPL v2 this work is based on work by tridge@samba.org 07/15/03: cleaned and optimized by embeem 01/24/04: changed for unscramble */ extern int decode; #include "mfs.h" #define BUFSIZE 0x20000 void unscramble_stream(const u32 fsid) { struct mfs_inode inode; int run; unsigned char buf[BUFSIZE]; int pct, last_pct=0; u64 ofs=0; u64 size; mfs_load_inode(fsid, &inode); size = mfs_fsid_size(fsid); for (run=0;run0) { int rlen = MIN(BUFSIZE>>SECTOR_SHIFT,len); //number of sectors to read this round int ret = rlen<\n"); exit(1); } int main(int argc, char *argv[]) { int fsid=0; if (argc != 2) { usage(); } mfs_init(); fsid = mfs_resolve(argv[1]); if (fsid == 0) { fprintf(stderr, "Error: The path or fsid %s is invalid\n", argv[1]); exit(1); } unscramble_stream(fsid); return 0; }