Figuring out an offset in assembly with OllyDBG <p>Relevant assembly:</p> <pre><code>$ &gt; 94D3A705 PUSH hw.05A7D394 ; ASCII "glBegin" $+5 &gt; E8 99C80500 CALL &lt;JMP.&amp;SDL2.SDL_GL_GetProcAddress&gt; $+A &gt; 83C4 04 ADD ESP,4 $+D &gt; A3 04E03B06 MOV DWORD PTR DS:[63BE004],EAX $+12 &gt; 8B0D 04E03B06 MOV ECX,DWORD PTR DS:[63BE004] ; OPENGL32.glBegin $+18 &gt; 890D 38E83B06 MOV DWORD PTR DS:[63BE838],ECX </code></pre> <p>The first line pushes a string address onto stack as function argument. And the last line copy's value from ECX to this DWORD data object. This address is my target. I want to replace the containing DWORD value.</p> <p>In my C++ code I first obtain the address for the first line's push function and then I add an offset. By adding the offset 0x1A the code works, but when I try adding + 0x18 then it doesn't work.</p> <p>I don't fancy testing this for every function, what is the underlying idea that I'm missing?</p>