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

Access violation #2

Open
ghost opened this issue May 17, 2017 · 0 comments
Open

Access violation #2

ghost opened this issue May 17, 2017 · 0 comments

Comments

@ghost
Copy link

ghost commented May 17, 2017

it seems that not perfect for win32 inline hook by pass zero to edx,like this
// ; release : 1.6 - 02-23-09 - thanks to Zool@nder for bugfix on 'pop ds'
// ; release : 1.5 - 01-14-09
// ; release : 1.4 - 09-02-08
// ; thanks to Av0id , cyberbob and lena151 for their remarks and advices
// ;
// ; Syntax to disassemble 32 bits target:
// ; mov edx, 0
// ; mov rcx, Address2Disasm
// ; call LDE
// ;
// ; Syntax to disassemble 64 bits target:
// ; mov edx, 64
// ; mov rcx, Address2Disasm
// ; call LDE
ULONG GetPatchSize(PUCHAR Address)
{
ULONG LenCount = 0, Len = 0;
while (LenCount <= 14) //at least 15 bytes
{
#ifdef _WIN64
Len = LDE(Address, 64);
#else
Len = LDE(Address, 0);
#endif
Address = Address + Len;
LenCount = LenCount + Len;
}
return LenCount;
}

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

0 participants