Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I find a bug in Mhook 2.4 #10

Open
flylinfan opened this issue Jun 4, 2015 · 1 comment
Open

I find a bug in Mhook 2.4 #10

flylinfan opened this issue Jun 4, 2015 · 1 comment

Comments

@flylinfan
Copy link

The follow statement will cause crash when allocate the second block trampoline area in win7 x64.
// last entry points to the current head of the free list
pRetVal[trampolineCount - 1].pNextTrampoline = g_pFreeList;
in mhook.cpp BlockAlloc function.This statement repeat use the first trampoline in the first block.

@wbenny
Copy link

wbenny commented Sep 1, 2015

Fix for anyone who stumbles upon the same problem:

// last entry points to the current head of the free list
pRetVal[trampolineCount - 1].pNextTrampoline = g_pFreeList;

+if (g_pFreeList) {
+   g_pFreeList->pPrevTrampoline = &pRetVal[trampolineCount - 1];
+}

poizan42 added a commit to poizan42/mhook that referenced this issue Feb 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants