# Interface: com.pnfsoftware.jeb.core.units.code.asm.memory.IVirtualMemoryShim

A `shim` is a VM object wrapping another virtual memory, in order to allow temporary write modifications.

## Method: commitChanges
- parameter: `allowPageReplacement`, type: `boolean`
- parameter: `allowPageCreation`, type: `boolean`
- parameter: `allowPageRemoval`, type: `boolean`
- return type: `int`

Description: Commit the modifications onto the underlying VM. Memory writes, page allocations and deletions will be applied to the wrapped virtual memory object.
parameter: allowPageReplacement: true to allow replacement of existing pages
parameter: allowPageCreation: true to allow creation of new pages
parameter: allowPageRemoval: true to allow page removal
return: the numbers of pages committed

## Method: commitChanges
- return type: `int`

Description: Commit the modifications onto the underlying VM. Memory writes, page allocations and deletions will be applied to the wrapped virtual memory object.
return: the numbers of pages committed

## Method: duplicate
- return type: `com.pnfsoftware.jeb.core.units.code.asm.memory.IVirtualMemoryShim`


## Method: duplicate
- parameter: `fullDuplication`, type: `boolean`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.memory.IVirtualMemory`

Description: Duplicate with options.
parameter: fullDuplication: if false, duplicate the shim only \(same as [#duplicate()](#duplicate())\);            else, a full non\-shim VM is created, no longer dependent on some underlying VM
return: a duplicated VM

## Method: getChanges
- parameter: `collectWrittenPages`, type: `boolean`
- parameter: `collectCreatedPages`, type: `boolean`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.memory.MemoryChanges`

Description: Collect the changes made between the original memory and the current shim state.
parameter: collectWrittenPages: true to collect pages that already existed and were modified
parameter: collectCreatedPages: true to collect pages that did not exist and were created
return: a diff

## Method: getChanges
- return type: `com.pnfsoftware.jeb.core.units.code.asm.memory.MemoryChanges`

Description: Collect the changes made between the original memory and the current shim state.
return: a diff

## Method: getUnderlyingMemory
- return type: `com.pnfsoftware.jeb.core.units.code.asm.memory.IVirtualMemory`

Description: Retrieve the underlying VM wrapped by the shim.
return: underlying virtual memory

