Madhawa Priyashantha
Madhawa Priyashantha

Reputation: 9872

olly debugger cannot find referenced text

I created a very simple c++ console application which compare user entered password with hard-corded one and print corresponding output.

#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;

}

I want to debug and skip a specific line. For that I want to search the correct password / incorrect password line. So I tried using "search for all referenced text " option but the problem is there is no such text.

I followed some tutorials where they search for referenced text and find that kind of hard coded lines.

Upvotes: 0

Views: 959

Answers (1)

Antoine C.
Antoine C.

Reputation: 3952

Well, I tried and it worked for me:

enter image description here

I compiled the code with onlinecompiler.net, which use mingw as far as I know. Here is the link to the executable.

It may be a problem with your compiler, but neither gcc/mingw nor cl.exe are modifying hardcoded strings at compile time.

Also, are you sure that you are doing the search in your program module? (not in the ntdll one for instance)

Upvotes: 1

Related Questions