So I was playing with Olly debugger, sniffing around what I can yet find out about windows and I pressed that M button and it popped up that memory map window. So I googled up some articles on the subject and I found out I can actually write to addresses above 64K which I tried and well.. why would it not work. About those lower 2GB of space:
Why are there those gaps? For example there is 0x10000-0x1FFFF R/Wable space then there is 128K nothing and then some just readable space. I mean this is already paged right, so it should not really matter whether there was something in the past like in the physical space (not mentioning 0x20000-0x40000 should be totaly ok to r/w to anyway), why would someone decide not to use some address space so randomly? Very likely I am just confused because in that memory map from olly debugger a lot of lines are left void where the column says 'Contains'. Is there perhaps some reference I could just put against this memory map from olly and find out what space has what purpose and is thus is or is not paged like this?
Suppose that I really wouldn't screw anything up about memory management, is it OK to write programs for windows using that lower memory instead of using heap or could I encounter some problems?
Thank you for reading this question.
EDIT
Ah here we go with what's at 0x10000 and that's also probably why that page is let writable.
Not all memory is available for use by applications. For example, some types of hardware require memory so the system (BIOS or OS) will allocate a block of physical memory and leave it for the hardware to manage itself. That memory may not be directly readable (or writable) because performing such operations would affect the hardware. The hardware itself may have its own restrictions about what memory ranges it can use.
If you're in Windows, you can't go writing to arbitrary memory locations - the OS won't let you (in usermode at least) and will have paged the memory anyway, so the address you think you're looking at (the virtual address) won't match the actual physical memory address.
In general, you should only read and write to memory that has been requested and allocated to you by the OS.