[panda-users] PPP_REG_CB - What have I forgotten?

Brendan Dolan-Gavitt brendandg at nyu.edu
Tue Jul 19 17:39:24 EDT 2016


I think the issue is that we don't have a prototype for
NtUserCreateWindowEx, which means syscalls2 doesn't have a callback
for it. If you know the prototype, you can add it to
panda_plugins/syscalls2/all_windows_prototypes.txt, run
createWindowsPrototypes.py, and then run recreate_all_os_arch.sh and
it will add the appropriate callback.

At that point (assuming everything works), it would be great if you
created a pull request so that others can benefit as well!

-Brendan

On Tue, Jul 19, 2016 at 5:33 PM, Bridgey theGeek
<bridgeythegeek at gmail.com> wrote:
> Hi PANDAs,
>
> I'm trying to write a plugin to use alongside syscalls2 to handle
> NtUserCreateWindowEx.
>
> In the panda_plugins folder I've created a folder called 'usercreatewin'.
> In that folder I have usercreatewin.cpp and Makefile.
> I've added 'usercreatewin' to config.panda.
>
> My init function looks like this:
> bool init_plugin(void *self) {
>     PPP_REG_CB("syscalls2", on_NtUserCreateWindowEx_enter,
> my_NtUserCreateWindowEx_enter);
>     return true;
> }
>
> The corresponding 'my_NtUserCreateWindowEx_enter' function is in my cpp file
> as well.
>
> When I issue 'make' I get:
> --SNIP--
> make[2]: Nothing to be done for 'all'.
>   CXX
> /home/btg/src/panda/qemu/x86_64-softmmu/panda_plugins/usercreatewin.o
> In file included from usercreatewin.cpp:5:0:
> usercreatewin.cpp: In function ‘bool init_plugin(void*)’:
> usercreatewin.cpp:29:29: error: ‘on_NtUserCreateWindowEx_enter_t’ was not
> declared in this scope
>      PPP_REG_CB("syscalls2", on_NtUserCreateWindowEx_enter,
> my_NtUserCreateWindowEx_enter);
>                              ^
> /home/btg/src/panda/qemu/panda_plugin_plugin.h:120:20: note: in definition
> of macro ‘PPP_REG_CB’
>      void (*add_cb)(cb_name##_t fptr) = (void (*)(cb_name##_t)) dlsym(op,
> "ppp_add_cb_" #cb_name); \
>                     ^
> /home/btg/src/panda/qemu/panda_plugin_plugin.h:120:38: error: expected ‘,’
> or ‘;’ before ‘=’ token
>      void (*add_cb)(cb_name##_t fptr) = (void (*)(cb_name##_t)) dlsym(op,
> "ppp_add_cb_" #cb_name); \
>                                       ^
> usercreatewin.cpp:29:5: note: in expansion of macro ‘PPP_REG_CB’
>      PPP_REG_CB("syscalls2", on_NtUserCreateWindowEx_enter,
> my_NtUserCreateWindowEx_enter);
>      ^
> /home/btg/src/panda/qemu/panda_plugin_plugin.h:122:20: error: ‘add_cb’
> cannot be used as a function
>      add_cb (cb_func);       \
>                     ^
> usercreatewin.cpp:29:5: note: in expansion of macro ‘PPP_REG_CB’
>      PPP_REG_CB("syscalls2", on_NtUserCreateWindowEx_enter,
> my_NtUserCreateWindowEx_enter);
>      ^
> ../panda.mak:42: recipe for target
> '/home/btg/src/panda/qemu/x86_64-softmmu/panda_plugins/usercreatewin.o'
> failed
> --SNIP--
>
> It feels like I've forgotten something. Any help gratefully received!
>
> Thanks,
> Adam
>
> _______________________________________________
> 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



More information about the panda-users mailing list