Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Reading Tribes 1 dts files

View read_tribes1dts.rb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
#!/usr/bin/ruby
 
# Basic attempt at reading Tribes 1 .dts files
# Appears to be some sort of nested IFF-like block format
 
File.open(ARGV[0]) do |f|
pos = 0
while !f.eof
f.seek pos
magic = f.read(4).unpack("L<")[0]
if magic != 0x53524550 # PERS
pos += 1
next
end
size, namesize = f.read(4+2).unpack("L<S<")
name = f.read(namesize)
puts "BLOCK: #{name} @ #{pos} [#{size} bytes]"
pos += 4+4+2+namesize # Skip this block header
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.