sim: Add debugging ptable to image dumps

Add a `debug_dump()` method to `Images` to allow the images to be
written to a file.  The dependency test will call this if the
environment variable MCUBOOT_DEBUG_DUMP is set.

In order to make these debug dumps more useful, add a simple partition
table to the beginning of the image (where MCUboot would reside on
target).  This has a simple header, and then entries for each partition,
using the partition ids used within the simulator.  This allows the
image to be more easily used by external tools.

As an example, `scripts/mcubin.bt` is a binary template for the [010
Editor](https://www.sweetscape.com/010editor/), allowing it to decode
and show the details of images from MCUboot.

Signed-off-by: David Brown <david.brown@linaro.org>
diff --git a/sim/mcuboot-sys/src/area.rs b/sim/mcuboot-sys/src/area.rs
index 6baf8e0..779157a 100644
--- a/sim/mcuboot-sys/src/area.rs
+++ b/sim/mcuboot-sys/src/area.rs
@@ -136,6 +136,11 @@
 
         areas
     }
+
+    /// Return an iterator over all `FlashArea`s present.
+    pub fn iter_areas(&self) -> impl Iterator<Item = &FlashArea> {
+        self.whole.iter()
+    }
 }
 
 /// The area descriptor, C format.
@@ -189,9 +194,9 @@
 #[repr(C)]
 #[derive(Debug, Clone, Default)]
 pub struct FlashArea {
-    flash_id: FlashId,
-    device_id: u8,
+    pub flash_id: FlashId,
+    pub device_id: u8,
     pad16: u16,
-    off: u32,
-    size: u32,
+    pub off: u32,
+    pub size: u32,
 }