Module: MemoryIO
- Defined in:
- lib/memory_io.rb,
lib/memory_io/io.rb,
lib/memory_io/util.rb,
lib/memory_io/error.rb,
lib/memory_io/logger.rb,
lib/memory_io/stream.rb,
lib/memory_io/context.rb,
lib/memory_io/process.rb,
lib/memory_io/version.rb,
lib/memory_io/types/type.rb,
lib/memory_io/types/types.rb,
lib/memory_io/types/record.rb,
lib/memory_io/types/cpp/string.rb,
lib/memory_io/types/clang/c_str.rb,
lib/memory_io/types/basic/number.rb
Overview
MemoryIO - Read/Write structures in memory.
Defined Under Namespace
Modules: Types, Util Classes: Context, Error, IO, InvalidAddressError, Process, ProcessNotFoundError, Stream, ValueOutOfRangeError
Constant Summary collapse
- FORMATTER =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Keeps a message readable when it is shown to a human.
proc { |severity, _datetime, progname, msg| "[#{progname}] #{severity}: #{msg}\n" }
- VERSION =
Current gem version.
'1.0.0'
Class Attribute Summary collapse
-
.logger ⇒ Logger
Diagnostics that are worth surfacing but don't stop the operation are written here, so they can be silenced or redirected.
Class Method Summary collapse
-
.attach(pid, endian: nil, pointer_size: nil) ⇒ MemoryIO::Process
Get a process by process id.
Class Attribute Details
.logger ⇒ Logger
Diagnostics that are worth surfacing but don't stop the operation are written here, so they can be silenced or redirected.
18 19 20 |
# File 'lib/memory_io/logger.rb', line 18 def logger @logger ||= ::Logger.new($stderr, progname: 'memory_io', formatter: FORMATTER) end |
Class Method Details
.attach(pid, endian: nil, pointer_size: nil) ⇒ MemoryIO::Process
The context is read from /proc/[pid]/exe, which names the interpreter
when the process was started through one. Pass endian and
pointer_size for such a process, whose context may differ from
the interpreter running it.
Get a process by process id.
40 41 42 |
# File 'lib/memory_io.rb', line 40 def attach(pid, endian: nil, pointer_size: nil) MemoryIO::Process.new(pid, endian: endian, pointer_size: pointer_size) end |