I recently upgraded a C# project to Visual Studio 2010 and .NET Framework 4.0. I'm seeing bizarre behaviour where a mov instruction in the disassembly appears to be writing the value to the wrong location.
The project is running in debug compiled for Any CPU.
The static class variable is a boolean and is declared as follows:
static bool bAreEnvironmentVariablesAlreadyInitialized = false;
00000000 sub rsp,28h
00000004 mov rax,7FF00184528h
0000000e mov eax,dword ptr [rax]
00000010 test eax,eax
00000012 je 0000000000000019
00000014 call FFFFFFFFEBC1A450
00000019 mov byte ptr [00013B50h],0
The function does a test to see if the variable is initialised and if not executes code and sets it to true.
The beginning of the if condition looks like:
00000000 mov dword ptr [rsp+8],ecx
00000004 push rbx
00000005 sub rsp,1
View Complete Post