2014八月4
DUI–thunk消息分发
thunk消息分发是DUI消息分发的基础,其流程图如下:
trunk的最终结果是把原始的hWnd换成了处理类的this指针,其实就是hook并改变了消息处理函数,所以要在窗口创建的第一时间实现hook
贴一下关键代码:
void Init(DWORD_PTR proc, void* pThis) { m_mov = 0x042444C7;// C7 44 24 0C m_this = PtrToUlong(pThis); // mov [esp+4], pThis;而esp+4本来是放hWnd,现在被偷着放对象指针了. m_jmp = 0xe9; m_relproc = (DWORD)((INT_PTR)proc - ((INT_PTR)this + sizeof(DMMsgThunk))); // write block from data cache and // flush from instruction cache FlushInstructionCache(GetCurrentProcess(), this, sizeof(DMMsgThunk)); }
m_pThunk->Init(proc, pThis); WNDPROC pProc = (WNDPROC)m_pThunk->GetCodeAddress();// 得到Thunk指针
文章作者:hgy413
本文地址:https://hgy413.com/1624.html
版权所有 © 转载时必须以链接形式注明作者和原始出处!
I like the valuable information you provide on your articles.
I will bookmark your weblog and test once more here regularly.
I am fairly certain I’ll learn a lot of new stuff proper
right here! Good luck for the following!
It is perfect time to make some plans for the long run and it is time to be happy.
I have learn this publish and if I could I wish to suggest you some attention-grabbing issues or suggestions.
Maybe you can write next articles relating to this article.
I desire to read even more things approximately it!
It’s really a nice and helpful piece of info. I am satisfied
that you just shared this helpful info with us.
Please keep us informed like this. Thanks for sharing.
Pretty section of content. I just stumbled upon your web site and
in accession capital to assert that I acquire actually enjoyed account your blog posts.
Any way I will be subscribing to your feeds and even I achievement you access consistently fast.
Nice post. I learn something totally new and challenging on blogs
I stumbleupon every day. It’s always helpful to read content from other authors and practice a little something from their web sites.
Wow, this article is fastidious, my sister is analyzing such things,
thus I am going to let know her.
Hi, i think that i saw you visited my weblog so i came to “return the favor”.I am trying to find things to enhance
my web site!I suppose its ok to use a few of your ideas!!
Hello there, just became aware of your blog through Google, and found that
it is truly informative. I’m going to watch out for brussels.
I’ll appreciate if you continue this in future. Numerous people will be benefited from your writing.
Cheers!
We are a group of volunteers and opening a new scheme in our community.
Your site offered us with valuable information to
work on. You have done a formidable job and our
whole community will be thankful to you.
Very descriptive article, I enjoyed that bit. Will there be a part 2?
I blog often and I genuinely thank you for your content.
Your article has really peaked my interest. I’m going to bookmark your website and keep checking for
new details about once a week. I opted in for your Feed as well.