How to read the BEAM bytecode compiled into memory and that is not on the disk?

It is not possible to do because during loading the original module is destroyed and it is not possible to reverse-load the module from what is loaded. So to implement such functionality we would be to keep the original module which would double the memory usage of the code for each loaded module.

6 Likes