This function has the name viewmemory. In fact, this is an enhanced version of the viewstack function found at this website.
This function can be called from source code written in C, C++, or X86. The caller function must pass to viewmemory the address in memory that the caller wishes to view. The full directions will be found in the comments of the viewmemory.asm file.
If you need to read and analyze executable code in memory this may be the tool you need. Download the files below and test the program for yourself.