title: Asm to C++ with DLL Injection
body: <p>I made a console to test for IsDebuggerPresent and i am trying to change its output.
  Memory region before DLL was injected : <a href="http://imageshack.us/photo/my-images/842/hso7.jpg/" rel="nofollow">http://imageshack.us/photo/my-images/842/hso7.jpg/</a>
  Memory region after DLL was injected : <a href="http://imageshack.us/photo/my-images/59/i1jw.jpg/" rel="nofollow">http://imageshack.us/photo/my-images/59/i1jw.jpg/</a></p>
  
  <p>I wish to change the address at 004116D5(selected gray address) from JE 004116DE to JNZ/JNE 004116DE using C++.</p>
  
  <pre><code>DWORD asmAddy = 0x004116D5;    
  #define Naked __declspec(naked)
  Naked void changeasm()
  {
  _asm
  {
  jnz 0x004116DE
  }
  }
  </code></pre>
  
  <p>under DllMain , i used Microsoft Detours 1.5</p>
  
  <pre><code>DetourFunction((PBYTE)asmAddy,(PBYTE)changeasm);
  </code></pre>
  
  <p>in the after image, it seems like it jumps to a memory of the injected dll.Can someone help me with this?I have changed the opcode using OllyDbg and it works fine.</p>