[Anti-static analysis] String dynamic assignment

Code:

#include <iostream>
#include <Windows.h>

using namespace std;

int main()
{
    
    
	string s1 = "qwedsazxc";
	string s2;
	s2 += 'q';
	s2 += 'a';
	s2 += 'z';
	s2 += 'x';
	s2 += 's';
	s2 += 'w';
	s2 += 'e';
	s2 += 'd';
	s2 += 'c';

	cout << "finished." << endl;
	getchar();
end:

	getchar();
	return 0;
}

Ctrl+B Search for strings "qwedsazxc" and "qazxswedc" in IDA: It
Insert picture description here
Insert picture description here
means that dynamically assigning values ​​to string can prevent static analysis


Use ce to search for "qwedsazxc" and "qazxswedc":
Insert picture description here

Can be found, indicating that this method cannot prevent dynamic analysis.

Guess you like

Origin blog.csdn.net/Simon798/article/details/109539156