dialog box:
The dialog box is divided into two categories: the modal dialog and the modeless dialog box, modal dialogs and modeless dialogs, as well as call modes and non-modal
Modal dialogs do not allow users to switch between different windows, and a modal dialog allows users to switch between different windows.
The difference between the two is that the modal dialog box is built into a message loop by Windows, while the non-modal dialog message is dispatched through a message loop in the user program.
Creating modal dialogs is implemented by calling the Dialogboxparam function, while creating a non-modal dialog box is called the Creatdialogparam function implementation
Program:
Click SETUP. EXE for installation
Follow the default steps to install
This is the main interface
Click File--Register is the place for registering
Close Program
It pops up the dialog box, which is the modal dialog box
If you press exit directly, the Help document is displayed
Only Click I will Register Soon to exit the program
Loading the program with Exescope
Select Resource, dialog box, 103, is the program to exit the dialog box
103 Lptemplatename dialog box template under MFC
Reverse:
Loading the program with OD
Right-click Find All Commands
Find hex for push 0x67,67 103
When the modal dialog box is called, it dialogboxparam its arguments, and 103 is its first parameter.
Double-click and come to its location
The next breakpoint at the beginning of the code block
Run the program.
Click to exit the program, no popup dialog box, directly stop at the breakpoint
If function A calls function B, function A is pushed into the stack, and when function B is returned to function A, the function A is pushed out of the stack by the pop.
Take a look at the stack window
Back to 004023c0 from 00401220
Right-click the Disassembly window to follow
came to the address of the
That call on the top calls just the process.
There is a jnz jump instruction, if EAX is a non-0 value, it will jump, jump will be able to skip the call command
The next breakpoint at the call command above the test command
Run the program again.
Click the Close Program button and then stop at the breakpoint
Press F7 to step into
Only a few instructions after the execution of the RETN, there is no conditional jump, the program may run directly here to check whether to register
The next breakpoint at the beginning of the process
Run the program again.
Once the program is opened, it stops at the breakpoint, indicating that the procedure is to check whether to register
If the procedure returns a value other than 0, the last dialog box of the program is skipped
Next, modify the instructions.
If the modification changes the above instruction to mov eax, 0x1 will overwrite the subsequent instruction.
So the two of the EAX value has an effect on the instructions to modify, instead of mov eax, 0x1
Select these two lines of instruction, right-click assembly, make Changes
After the change, save the program, run
The Register button is no longer clickable, and there is no dialog box when exiting the program.
OD Experiment (16)-Starting from a dialog box to reverse the program