Elementary -- and broken -- implementation of virt-mem capture.
[virt-mem.git] / lib / virt_mem_mmap.mli
index de052a2..594f0cf 100644 (file)
@@ -34,7 +34,7 @@ val set_wordsize : ([`NoWordsize], 'b) t -> Virt_mem_utils.wordsize ->
 (** Set the natural wordsize of the memory map.  This is used
     for matching pointers within the map and can be set only once. *)
 
-val set_endian : ('a, [`NoEndian]) t -> Bitmatch.endian ->
+val set_endian : ('a, [`NoEndian]) t -> Bitstring.endian ->
   ('a, [`Endian]) t
 (** Set the natural endianness of the memory map.  This is used
     for matching pointers within the map and can be set only once. *)
@@ -42,7 +42,7 @@ val set_endian : ('a, [`NoEndian]) t -> Bitmatch.endian ->
 val get_wordsize : ([`Wordsize], 'b) t -> Virt_mem_utils.wordsize
 (** Return the wordsize previously set for this memory map. *)
 
-val get_endian : ('a, [`Endian]) t -> Bitmatch.endian
+val get_endian : ('a, [`Endian]) t -> Bitstring.endian
 (** Return the endianness previously set for this memory map. *)
 
 val of_file : Unix.file_descr -> addr -> ([`NoWordsize], [`NoEndian]) t
@@ -52,6 +52,13 @@ val add_file : ('a, 'b) t -> Unix.file_descr -> addr -> ('a, 'b) t
 (** Add file [fd] at address [addr] to an existing memory map.
     Behaviour is undefined if memory mappings overlap. *)
 
+val of_string : string -> addr -> ([`NoWordsize], [`NoEndian]) t
+(** Create a new memory map, mapping string at address [addr]. *)
+
+val add_string : ('a, 'b) t -> string -> addr -> ('a, 'b) t
+(** Add string at address [addr] to an existing memory map.
+    Behaviour is undefined if memory mappings overlap. *)
+
 val find : ('a, 'b) t -> ?start:addr -> string -> addr option
 (** Find string in a memory map and return its address (if found).
     You can pass an optional starting address.  Any holes in