32 inline HANDLE handle()
const {
return _handle; }
35 ErrorCode initialize(ProcessId pid, uint32_t flags)
override;
38 ErrorCode writeDebugBreakCode(uint64_t address);
41 ErrorCode detach()
override;
42 ErrorCode interrupt()
override;
43 ErrorCode terminate()
override;
44 bool isAlive()
const override;
47 ErrorCode readString(
Address const &address, std::string &str,
size_t length,
48 size_t *nread =
nullptr)
override;
49 ErrorCode readMemory(
Address const &address,
void *data,
size_t length,
50 size_t *nread =
nullptr)
override;
51 ErrorCode writeMemory(
Address const &address,
void const *data,
size_t length,
52 size_t *nwritten =
nullptr)
override;
55 ErrorCode makeMemoryWritable(
Address const &address,
size_t length,
56 std::vector<MemoryRegionInfo> &modifiedRegions);
58 restoreRegionsProtection(
const std::vector<MemoryRegionInfo> ®ions);
61 DWORD convertMemoryProtectionToWindows(uint32_t protection)
const;
62 uint32_t convertMemoryProtectionFromWindows(DWORD winProtection)
const;
65 ErrorCode getMemoryRegionInfo(
Address const &address,
69 ErrorCode updateInfo()
override;
72 ErrorCode allocateMemory(
size_t size, uint32_t protection,
73 uint64_t *address)
override;
74 ErrorCode deallocateMemory(uint64_t address,
size_t size)
override;
77 ErrorCode wait()
override;
81 static Target::Process *Attach(ProcessId pid);
84 ErrorCode enumerateSharedLibraries(