MFC42.dll Button Event Summary rule

Source: Internet
Author: User

Read the "MFC Program Reverse-Message Chapter ( top ) + ( bottom )" article, the harvest is quite abundant. The author mentions that for dialog box programs, it is best to set breakpoints at the entrance of this function function ( Remember this function:ccmdtarget::oncmdmsg ()). In the process of learning, some of the use of OD further deepened the understanding.

First, using VC6.0 to establish a dialog-based MFC program, respectively, using dynamic link ( TraceButtonDynamic.exe) and Static link (TraceButtonStatic.exe) generation.

1. Program Analysis of Dynamic linkage

(1) First use IDA to find the address of ccmdtarget::oncmdmsg (). It is 0040157C in My Computer .

(2) load with OD ,ctrl+g, enter 0040157C, come to 0040157C.

You can see that there is a jmp statement,enter entered. Here is the entrance to ONCMDMSG () .

Down-tipped push DWORD ptr [eax+14], F2 down, run program.

Click the "hello,world" button to see 00401480, which is what the button is dealing with.

Ctrl+g, enter 00401480, come to 00401480. OK, get it done.

(3) a simpler approach.

Re-load the TraceButtonDynamic.exe. ALT + E, load the DLL module and double-click MFC42.

7

Come to MFC42.dll

Ctrl+s, input

Push DWORD ptr [EBP+14]

Push DWORD ptr [EAX+10]

Push DWORD ptr [EBP+10]

Push DWORD ptr [EAX+14]

Push DWORD ptr [Ebp+c]

Push DWORD ptr [EBP+8]

Click Find.

In the "Push DWORD ptr [eax+14]", the F2 can be broken down

2. Statically linked program analysis.

Od Loading. ctrl+s, enter the sequence of instructions.

Click Find, in "Push DWORD ptr [eax+14]", F2 down.

Of course, you can also F7 into the call at the bottom of the statement sequence ( This example is call 004157f5). After entering, the statement directly in the "call DWORD ptr [EBP+14]" is broken. Of course you can use the search method.

These are some of my learning experience , inappropriate, please correct me.

2000-09-17

by Littlewisp

MFC42.dll Button Event Summary rule

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.