<div dir="ltr">That same command line and replay work fine for me. Could you provide a backtrace from gdb of the crash?</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 6, 2017 at 4:37 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">Thank you for the suggestions.<br>
Yes, I did include &#39;assert(init_osi_api());&#39; right after &#39;panda_require(&quot;osi&quot;);&#39;. The problem is that the execution segfaults at the instruction &#39;panda_require(&quot;osi&quot;);&#39;, it doesn&#39;t reach the following instructions.<br>
<br>
When I try to execute the following command:<br>
/home/samaicardi/panda1/qemu/x<wbr>86_64-softmmu/qemu-system-x86_<wbr>64 -replay 6bb0dca4-0cea-465c-be82-5a39c1<wbr>fed8ef -panda osi -panda win7x86intro -panda asidstory:width=180 -os windows-32-7 -m 1G<br>
<br>
I get:<br>
loading snapshot<br>
Unknown savevm section or instance &#39;vmmouse&#39; 0<br>
... done.<br>
opening nondet log for read :   ./6bb0dca4-0cea-465c-be82-5a3<wbr>9c1fed8ef-rr-nondet.log<br>
max_instr = 75766907229<br>
Segmentation fault (core dumped)<br>
<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"><div><div class="h5">
Yep, good advice :) Also, you may want to verify that an existing plugin<br>
that uses osi, such as asidstory, works with the replay.<br>
<br>
On Tue, Sep 5, 2017 at 3:03 PM, Bridgey theGeek &lt;<a href="mailto:bridgeythegeek@gmail.com" target="_blank">bridgeythegeek@gmail.com</a>&gt;<br>
wrote:<br>
<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
Off the top of my head, did you include:<br>
<br>
assert(init_osi_api());<br>
<br>
immediately after:<br>
panda_require(&quot;osi&quot;);<br>
?<br>
<br>
For example: <a href="https://github.com/panda-re/panda/blob/" rel="noreferrer" target="_blank">https://github.com/panda-re/pa<wbr>nda/blob/</a><br>
060e90693f2ceb30b9c461a5835701<wbr>e5c463b87a/panda/plugins/<br>
asidstory/asidstory.cpp#L359<br>
(The same in PANDA 1.0 and 2.0)<br>
<br>
HTH,<br>
Adam<br>
<br>
<br>
On Tue, 5 Sep 2017 at 10:40 &lt;<a href="mailto:aicardi@eurecom.fr" target="_blank">aicardi@eurecom.fr</a>&gt; wrote:<br>
<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
Could you please tell me how to execute those recordings with<br>
qemu-system-x86_64 in 32-bit mode? I&#39;ve tried to load the &#39;osi&#39; plugin<br>
on several recordings but every time I got a segmentation fault.<br>
<br>
The way I execute them is:<br>
/home/samaicardi/panda1/qemu/x<wbr>86_64-softmmu/qemu-system-x86_<wbr>64 -replay<br>
&lt;replay_name&gt; -panda syscalls2:profile=windows7_x86 -panda<br>
&lt;my_plugin&gt;:&lt;my_plugin_params&gt; -os windows-32-7 -m 1G<br>
<br>
and in my_plugin I call:<br>
panda_require(&quot;osi&quot;);<br>
<br>
<br>
Thank you in advance,<br>
-samaicardi<br>
<br>
Quoting Brendan Dolan-Gavitt &lt;<a href="mailto:brendandg@nyu.edu" target="_blank">brendandg@nyu.edu</a>&gt;:<br>
<br>
&gt; The vast majority of those recordings are from Windows 7 32-bit, so osi<br>
&gt; will work on them. They were recorded on an emulated x86_64 machine<br>
running<br>
&gt; in 32-bit mode.<br>
&gt;<br>
&gt; On Mon, Sep 4, 2017 at 5:10 AM, &lt;<a href="mailto:aicardi@eurecom.fr" target="_blank">aicardi@eurecom.fr</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; Thank you for the information, it worked.<br>
&gt;&gt;<br>
&gt;&gt; Is it possible to use the &#39;osi&#39; plugin on those recordings? I&#39;ve seen<br>
the<br>
&gt;&gt; introspection implemented only for windows 32 bit.<br>
&gt;&gt;<br>
&gt;&gt; -samaicardi<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Quoting Brendan Dolan-Gavitt &lt;<a href="mailto:brendandg@nyu.edu" target="_blank">brendandg@nyu.edu</a>&gt;:<br>
&gt;&gt;<br>
&gt;&gt; The malware recordings use 1GB of RAM, so you need to pass &quot;-m 1G&quot; on<br>
the<br>
&gt;&gt;&gt; command line when replaying.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Also you may want to instead use the panda1 repository found here:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; <a href="https://github.com/moyix/panda" rel="noreferrer" target="_blank">https://github.com/moyix/panda</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; As I think I&#39;ve done a couple bugfixes to the old branch since we<br>
migrated<br>
&gt;&gt;&gt; the repository to the new version of QEMU.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; -Brendan<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On Thu, Aug 31, 2017 at 11:56 AM, &lt;<a href="mailto:aicardi@eurecom.fr" target="_blank">aicardi@eurecom.fr</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Ok I got it, thanks for the explanation.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; I have another problem actually, I tried to replay several records<br>
(from<br>
&gt;&gt;&gt;&gt; <a href="http://panda.gtisc.gatech.edu/malrec/" rel="noreferrer" target="_blank">http://panda.gtisc.gatech.edu/<wbr>malrec/</a>) with the qemu-system-x86_64<br>
&gt;&gt;&gt;&gt; compiled from the branch called &#39;panda1&#39; that I found here:<br>
&gt;&gt;&gt;&gt; <a href="https://github.com/panda-re/panda/tree/panda1" rel="noreferrer" target="_blank">https://github.com/panda-re/pa<wbr>nda/tree/panda1</a><br>
&gt;&gt;&gt;&gt; I always get the following error:<br>
&gt;&gt;&gt;&gt; $&gt; ~/panda1/qemu/x86_64-softmmu/q<wbr>emu-system-x86_64 -replay<br>
&gt;&gt;&gt;&gt; logs/rr/7d114620-3e3c-4193-96c<wbr>e-4689fd9efde3<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; (process:1475): GLib-WARNING **:  /build/glib2.0-prJhLS/glib2.0-<br>
&gt;&gt;&gt;&gt; 2.48.2/./glib/gmem.c:483:<br>
&gt;&gt;&gt;&gt; custom memory allocation vtable not supported<br>
&gt;&gt;&gt;&gt; loading snapshot<br>
&gt;&gt;&gt;&gt; Block expected 134217728, found 1073741824, total 1082589184, system<br>
&gt;&gt;&gt;&gt; total<br>
&gt;&gt;&gt;&gt; 143065088<br>
&gt;&gt;&gt;&gt; qemu: warning: error while loading state for instance 0x0 of device<br>
&#39;ram&#39;<br>
&gt;&gt;&gt;&gt; qemu-system-x86_64: Error -22 while loading VM state<br>
&gt;&gt;&gt;&gt; ... done.<br>
&gt;&gt;&gt;&gt; opening nondet log for read :   logs/rr/7d114620-3e3c-4193-96<br>
&gt;&gt;&gt;&gt; ce-4689fd9efde3-rr-nondet.log<br>
&gt;&gt;&gt;&gt; Infinite loop detected during replay, aborting.<br>
&gt;&gt;&gt;&gt; {guest_instr_count=0 pc=0x0000fff0, secondary=0x00000000}<br>
&gt;&gt;&gt;&gt; 7d114620-3e3c-4193-96ce-4689fd<wbr>9efde3:           0 (  0.00%) instrs.<br>
&gt;&gt;&gt;&gt; 1.00 sec.  0.03 GB ram.<br></div></div>
&gt;&gt;&gt;&gt; total_instr in replay: <a href="tel:15418486377" value="+15418486377" target="_blank">15418486377</a> &lt;(541)%20848-6377&gt;<div><div class="h5"><br>
&gt;&gt;&gt;&gt; ERROR: replay failed!<br>
&gt;&gt;&gt;&gt; Time taken was: 0 seconds.<br>
&gt;&gt;&gt;&gt; max_queue_len = 1<br>
&gt;&gt;&gt;&gt; 0 items on recycle list, 0 bytes total<br>
&gt;&gt;&gt;&gt; ERROR: replay failed!<br>
&gt;&gt;&gt;&gt; Aborted (core dumped)<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Do you possibly know why every record seems to generate an infinite<br>
loop?<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Thanks in advance,<br>
&gt;&gt;&gt;&gt; samaicardi<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Quoting Brendan Dolan-Gavitt &lt;<a href="mailto:brendandg@nyu.edu" target="_blank">brendandg@nyu.edu</a>&gt;:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Unfortunately the new version is unlikely to ever be able to replay<br>
old<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; recordings; too much in QEMU has changed, most notably the<br>
underlying<br>
&gt;&gt;&gt;&gt;&gt; default machine model (and hence the set of devices included in the<br>
&gt;&gt;&gt;&gt;&gt; snapshot). We also took the opportunity to change some of the<br>
&gt;&gt;&gt;&gt;&gt; record/replay<br>
&gt;&gt;&gt;&gt;&gt; log entry types to better match QEMU&#39;s new memory API.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; It is frustrating, since we have 91,000 malware recordings now and<br>
it<br>
&gt;&gt;&gt;&gt;&gt; would<br>
&gt;&gt;&gt;&gt;&gt; be cool to use them in panda2, but for now malware-related work has<br>
to<br>
&gt;&gt;&gt;&gt;&gt; use<br>
&gt;&gt;&gt;&gt;&gt; panda1. I will be switching malrec over to panda2 as soon as I have<br>
some<br>
&gt;&gt;&gt;&gt;&gt; free time, though.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; -Brendan<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; On Thu, Aug 31, 2017 at 4:50 AM, &lt;<a href="mailto:aicardi@eurecom.fr" target="_blank">aicardi@eurecom.fr</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Hello everyone,<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; I am writing a plugin for the new version of panda<br>
&gt;&gt;&gt;&gt;&gt;&gt; (<a href="https://github.com/panda-re/panda" rel="noreferrer" target="_blank">https://github.com/panda-re/p<wbr>anda</a>) and I would like to test it<br>
with<br>
&gt;&gt;&gt;&gt;&gt;&gt; several malware records that can be found here:<br>
&gt;&gt;&gt;&gt;&gt;&gt; <a href="http://panda.gtisc.gatech.edu/malrec/" rel="noreferrer" target="_blank">http://panda.gtisc.gatech.edu/<wbr>malrec/</a><br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; I followed the guidelines explained here:<br>
&gt;&gt;&gt;&gt;&gt;&gt; <a href="https://irfanulhaq.info/2015/12/09/replay-panda-malware-" rel="noreferrer" target="_blank">https://irfanulhaq.info/2015/1<wbr>2/09/replay-panda-malware-</a><br>
recordings/<br>
&gt;&gt;&gt;&gt;&gt;&gt; but I&#39;m having troubles in starting the replays.<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; When I try to execute one of those records I get the following<br>
error<br>
&gt;&gt;&gt;&gt;&gt;&gt; message:<br>
&gt;&gt;&gt;&gt;&gt;&gt; $&gt; ~/panda2/x86_64-softmmu/qemu-s<wbr>ystem-x86_64 -replay<br>
&gt;&gt;&gt;&gt;&gt;&gt; ~/replays/malrec/logs/rr/bb67f<wbr>d7e-7baa-437d-9333-9999b15f5fd<wbr>e<br>
&gt;&gt;&gt;&gt;&gt;&gt; &gt; loading snapshot<br>
&gt;&gt;&gt;&gt;&gt;&gt; &gt; qemu-system-x86_64: Unsupported migration stream version<br>
&gt;&gt;&gt;&gt;&gt;&gt; &gt; Failed to load vmstate<br>
&gt;&gt;&gt;&gt;&gt;&gt; &gt; Failed to start replay<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; If I understood it properly, the &#39;problem&#39; of those records is that<br>
&gt;&gt;&gt;&gt;&gt;&gt; they have been recorded starting from one of the snapshots that<br>
can be<br>
&gt;&gt;&gt;&gt;&gt;&gt; found here: <a href="http://panda.gtisc.gatech.edu/malrec/rr/references/" rel="noreferrer" target="_blank">http://panda.gtisc.gatech.edu/<wbr>malrec/rr/references/</a><br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; These snapshots were taken using the old version of panda<br>
&gt;&gt;&gt;&gt;&gt;&gt; (<a href="https://github.com/moyix/panda" rel="noreferrer" target="_blank">https://github.com/moyix/pand<wbr>a</a>).<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; By analyzing the code of the new panda<br>
(include/migration/migration.h<wbr>)<br>
&gt;&gt;&gt;&gt;&gt;&gt; I saw that there&#39;s the following line:<br>
&gt;&gt;&gt;&gt;&gt;&gt; #define QEMU_VM_FILE_VERSION         0x00000003<br>
&gt;&gt;&gt;&gt;&gt;&gt; which is different from what was declared in the old panda<br>
&gt;&gt;&gt;&gt;&gt;&gt; (qemu/savevm.c):<br>
&gt;&gt;&gt;&gt;&gt;&gt; #define QEMU_VM_SECTION_FULL         0x04<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; That difference is causing the error I am getting and I may infer<br>
&gt;&gt;&gt;&gt;&gt;&gt; there are other differences between the two versions (for what<br>
&gt;&gt;&gt;&gt;&gt;&gt; concerns the procedure of saving a snapshot).<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; My question is, since the two versions of panda take snapshots in<br>
&gt;&gt;&gt;&gt;&gt;&gt; different ways (they write different metadata I guess), is there a<br>
way<br>
&gt;&gt;&gt;&gt;&gt;&gt; to replay records (from <a href="http://panda.gtisc.gatech.edu/malrec/" rel="noreferrer" target="_blank">http://panda.gtisc.gatech.edu/<wbr>malrec/</a>)<br>
with<br>
&gt;&gt;&gt;&gt;&gt;&gt; the new version of panda?<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; Or, is it possible to &#39;patch&#39; the vm snapshots (from<br>
&gt;&gt;&gt;&gt;&gt;&gt; <a href="http://panda.gtisc.gatech.edu/malrec/rr/references/" rel="noreferrer" target="_blank">http://panda.gtisc.gatech.edu/<wbr>malrec/rr/references/</a>) to make them<br>
work<br>
&gt;&gt;&gt;&gt;&gt;&gt; with the new version of panda?<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; Thank you in advance for any suggestions you may have!<br>
&gt;&gt;&gt;&gt;&gt;&gt; samaicardi<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; ------------------------------<wbr>------------------------------<br>
&gt;&gt;&gt;&gt;&gt;&gt; -------------------<br>
&gt;&gt;&gt;&gt;&gt;&gt; This message was sent using EURECOM Webmail:<br>
<a href="http://webmail.eurecom.fr" rel="noreferrer" target="_blank">http://webmail.eurecom.fr</a><br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; ______________________________<wbr>_________________<br>
&gt;&gt;&gt;&gt;&gt;&gt; panda-users mailing list<br>
&gt;&gt;&gt;&gt;&gt;&gt; <a href="mailto:panda-users@mit.edu" target="_blank">panda-users@mit.edu</a><br>
&gt;&gt;&gt;&gt;&gt;&gt; <a href="http://mailman.mit.edu/mailman/listinfo/panda-users" rel="noreferrer" target="_blank">http://mailman.mit.edu/mailman<wbr>/listinfo/panda-users</a><br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; --<br>
&gt;&gt;&gt;&gt;&gt; Brendan Dolan-Gavitt<br>
&gt;&gt;&gt;&gt;&gt; Assistant Professor, Department of Computer Science and Engineering<br>
&gt;&gt;&gt;&gt;&gt; NYU Tandon School of Engineering<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; ------------------------------<wbr>------------------------------<br>
&gt;&gt;&gt;&gt; -------------------<br>
&gt;&gt;&gt;&gt; This message was sent using EURECOM Webmail:<br>
<a href="http://webmail.eurecom.fr" rel="noreferrer" target="_blank">http://webmail.eurecom.fr</a><br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; --<br>
&gt;&gt;&gt; Brendan Dolan-Gavitt<br>
&gt;&gt;&gt; Assistant Professor, Department of Computer Science and Engineering<br>
&gt;&gt;&gt; NYU Tandon School of Engineering<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; ------------------------------<wbr>------------------------------<br>
&gt;&gt; -------------------<br>
&gt;&gt; This message was sent using EURECOM Webmail: <a href="http://webmail.eurecom.fr" rel="noreferrer" target="_blank">http://webmail.eurecom.fr</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Brendan Dolan-Gavitt<br>
&gt; Assistant Professor, Department of Computer Science and Engineering<br>
&gt; NYU Tandon School of Engineering<br>
&gt;<br>
<br>
<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>
______________________________<wbr>_________________<br>
panda-users mailing list<br>
<a href="mailto:panda-users@mit.edu" target="_blank">panda-users@mit.edu</a><br>
<a href="http://mailman.mit.edu/mailman/listinfo/panda-users" rel="noreferrer" target="_blank">http://mailman.mit.edu/mailman<wbr>/listinfo/panda-users</a><br>
<br>
</div></div></blockquote><div><div class="h5">
<br>
______________________________<wbr>_________________<br>
panda-users mailing list<br>
<a href="mailto:panda-users@mit.edu" target="_blank">panda-users@mit.edu</a><br>
<a href="http://mailman.mit.edu/mailman/listinfo/panda-users" rel="noreferrer" target="_blank">http://mailman.mit.edu/mailman<wbr>/listinfo/panda-users</a><br>
<br>
<br>
</div></div></blockquote><div><div class="h5">
<br>
<br>
--<br>
Brendan Dolan-Gavitt<br>
Assistant Professor, Department of Computer Science and Engineering<br>
NYU Tandon School of Engineering<br>
<br>
</div></div></blockquote><div class="HOEnZb"><div class="h5">
<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>