[panda-users] Plugin

Gabriele Viglianisi vigliag at gmail.com
Sat Nov 4 15:42:15 EDT 2017


Hi Alessandro,
If you need to access registers, you should use `CPUArchState`, which is
architecture-specific (ie: you should put it inside the right ifdef guard)
You can use it like this:

> #ifdef TARGET_I386
> CPUArchState *env = (CPUArchState*)cpu->env_ptr;
> ... rest of architecture dependent code...
>
> #endif

Regards,
Gabriele

2017-11-04 20:19 GMT+01:00 alessandro mantovani <alk13 at hotmail.it>:

> Dear Brendan,
>
>
> Thank you for the answer but during the building phase (i.e. after that I
> launch build.sh) I get the following error:
>
>
> panda/plugins/myfirstplugin.c:42:13: error: ‘CPUState’ has no member
> named ‘regs’
>                        pc, env->regs[R_EAX]);
>
> All the other files are correctly compiled so I don't have any idea.
> Obviously env is a CPUState* variable. My included files are:
>
> #include "panda/plugin.h"
> #include "panda/plugin_plugin.h"
> #include "cpu.h"
> #include "qemu-common.h"
>
> Do you know what is the problem?
> greetings to all
>
>
>
>
> ------------------------------
> *Da:* Brendan Dolan-Gavitt <brendandg at nyu.edu>
> *Inviato:* venerdì 3 novembre 2017 17:02
> *A:* alessandro mantovani
> *Cc:* panda-users at mit.edu
> *Oggetto:* Re: [panda-users] Plugin
>
> Put it in the panda/plugins directory and then add the name of the plugin
> to panda/plugins/config.panda. Then just run build.sh as normal and your
> plugin will be built with the others. It is also possible to have an
> "external plugins" path, see here for details:
>
> https://github.com/panda-re/panda/blob/4d1e32541d1f9e79abc8b7706669a9
> 5d3fcb7a2f/panda/docs/manual.md#personal-plugins
>
> <https://github.com/panda-re/panda/blob/4d1e32541d1f9e79abc8b7706669a95d3fcb7a2f/panda/docs/manual.md#personal-plugins>
> panda-re/panda
> <https://github.com/panda-re/panda/blob/4d1e32541d1f9e79abc8b7706669a95d3fcb7a2f/panda/docs/manual.md#personal-plugins>
> github.com
> panda - Platform for Architecture-Neutral Dynamic Analysis
>
>
> On Fri, Nov 3, 2017 at 11:56 AM, alessandro mantovani <alk13 at hotmail.it>
> wrote:
>
> Hi all,
>
>
> I have written my first plugin but I don't know what I've to do now. How
> can I compile and build it so that it can be called in command line through
> the '-panda' option? (i.e. exactly like the other plugins already written)
>
>
> Thank you
>
> _______________________________________________
> panda-users mailing list
> panda-users at mit.edu
> http://mailman.mit.edu/mailman/listinfo/panda-users
>
>
>
>
> --
> Brendan Dolan-Gavitt
> Assistant Professor, Department of Computer Science and Engineering
> NYU Tandon School of Engineering
>
> _______________________________________________
> panda-users mailing list
> panda-users at mit.edu
> http://mailman.mit.edu/mailman/listinfo/panda-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/panda-users/attachments/20171104/7e27d2f8/attachment-0001.html


More information about the panda-users mailing list