blue rabbit
blue rabbit

Reputation: 139

Read/write process memory in Julia

Is there any possibility to read and write process memory in Julia? I give example in C# what I mean:

WinAPI.ReadProcessMemory(c_Process.handle, offset, buffer, size, IntPtr.Zero);

Upvotes: 1

Views: 286

Answers (1)

StefanKarpinski
StefanKarpinski

Reputation: 33259

You can create an arbitrary pointer and read or write through it, but it's not recommended to program this way. Here's a short program to segfault Julia:

julia> p = reinterpret(Ptr{Int}, 0)
Ptr{Int64} @0x0000000000000000

julia> unsafe_store!(p, 123)

signal (11): Segmentation fault: 11

Upvotes: 1

Related Questions