<div dir="ltr"><div>Hi Simone,<br><br></div><div>I&#39;m not sure what your problem is. Maybe you want to look on my code here: <a href="https://github.com/m000/panda/tree/9f9b430d8e0ef2b239a3dfc6e3263b4a6a5ac92f/qemu/panda_plugins/prov_tracer">https://github.com/m000/panda/tree/9f9b430d8e0ef2b239a3dfc6e3263b4a6a5ac92f/qemu/panda_plugins/prov_tracer</a><br><br></div><div>In this plugin:<br>- The syscall definitions are translated in .c files using a python script.<br>- The .c files are compiled into dynamic libraries.<br>- A callback is inserted on SYSENTER/SYSEXIT instructions. Using the dynamically loaded syscall specs, a string representation of the system call is printed.<br><br></div><div>The plugin has grown substantially more complex after this point, so I think that this commit it is a good starting point for what you want. Let me know if that helped.<br><br>Regarding the order of execution of callbacks, I&#39;m not sure but it should be fairly easy to find out by reading the source. However, whatever you find should probably be considered an implementation detail. I.e. if it is not written in the docs, it is subject to change without notice. So your code should preferrably not depend on the specific order.<br><br></div><div>Cheers,<br></div><div>Manolis<br></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">2015-04-19 7:04 GMT-07:00 Simone Mazzoni <span dir="ltr">&lt;<a href="mailto:simone.mazzoni13@gmail.com" target="_blank">simone.mazzoni13@gmail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Manolis,<br><br><div>I think I got the problem. <br>In my plugin I called the get_current_process() in a function executed every time a PANDA_CB_INSN_EXEC callback was called. In the osi_test the get_current_process() function is called every time is called a PANDA_CB_BEFORE_BLOCK_EXEC callback. If i call the get_current_process() within the PANDA_CB_BEFORE_BLOCK_EXEC callback, all works fine and I get the name of the current process in execution.<br><br>Now I have another problem. </div><div>My original purpose is to track the system calls invoked by a specific process. </div><div>In my windows version of the plugin, I do this thing by:</div><div>- intercept if the current instruction is SYSENTER (checking the op code in the PANDA_CB_INSN_TRANSLATE callback) </div><div><span style="line-height:1.5;font-size:13.2px">- if I&#39;m in SYSENTER, I call the get_current_process() function after every </span>PANDA_CB_INSN_EXEC callback to check if the PID or PROCESS_NAME is the desired one, and if it is, I print out the value of the EAX register.<br><span style="font-size:13.2px;line-height:1.5"><br>I will put my plugin source code as attachment so as you can better understand.</span></div><div><span style="font-size:13.2px;line-height:1.5"><br></span></div><div>I tried to do the same in the plugin for linux using the osi_linux, but it does not work. How can I accomplish my goal?</div><div><br></div><div>I have also another question, the PANDA_CB_INSN_EXEC callback, is called before or after the PANDA_CB_BEFORE_BLOCK_EXEC?<br><br>Thanks.</div><span class=""><font color="#888888"><div><br></div><div>- Simone</div><div><span style="font-size:13.2px;line-height:1.5"><br></span></div><div><span style="font-size:13.2px;line-height:1.5"> </span><br></div></font></span></div></blockquote></div></div></div></div></div>