add a list chunk function

git-svn-id: file:///home/svn/framework3/trunk@9997 4d416f70-5f16-0410-b530-b9f4589650da
unstable
Joshua Drake 2010-08-13 16:09:31 +00:00
parent b403c787d6
commit bcbd691ea7
1 changed files with 11 additions and 0 deletions

View File

@ -22,6 +22,17 @@ module Exploit::RIFF
return tag + [len].pack('V') + data + ("\x00" * padding)
end
#
# Builds a RIFF list chunk (one containing other chunks)
#
def riff_list_chunk(tag, type, data)
len = data.length + 4
padding = len % 2
return tag + [len].pack('V') + type + data
end
#
# Generates a random number of random RIFF chunks, up to 4352 bytes