首页 > DUI > DUI–thunk消息分发
2014八月4

DUI–thunk消息分发

thunk消息分发是DUI消息分发的基础,其流程图如下:

blob.png

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
版权所有 © 转载时必须以链接形式注明作者和原始出处!

11 Responses to “DUI–thunk消息分发”

  1. #1 hidroesgoto.pt 回复 | 引用 Post:2020-05-10 11:35

    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!

  2. #2 spoon shop 回复 | 引用 Post:2020-05-14 01:05

    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!

  3. #3 free xbox codes 回复 | 引用 Post:2020-06-07 04:47

    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.

  4. 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.

  5. #5 hack summoners war 回复 | 引用 Post:2020-06-08 13:15

    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.

  6. #6 hack mafia city 回复 | 引用 Post:2020-06-08 15:49

    Wow, this article is fastidious, my sister is analyzing such things,
    thus I am going to let know her.

  7. 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!!

  8. #8 g this 回复 | 引用 Post:2020-06-10 19:37

    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!

  9. #9 she g 回复 | 引用 Post:2020-06-11 13:45

    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.

  10. #10 g make 回复 | 引用 Post:2020-06-11 23:52

    Very descriptive article, I enjoyed that bit. Will there be a part 2?

  11. #11 how to hack afk arena 回复 | 引用 Post:2020-06-14 10:13

    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.

发表评论