Unknown value scanning and modification of CE modifier learning history

1. Preparation of C language program

According to the rhythm of the last blog post, we know that the number to be scanned and modified is an integer of 4 bytes, and the value of the number can be checked at any time in the program. This time we learn another situation, we always I don’t know what the value is at first, but I know how it will change. In this case, how can we accurately find it and modify it through the CE modifier?

Our C language program code is as follows

#include<stdio.h>
#include<time.h>
#include<stdlib.h> 

int main()
{
	//初始化种子,避免程序每次运行结果都是一样的 
	srand(time(NULL));
	
	//生成number在1000到1999之间 
	int number=rand()%1000+1000; 
	
	//数字的改变 
	int change=0;
	
	while(1)
	{
		system("cls");
		printf("number=?,change=%d,按q退出\n",change);
		char ch=getch();
		if(ch=='q')
		{
			break;
		}
		else
		{
			//改变值随机变为-50到50之间 
			change=rand()%101-50;
			number+=change; 
		}
	}
	
	printf("number=%d\n",number); 
	
	return 0;
}

The result of the operation is as follows

It can be seen that we don't know the value of the number, but we know how much it changes each time. Let's enter this new wave of learning.

2. Open the CE modifier

We open CE and click on our program process

Scan type changed to unknown initial value

Because the numbers written in my program are integers, the value type is still 4 bytes

We click on the first scan

The scan results show that there are more than 100,000 possibilities, which scares me to death

Let's go back to the program we wrote and click the Enter key to change the value

It changes 8, we are in CE modifier

Change the value column to 8

Scan type changed to value increased

Then click scan again

 The result is as follows

 It can be seen that the possible number has decreased sharply, and we press Enter again in the C language program

The number is reduced by 27 and we are back to CE

Value column changed to 27

Scan type changed to value reduced

then scan again

 now only one left

Double click to add it to the record bar

Double-click 1399 under the value in the record column, modify the number to 9999, and press Enter to confirm

Finally, let us return to the C language program, enter the q key to exit the change, and check whether we have completed the modification!

As you can see, we have accurately completed the task of scanning and modifying. It is awesome. You have mastered the skills of scanning and modifying unknown values. You can also explore other options in unknown values.

3. Conclusion

This year also takes the integer 4 bytes as an example, and you can understand other types of data by analogy. I believe that based on your self-learning ability, these are all matters of sprinkling water. Let us work hard to make progress together, and strive to hit the invincible hand of Clicking as soon as possible!

Guess you like

Origin blog.csdn.net/qq_36694133/article/details/127255763