vmi_read_addr_* is only meaningful if the width of the addr is known. The existing setup always fell back on 32-bit addr width when the page mode is unknown, thus breaking file-mode on 64-bit memory dumps. This patch fixes this issue by employing heuristics during page mode detection in Windows to check if we have 32-bit or 64-bit addresses.
Introduce generic memory access functions via the access_context_t structure
Reduce code-duplication in read.c
Reduce code-duplication in write.c
Add example of using access_context_t and vmi_get_va_pages
Introduce vmi_write_addr_* functions