关于CE的一个问题
程序代码:
int main() { int gold = 1000; char* p = (char*)&gold; char* mem[4]{}; mem[0] = new char; mem[1] = new char; mem[2] = new char; mem[3] = new char; mem[0][0] = p[3]; mem[1][0] = p[0]; mem[2][0] = p[2]; mem[3][0] = p[1]; int val = 0; char* p1 = (char*)&val; p1[0] = mem[1][0]; p1[1] = mem[3][0]; p1[2] = mem[2][0]; p1[3] = mem[0][0]; gold=val; while (1) { std::cout << "gold的数量为===>" << gold; system("pause"); gold += 100; } system("pause"); }
今天做了一个实验,不想让别人用CE搜到gold的值,像上面这样写,可以吗?