olly调试器找不到引用的文本

时间:2015-07-01 16:34:11

标签: c++ reverse-engineering ollydbg

我创建了一个非常简单的c ++控制台应用程序,它将用户输入的密码与硬编码密码进行比较并打印相应的输出。

#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
  string password;
  cout << "Enter the password"<<endl;
  getline (cin, password);

 if(password=="123"){

      cout << "correct password" <<endl;
 }else  {
      cout << "incorrect password" <<endl;
 }
  return 0;

}

我想调试并跳过特定的行。为此,我想搜索correct password / incorrect password行。所以我尝试使用&#34;搜索所有引用的文本&#34;选项,但问题是没有这样的文字。

我按照一些教程搜索引用文本并找到那种硬编码行。

1 个答案:

答案 0 :(得分:1)

好吧,我试过了,它对我有用:

enter image description here

我使用onlinecompiler.net编译代码,据我所知使用mingw。这是link to the executable

这可能是您的编译器的问题,但gcc / mingwcl.exe都没有在编译时修改硬编码字符串。

另外,您确定要在程序模块中进行搜索吗? (例如,不在ntdll中)