title: How do you find a functions virtual call address in assembly?
body: <p>I've googled around but i'm not sure i am asking the right question or not and i couldn't find much regardless, perhaps a link would  be helpful.</p>
  
  <p>I made a c++ program that shows a message box, then I opened it up with Ollydbg and went to the part where it calls MessageBoxW.</p>
  
  <p>The call address of MessageBoxW changes each time i run the app as windows is updating my Imports table to have the correct address of MessageBoxW. So my question is how do i find the virtual addres of MessageBoxW to my imports table and also how can i use this in ollydbg?</p>
  
  <p>Basically I'm trying to make a code cave in assembly to call MessageBoxW again. 
  I got fairly close once by searching the executable with a hex editor and found the position of the call, and I think I found the virtual address. But when i call that virtual address in olly and saved it to the executable, the next time i opened it the call was replaced with a bunch of <code>DB xyz</code> (which looked like the virtual address but why did the <code>call</code> get removed?</p>
  
  <p>Sorry if my terminology is off as i'm new to this so i'm not quite sure what to call things.</p>