<div dir="ltr">Off the top of my head, did you include:<div><br></div><div>assert(init_osi_api());</div><div><br></div><div>immediately after:</div><div>panda_require(&quot;osi&quot;);</div><div>?</div><div><br></div><div>For example: <span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,&quot;Liberation Mono&quot;,Menlo,Courier,monospace;font-size:12px"><a href="https://github.com/panda-re/panda/blob/060e90693f2ceb30b9c461a5835701e5c463b87a/panda/plugins/asidstory/asidstory.cpp#L359">https://github.com/panda-re/panda/blob/060e90693f2ceb30b9c461a5835701e5c463b87a/panda/plugins/asidstory/asidstory.cpp#L359</a></span></div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,&quot;Liberation Mono&quot;,Menlo,Courier,monospace;font-size:12px">(The same in PANDA 1.0 and 2.0)</span></div><div><br></div><div>HTH,</div><div>Adam<br><br><div class="gmail_quote"><div dir="ltr">On Tue, 5 Sep 2017 at 10:40 &lt;<a href="mailto:aicardi@eurecom.fr">aicardi@eurecom.fr</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">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/x86_64-softmmu/qemu-system-x86_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 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 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 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 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 (from<br>
&gt;&gt;&gt;&gt; <a href="http://panda.gtisc.gatech.edu/malrec/" rel="noreferrer" target="_blank">http://panda.gtisc.gatech.edu/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/panda/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/qemu-system-x86_64 -replay<br>
&gt;&gt;&gt;&gt; logs/rr/7d114620-3e3c-4193-96ce-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 &#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-4689fd9efde3:           0 (  0.00%) instrs.<br>
&gt;&gt;&gt;&gt; 1.00 sec.  0.03 GB ram.<br>
&gt;&gt;&gt;&gt; total_instr in replay: <a href="tel:(541)%20848-6377" value="+15418486377" target="_blank">15418486377</a><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 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 old<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; recordings; too much in QEMU has changed, most notably the 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 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 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 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/panda</a>) and I would like to test it 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/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-recordings/" rel="noreferrer" target="_blank">https://irfanulhaq.info/2015/12/09/replay-panda-malware-recordings/</a><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 error<br>
&gt;&gt;&gt;&gt;&gt;&gt; message:<br>
&gt;&gt;&gt;&gt;&gt;&gt; $&gt; ~/panda2/x86_64-softmmu/qemu-system-x86_64 -replay<br>
&gt;&gt;&gt;&gt;&gt;&gt; ~/replays/malrec/logs/rr/bb67fd7e-7baa-437d-9333-9999b15f5fde<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 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/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/panda</a>).<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; By analyzing the code of the new panda (include/migration/migration.h)<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 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/malrec/</a>) 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/malrec/rr/references/</a>) to make them 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; ------------------------------------------------------------<br>
&gt;&gt;&gt;&gt;&gt;&gt; -------------------<br>
&gt;&gt;&gt;&gt;&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;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; _______________________________________________<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/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; ------------------------------------------------------------<br>
&gt;&gt;&gt;&gt; -------------------<br>
&gt;&gt;&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;&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; ------------------------------------------------------------<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>
-------------------------------------------------------------------------------<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>
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/listinfo/panda-users</a><br>
</blockquote></div></div></div>