Consider this code snippet:


I'm trying to find the code that declares the global variable in Ollydbg.

I can't find where it is.

  • 1
    Please note that you can paste code directly in any StackExchange site, instead of a screenshot from your editor. To add code markup, put 4 spaces at the beginning of each line.
    – glampert
    Commented Dec 16, 2014 at 14:41

1 Answer 1


The C compiler doesn't create any assembly code to declare and initialize global fundamental data types, so you won't see anything like MOV ..., 3 in OllyDbg for your program above.

In the disassembly of your program below, you can see that the global variable is stored at dword_402000, which is hardcoded to begin with a value of 3:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.