From bcbd691ea703cf98e0ccaabfe09a1d3fa4c58151 Mon Sep 17 00:00:00 2001 From: Joshua Drake Date: Fri, 13 Aug 2010 16:09:31 +0000 Subject: [PATCH] add a list chunk function git-svn-id: file:///home/svn/framework3/trunk@9997 4d416f70-5f16-0410-b530-b9f4589650da --- lib/msf/core/exploit/riff.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/msf/core/exploit/riff.rb b/lib/msf/core/exploit/riff.rb index b70efd56c7..725fb1fed3 100644 --- a/lib/msf/core/exploit/riff.rb +++ b/lib/msf/core/exploit/riff.rb @@ -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