<div dir="ltr">If there are too many differences, then it doesn&#39;t make sense to store them as a diff. If all of the recordings come from the same base snapshot, you should find that they are very similar. This was the case in panda1, at least – are you trying this with panda1 or panda2?</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 6, 2017 at 10:20 AM,  <span dir="ltr">&lt;<a href="mailto:aicardi@eurecom.fr" target="_blank">aicardi@eurecom.fr</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">And also, when I try to execute bdiff.cpp (which I previously compiled) I am always in the case &#39;if (diffs &gt; 256) return 2;&#39; with a lot of differences between the two snapshots.<div class="HOEnZb"><div class="h5"><br>
<br>
Quoting Brendan Dolan-Gavitt &lt;<a href="mailto:brendandg@nyu.edu" target="_blank">brendandg@nyu.edu</a>&gt;:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I should add that it *is* possible to extract the snapshot from a QCOW if<br>
that&#39;s what you really want. Just start up QEMU with:<br>
<br>
-loadvm snap -S<br>
<br>
Then at the monitor, do:<br>
<br>
migrate &quot;exec:cat &gt; reference-rr-snp&quot;<br>
<br>
Best,<br>
Brendan<br>
<br>
On Mon, Nov 6, 2017 at 9:18 AM, Brendan Dolan-Gavitt &lt;<a href="mailto:brendandg@nyu.edu" target="_blank">brendandg@nyu.edu</a>&gt;<br>
wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Since they&#39;re all very similar to one another, you can just pick any<br>
-rr-snp to use as the reference snapshot. The pack_opt.sh script will<br>
detect if there&#39;s no sufficiently-similar reference snapshot and copy the<br>
current snapshot into the references directory.<br>
<br>
-Brendan<br>
<br>
On Mon, Nov 6, 2017 at 9:16 AM, &lt;<a href="mailto:aicardi@eurecom.fr" target="_blank">aicardi@eurecom.fr</a>&gt; wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thank you very much, I will try them soon!<br>
Just another question: how can I create the &quot;reference&quot; snapshot?<br>
Normally I start recording from a qcow2 image snaphsot that I&#39;ve<br>
previously created with qemu monitor&#39;s &quot;savevm &lt;snap_name&gt;&quot; command,<br>
do I need to extract the reference snapshot from the qcow2 image?<br>
<br>
Regards,<br>
Samuele<br>
<br>
Quoting Brendan Dolan-Gavitt &lt;<a href="mailto:brendandg@nyu.edu" target="_blank">brendandg@nyu.edu</a>&gt;:<br>
<br>
The basic idea is very simple. The -rr-snp files differ from the<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
&quot;reference&quot; snapshots by only a few bytes, so you can just make a diff. I<br>
wrote to small programs to diff and patch the snapshots, bdiff and<br>
bpatch.py:<br>
<br>
<a href="http://giantpanda.gtisc.gatech.edu/malrec/rr/tools/" rel="noreferrer" target="_blank">http://giantpanda.gtisc.gatech<wbr>.edu/malrec/rr/tools/</a><br>
<br>
There is also a script there that will create the diff and pack up a<br>
recording automatically given a snapshot and a list of possible reference<br>
snapshots:<br>
<br>
<a href="http://giantpanda.gtisc.gatech.edu/malrec/rr/tools/pack_opt.sh" rel="noreferrer" target="_blank">http://giantpanda.gtisc.gatech<wbr>.edu/malrec/rr/tools/pack_opt.<wbr>sh</a><br>
<br>
Hope this helps!<br>
<br>
Best,<br>
Brendan<br>
<br>
<br>
<br>
On Mon, Nov 6, 2017 at 5:12 AM, &lt;<a href="mailto:aicardi@eurecom.fr" target="_blank">aicardi@eurecom.fr</a>&gt; wrote:<br>
<br>
Hello Brendan,<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I am writing a script to apply my panda plugin on a large number of<br>
recordings.<br>
To do so I need to take a lot of recordings starting from the same<br>
qemu snapshot.<br>
My problem is that I don&#39;t have enough space to save all the *-rr-snp<br>
files on disk. I saw on this article<br>
(<a href="https://irfanulhaq.info/2015/12/09/replay-panda-malware-recordings/" rel="noreferrer" target="_blank">https://irfanulhaq.info/2015/<wbr>12/09/replay-panda-malware-rec<wbr>ordings/</a>)<br>
that it&#39;s possible to save just a &quot;patch&quot; file containing only the<br>
differences from the original snapshot and then generate the actual<br>
*-rr-snp file only when it&#39;s needed.<br>
<br>
How can I produce such &quot;patch&quot; file?<br>
<br>
Thank you in advance,<br>
<br>
Samuele<br>
<br>
------------------------------<wbr>------------------------------<br>
-------------------<br>
This message was sent using EURECOM Webmail: <a href="http://webmail.eurecom.fr" rel="noreferrer" target="_blank">http://webmail.eurecom.fr</a><br>
<br>
<br>
<br>
</blockquote>
<br>
--<br>
Brendan Dolan-Gavitt<br>
Assistant Professor, Department of Computer Science and Engineering<br>
NYU Tandon School of Engineering<br>
<br>
<br>
</blockquote>
------------------------------<wbr>------------------------------<br>
-------------------<br>
This message was sent using EURECOM Webmail: <a href="http://webmail.eurecom.fr" rel="noreferrer" target="_blank">http://webmail.eurecom.fr</a><br>
<br>
<br>
</blockquote>
<br>
<br>
--<br>
Brendan Dolan-Gavitt<br>
Assistant Professor, Department of Computer Science and Engineering<br>
NYU Tandon School of Engineering<br>
<br>
</blockquote>
<br>
<br>
<br>
--<br>
Brendan Dolan-Gavitt<br>
Assistant Professor, Department of Computer Science and Engineering<br>
NYU Tandon School of Engineering<br>
<br>
</blockquote>
<br>
<br>
<br>
------------------------------<wbr>------------------------------<wbr>-------------------<br>
This message was sent using EURECOM Webmail: <a href="http://webmail.eurecom.fr" rel="noreferrer" target="_blank">http://webmail.eurecom.fr</a><br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Brendan Dolan-Gavitt<br>Assistant Professor, Department of Computer Science and Engineering<br>NYU Tandon School of Engineering</div>
</div>