Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Regarding the issue of writing plugins.

47 views
Skip to first unread message

Jay Ironman

unread,
Dec 4, 2024, 8:58:21 AM12/4/24
to S2E Developer Forum
Hello:

I tried to write the plugin according to the method in [1], but it failed to run and prompted that the "ExecutionSignal" header file is missing. However, I don't know where the "ExecutionSignal" header file is located and couldn't find it in the S2E source code. In addition, I found that the tutorial in [1] lacks many steps, such as how to define header files (. h). Finally, using the ` s2e build ` command to compile will result in an error message stating that header files such as' ExecutionSignal 'cannot be found. Where is the detailed tutorial for building plugins? I really need it!

thank you.

Jay Ironman

unread,
Dec 4, 2024, 9:18:46 AM12/4/24
to S2E Developer Forum

Vitaly Chipounov

unread,
Dec 4, 2024, 10:32:23 AM12/4/24
to s2e...@googlegroups.com
Can you please attach your plugin files (cpp + h)? And paste the error messages?
Normally, the s2e new_plugin command should generate a working setup.

Thanks,
Vitaly

--
You received this message because you are subscribed to the Google Groups "S2E Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to s2e-dev+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/s2e-dev/1c6fdf1b-8e8f-4d5b-a785-0068b9f9c248n%40googlegroups.com.

Jay Ironman

unread,
Dec 5, 2024, 7:20:29 AM12/5/24
to S2E Developer Forum
Hello

I have successfully compiled the plugin now, but there are some errors (possible) in [1], listed below, hoping to be helpful:

1. The 'InstructionTrackerState' in the InstructionTracker. h file should be used instead of the 'InstructionTrackerState' in the anonymous namespace. So ` DECLARE_PLUGINSTATE (InstructionTrackerState, state) ` ->` DECLARE_PLUGINSTATE(s2e::plugins::InstructionTrackerState, state);`

2. The compiler cannot find the 'TranslationBlock' type in the 's2e' namespace. So ` s2e: TranslationBlock * tb ` ->` TranslationBlock * tb ``

The 'handleOpcodeInvocation' declaration already exists in the 'private' section of InstructionTracker. h in [1], it should be removed and declared again in the 'public' section

The above are the problems I encountered while conducting experiments according to the tutorial in [1]. Although I can successfully compile now, the above problems still exist. I hope they are helpful to you!

thank you

Jay Ironman

unread,
Dec 5, 2024, 8:47:02 PM12/5/24
to S2E Developer Forum
Oh, I'm sorry, I forgot to attach [1] again
[1]:http://s2e.systems/docs/Howtos/WritingPlugins.html

Vitaly Chipounov

unread,
Dec 7, 2024, 12:27:11 PM12/7/24
to s2e...@googlegroups.com
Hi,

On Thursday, December 5th, 2024 at 1:20 PM, Jay Ironman <ironman...@gmail.com> wrote:

1. The 'InstructionTrackerState' in the InstructionTracker. h file should be used instead of the 'InstructionTrackerState' in the anonymous namespace. So ` DECLARE_PLUGINSTATE (InstructionTrackerState, state) ` ->` DECLARE_PLUGINSTATE(s2e::plugins::InstructionTrackerState, state);`

I am not sure I understand this. There is no InstructionTrackerState in InstructionTracker.h, it should be in the anonymous namespace in the cpp file.


2. The compiler cannot find the 'TranslationBlock' type in the 's2e' namespace. So ` s2e: TranslationBlock * tb ` ->` TranslationBlock * tb ``

I don't have this error. Not sure where you saw s2e::TranslationBlock was used.


The 'handleOpcodeInvocation' declaration already exists in the 'private' section of InstructionTracker. h in [1], it should be removed and declared again in the 'public' section

I will fix this, it should be public indeed.

As asked before, please attach your plugin files, I can't help you debug your problems otherwise.

Thanks,
Vitaly

Jay Ironman

unread,
Dec 7, 2024, 12:33:50 PM12/7/24
to S2E Developer Forum
Hello

Thank you for your reply. Tomorrow, I will attach my plugin source code (which has been successfully compiled). There are indeed some differences between it and [1].

Thank you again.

Jay Ironman

unread,
Dec 8, 2024, 9:32:33 PM12/8/24
to S2E Developer Forum
Hello

I have attached my plugin source file and it has been successfully compiled. You can check if there are any issues I mentioned earlier.

thank you
InstructionTracker.cpp
MyClient.h
InstructionTracker.h
MyClient.cpp
Reply all
Reply to author
Forward
0 new messages