In case anyone wants to play with the Kinoma movie format, here's a little dumper program for it; this script can easily be hacked to dump any type of IFF file:
#!/usr/pkg/bin/perl &imgsize(@ARGV); sub imgsize { my($file, $type, $pointer, $chunk, $size); foreach $file (@_) { open(IFF, $file) or die "cannot open: $!\n"; binmode(IFF); # necessary on Windows! $pointer = 0; # location of first size word while ($pointer < -s $file) { seek(IFF, $pointer, 0) or die "cannot seek: $!\n"; read(IFF, $chunk, 36) or die "cannot read: $!\n"; ($size, $type, $data) = unpack('nA2H*', $chunk); printf("0x%04x %2s %-64s\n", $size, $type, substr($data, 0, min($size - 4, 64))); $pointer += $size; } } } sub numerically { $a <=> $b; } sub min { return (sort numerically @_)[0]; }
Had to take a break from my PXE setup shit and figure that out. Had to hack in.tftpd so it would even work, it kept barfing on initgroups(3).
last updated 2013-01-10 20:24:26. served from tektonic.jcomeau.com