throw exit code 0xC0000005 when using easyhook in python

We Are Going To Discuss About throw exit code 0xC0000005 when using easyhook in python. So lets Start this Python Article.

throw exit code 0xC0000005 when using easyhook in python

  1. How to solve throw exit code 0xC0000005 when using easyhook in python

    According to [GitHub]: EasyHook/EasyHook – (master) EasyHook/Public/easyhook.h:
    typedef struct _HOOK_TRACE_INFO_ { PLOCAL_HOOK_INFO Link; }HOOK_TRACE_INFO, *TRACED_HOOK_HANDLE;
    TRACED_HOOK_HANDLE is actually a pointer (although its name suggests the opposite), therefore your lh_install_hook.argtypes (1st snippet) is incorrect. It should be:
    lh_install_hook.argtypes = [c_void_p, c_void_p, c_void_p, POINTER(TRACED_HOOK_HANDLE)]
    Technically, you ran into [SO]: C function called from Python via ctypes returns incorrect value (@CristiFati's answer).
    Regarding no exception being thrown, maybe [SO]: Python exception thrown by libtidy is amusingly impossible to catch (@CristiFati's answer) should shed some light.
    This should get past the problem, at least the main one. I'm not sure whether there are others, as I didn't install (or build) the .lib, so I didn't run your code.
    My knowledge is very limited (so this might be complete nonsense), but one potential spot to generate problems is TRACED_HOOK_HANDLE->Link being initialized to NULL.

  2. throw exit code 0xC0000005 when using easyhook in python

    According to [GitHub]: EasyHook/EasyHook – (master) EasyHook/Public/easyhook.h:
    typedef struct _HOOK_TRACE_INFO_ { PLOCAL_HOOK_INFO Link; }HOOK_TRACE_INFO, *TRACED_HOOK_HANDLE;
    TRACED_HOOK_HANDLE is actually a pointer (although its name suggests the opposite), therefore your lh_install_hook.argtypes (1st snippet) is incorrect. It should be:
    lh_install_hook.argtypes = [c_void_p, c_void_p, c_void_p, POINTER(TRACED_HOOK_HANDLE)]
    Technically, you ran into [SO]: C function called from Python via ctypes returns incorrect value (@CristiFati's answer).
    Regarding no exception being thrown, maybe [SO]: Python exception thrown by libtidy is amusingly impossible to catch (@CristiFati's answer) should shed some light.
    This should get past the problem, at least the main one. I'm not sure whether there are others, as I didn't install (or build) the .lib, so I didn't run your code.
    My knowledge is very limited (so this might be complete nonsense), but one potential spot to generate problems is TRACED_HOOK_HANDLE->Link being initialized to NULL.

Solution 1

According to [GitHub]: EasyHook/EasyHook – (master) EasyHook/Public/easyhook.h:

typedef struct _HOOK_TRACE_INFO_
{
    PLOCAL_HOOK_INFO        Link;
}HOOK_TRACE_INFO, *TRACED_HOOK_HANDLE;

TRACED_HOOK_HANDLE is actually a pointer (although its name suggests the opposite), therefore your lh_install_hook.argtypes (1st snippet) is incorrect. It should be:

lh_install_hook.argtypes = [c_void_p, c_void_p, c_void_p, POINTER(TRACED_HOOK_HANDLE)]

Technically, you ran into [SO]: C function called from Python via ctypes returns incorrect value (@CristiFati’s answer).

Regarding no exception being thrown, maybe [SO]: Python exception thrown by libtidy is amusingly impossible to catch (@CristiFati’s answer) should shed some light.

This should get past the problem, at least the main one. I’m not sure whether there are others, as I didn’t install (or build) the .lib, so I didn’t run your code.
My knowledge is very limited (so this might be complete nonsense), but one potential spot to generate problems is TRACED_HOOK_HANDLE->Link being initialized to NULL.

Original Author CristiFati Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

ittutorial team

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment