You can list and extract the contents of a DMG file with 7zip - the website is here.
On macOS, 7zip can be installed with homebrew using:
brew install p7zip
Then if you have a DMG file, you can list the contents with:
7z l SomeDisk.dmg
Sample Output
7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=utf8,Utf16=on,HugeFiles=on,64 bits,8 CPUs x64)
...
...
Modified = 2018-01-14 13:28:17
Date Time Attr Size Compressed Name
------------------- ----- ------------ ------------ ------------------------
2018-01-14 13:28:16 D.... MyFunkyDMG
2018-01-14 13:28:16 D.... MyFunkyDMG/.HFS+ Private Directory Data
2018-01-14 13:28:17 ..... 524288 524288 MyFunkyDMG/.journal
2018-01-14 13:28:16 ..... 4096 4096 MyFunkyDMG/.journal_info_block
2017-08-27 13:50:45 ..... 255 4096 MyFunkyDMG/client.py
2017-08-27 13:49:22 ..... 356 4096 MyFunkyDMG/server.py
2018-01-14 13:28:16 D.... MyFunkyDMG/[HFS+ Private Data]
------------------- ----- ------------ ------------ ------------------------
2018-01-14 13:28:17 528995 536576 4 files, 3 folders
Then you can extract, say to a new directory called FRED
with:
7z x -oFRED SomeDisk.dmg
A benefit of using 7zip is that the disk doesn't suddenly flash up on your Desktop as being mounted.