So I was messing with an interesting keygenme, written in C++, which derives the key based on the values of the OSINFO structure. Now, when checking for a valid key it uses the following instruction:
CMP EAX, DWORD PTR DS:[key]
My question is: why isn't the key stored in a local variable or something like:[EBP-X]
?
How would I translate it back into C++ so that it stores the key in DS:[key]
rather than in the stack?