title: OllyDbg 2.01 - Finding a command referencing a static string
body: <p>I've taken up cracking and reverse-engineering recently with the help of OllyDbg 2.01 and crackmes executables.</p>
  
  <p>So in this particular crackme, I was scrolling through the commands and noticed a PUSH with an ASCII string "&amp;File" (it's a menu string) : </p>
  
  <p><img src="https://i.imgur.com/HabSmQm.png" alt="1"></p>
  
  <p>So I thought : "If I can find this information by simply scrolling, surely there must be an automatic way to find a command referencing a particular string".</p>
  
  <p>So I get to the top of the program, hit CTRL+B and search for ASCII "File" to hopefully find it again : </p>
  
  <p><img src="https://i.imgur.com/xTDDEOD.png" alt="2"></p>
  
  <p>After hitting OK, OllyDbg doesn't find the earlier PUSH. Instead, I get this : </p>
  
  <p><img src="https://i.imgur.com/O1sVQ66.png" alt="3"></p>
  
  <p>Mmmh.. Okay, that's not what I expected, but let's see what's in there. so I right click => Follow in Dump, and I get this :</p>
  
  <p><img src="https://i.imgur.com/NgtlEn9.png" alt="4"></p>
  
  <p>So yeah, we found our string in the dump. However, I still haven't found my original PUSH. You can also notice that the string's address is the same as the PUSH's argument (40512C).</p>
  
  <p>As a last try, I right click on the letter at address 40512C, select "Find References", but nope : no reference found.</p>
  
  <p>So TL ; DR question : how do I automatically find a command referencing a string ? Because obviously I'm not gonna scroll the whole command stack everytime I want to find a string.</p>
  
  <p>PS : the string doesn't appear in "referenced text strings" either.</p>
  
  <p>Thanks in advance for your help.</p>
  
  <p>EDIT : okay so I found a solution. I searched the code for "2C 51 40 00" which is the address backward, and i found my PUSH again. It's a bit hacky, anyone with a more efficient solution is welcome to share.</p>