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

x86架构中hook函数崩溃 #255

Open
lbwengineer opened this issue Feb 2, 2024 · 1 comment
Open

x86架构中hook函数崩溃 #255

lbwengineer opened this issue Feb 2, 2024 · 1 comment

Comments

@lbwengineer
Copy link

函数反汇编代码如下:
LOAD:0601D698 push ebx
LOAD:0601D699 push esi
LOAD:0601D69A push eax
LOAD:0601D69B call $+5
LOAD:0601D6A0 pop ebx
LOAD:0601D6A1 add ebx, (offset qword_9B277AC - offset loc_601D6A0)
LOAD:0601D6A7 mov esi, [esp+0Ch+arg_0]
dobby里,一个jmp指令占5个字节,所以call $+5指令被覆盖了,然后保存的时候转换指令错误。
call $+5和pop ebx这两行指令应该作为一起使用的目的是为了获取0601D6A0这个地址,然后用这个地址获取相对偏移量的常量,dobby只是简单的转换了call $+5这行指令但是没有结合pop ebx的意义一起考虑,导致获取到的ebx值不正确

@lbwengineer
Copy link
Author

我非常想吐槽一下,dobby用来做inline hook实在是有点多问题,我的一个线上项目使用了dobby的DobbyHook经常出现莫名其妙的卡死问题,还定位不到问题

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

1 participant