gpt4 book ai didi

visual-studio - 用于分析的自定义 prolog/epilog 函数

转载 作者:行者123 更新时间:2023-12-04 05:37:28 24 4
gpt4 key购买 nike

是否可以使用 Visual Studio 编译器编写 2 个在调用其他函数之前和函数执行之后被调用的函数?在 gcc 中,你可以用 __cyg_profile_func_*() 做到这一点职能:

void __cyg_profile_func_enter(void *func_address, void *call_site )
__attribute__ ((no_instrument_function));

void __cyg_profile_func_exit (void *func_address, void *call_site )
__attribute__ ((no_instrument_function));

我需要一个适用于内核模式软件的解决方案。我想 Microsoft Detours可能会有所帮助,但免费版只有 32 位,而我的驱动程序是纯 64 位的。

我想生成 call graph为具体代码。

谢谢。

最佳答案

  • 您可以使用 /Gh /GH切换 cl 以创建 penter/pexit Hook 。
  • 对于免费 Hook API,请查看:
    2.1 easyhook
    2.2 N-CodeHook
  • 关于visual-studio - 用于分析的自定义 prolog/epilog 函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/949556/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com