-
+int v3_unhook_mem(struct guest_info * info, addr_t guest_addr_start);
void v3_delete_shadow_region(struct guest_info * info, struct v3_shadow_region * reg);
+
+
struct v3_shadow_region * v3_get_shadow_region(struct guest_info * info, addr_t guest_addr);
addr_t v3_get_shadow_addr(struct v3_shadow_region * reg, addr_t guest_addr);
static int pci_init_device(struct vm_device * dev) {
- struct pci_internal * pci_state = (struct pci_internal *)dev->private_data;;
+ struct pci_internal * pci_state = (struct pci_internal *)dev->private_data;
int i = 0;
PrintDebug("pci: init_device\n");
}
+// This will unhook the memory hook registered at start address
+// We do not support unhooking subregions
+int v3_unhook_mem(struct guest_info * info, addr_t guest_addr_start) {
+ struct v3_shadow_region * reg = v3_get_shadow_region(info, guest_addr_start);
+
+ if ((reg->host_type != SHDW_REGION_FULL_HOOK) ||
+ (reg->host_type != SHDW_REGION_WRITE_HOOK)) {
+ PrintError("Trying to unhook a non hooked memory region (addr=%p)\n", (void *)guest_addr_start);
+ return -1;
+ }
+
+ return v3_delete_shadow_region(info, reg);
+}
+
static inline