uintptr_t safemem_remote_addr(pid_data& pdata, void* local_ptr) { if(!pdata.safe_mem_base) { return 0; } return pdata.safe_mem_base + (reinterpret_cast<const char*>(local_ptr) - safe_mem_allocator.address()); }
bool safemem_map_unwritable() { if(munmap(const_cast<void*>(reinterpret_cast<const void*>( safe_mem_allocator.address())), safe_mem_allocator.size())) { return false; } safe_mem_allocator.reset(NULL, 0); return true; }