Value of pointer different from what it is assigned to
<p>I have two empty functions called TestFunc and TestFunc2, and I assigned their addresses to two variables.</p>

<pre><code>void TestFunc()
{
}

__declspec(naked) void TestFunc2()
{
}

int main()
{
DWORD* test = (DWORD*)TestFunc;
DWORD* test2 = (DWORD*)TestFunc2;

printf("TestFunc is %p at test is %p\n", TestFunc, test);
printf("TestFunc2 is %p at test2 is %p\n", TestFunc2, test2);
getchar();
}
</code></pre>

<p>After assignment, the value of the two variables actually differ from what they are assigned.</p>

<p>However, in a printf statement, the output shows that they are the same. Any ideas why is this happening?</p>

<p><a href="https://i.stack.imgur.com/Cz3QB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Cz3QB.png" alt="Picture"></a></p>