在 Windows 中记录系统调用

发布于 2024-10-17 03:12:14 字数 722 浏览 4 评论 0原文

我一直在寻找在 Windows 上实时获取系统调用的方法一段时间。我在 stackoverflow 和其他地方查看了几篇文章,但找不到任何足够简单的内容让我可以遵循。我看过 procmon 但它的输出相当不稳定。两个系统上的相同二进制文件生成了不同数量的条目。也许我缺乏做这些事情的先决知识。欢迎任何帮助/建议。

我之前看过这些链接:

问候

I have been searching for some time now on ways to get syscalls in realtime on windows. I have looked at couple of posts here at stackoverflow and elsewhere but could not find anything easy enough that I could follow. I have looked at procmon but its output has been pretty unstable. Same binary on two systems has generated different number of entries. Perhaps I lack the pre-requisite knowledge to do such stuff. Any help/recommendation is welcome.

I have looked at these link before:

Regards

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

盗梦空间 2024-10-24 03:12:14

根据您使用的 Windows 版本,您的问题的答案可能是 Windows 事件跟踪 (ETW),它可以进行系统调用日志记录 [链接]

Depending on the version of Windows you are using, the answer to your question is probably Event Tracing for Windows (ETW) which can do syscall logging [link]

糖粟与秋泊 2024-10-24 03:12:14

如果您对采样方法感到满意,那么您可以尝试以下方法:

typedef struct _THREAD_LAST_SYSCALL_INFORMATION
{
    PVOID FirstArgument;
    USHORT SystemCallNumber;

} THREAD_LAST_SYSCALL_INFORMATION, *PTHREAD_LAST_SYSCALL_INFORMATION;

THREAD_LAST_SYSCALL_INFORMATION lastSystemCall;
NtQueryInformationThread(
    hThread,
    ThreadLastSystemCall,
    &lastSystemCall,
    sizeof(THREAD_LAST_SYSCALL_INFORMATION),
    NULL
);

其中 ThreadLastSystemCall = 21

If You are satisfied with sampling approach then You could try this:

typedef struct _THREAD_LAST_SYSCALL_INFORMATION
{
    PVOID FirstArgument;
    USHORT SystemCallNumber;

} THREAD_LAST_SYSCALL_INFORMATION, *PTHREAD_LAST_SYSCALL_INFORMATION;

THREAD_LAST_SYSCALL_INFORMATION lastSystemCall;
NtQueryInformationThread(
    hThread,
    ThreadLastSystemCall,
    &lastSystemCall,
    sizeof(THREAD_LAST_SYSCALL_INFORMATION),
    NULL
);

where ThreadLastSystemCall = 21

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文