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

Hook pramm *const this #71

Closed
hoangdung500 opened this issue Jun 18, 2022 · 2 comments
Closed

Hook pramm *const this #71

hoangdung500 opened this issue Jun 18, 2022 · 2 comments

Comments

@hoangdung500
Copy link

Hi
I use centos7
I've been trying to hook 1 week into this function.
void __cdecl XPlayerServer::OnHandshakeRequest(XPlayerServer *const this, int a_1, BYTE *b_1, size_t c){
.................
}
Code of me:
void XPlayerServer_OnHandshakeRequest(void *xlayserver, int nConnIndex, size_t pbyData, size_t uDataLen)
{
((ptrXPS_OHSR)subhook_get_trampoline(hook3))(xlayserver,nConnIndex,pbyData,uDataLen);
}

But *xlayserver seems to be wrong.
The system was standing when the hook was hooked up.
Thank you for your help.

@ba0f3
Copy link

ba0f3 commented Jun 19, 2022

IMO, calling convention of orig function should be __thiscall. And your function should declare like this:

void __thiscall XPlayerServer_OnHandshakeRequest(void *xlayserver, int nConnIndex, size_t pbyData, size_t uDataLen)

@hoangdung500
Copy link
Author

Thank you.
I fix done.

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