class
Cradare2::DSL::Memory
- Cradare2::DSL::Memory
- Reference
- Object
Overview
DSL for memory inspection, reading, writing, and byte pattern searching.
Defined in:
cradare2/dsl/memory.crConstructors
Instance Method Summary
-
#hexdump(address : UInt64 | String | Nil = nil, size : Int32 = 64) : String
Returns formatted hexdump text for human inspection.
-
#read(address : UInt64 | String, size : Int32) : Bytes
Reads raw bytes from address as a Crystal
Bytesslice. -
#read_bytes(address : UInt64 | String, size : Int32) : Bytes
Alias for
#read. -
#read_f32(address : UInt64 | String) : Float32
Reads floating-point numbers.
- #read_f64(address : UInt64 | String) : Float64
-
#read_hex(address : UInt64 | String, size : Int32) : String
Reads bytes formatted as a continuous hex string.
- #read_i16(address : UInt64 | String) : Int16
- #read_i32(address : UInt64 | String) : Int32
- #read_i64(address : UInt64 | String) : Int64
-
#read_i8(address : UInt64 | String) : Int8
Reads signed integers of various bit widths.
-
#read_string(address : UInt64 | String, max_len : Int32 | Nil = nil) : String
Reads a null-terminated C string from memory address.
- #read_u16(address : UInt64 | String) : UInt16
- #read_u32(address : UInt64 | String) : UInt32
- #read_u64(address : UInt64 | String) : UInt64
-
#read_u8(address : UInt64 | String) : UInt8
Reads unsigned integers of various bit widths.
-
#search_bytes(bytes : Bytes) : Array(UInt64)
Searches memory for a byte pattern (e.g.
-
#search_string(query : String) : Array(UInt64)
Searches memory for a string query.
-
#write(address : UInt64 | String, bytes : Bytes) : self
Writes a slice of bytes to the given address using
wx. -
#write_hex(address : UInt64 | String, hex : String) : self
Writes hex characters directly (e.g.
- #write_i32(address : UInt64 | String, value : Int32) : self
- #write_i64(address : UInt64 | String, value : Int64) : self
-
#write_string(address : UInt64 | String, string : String) : self
Writes a string to the given address.
-
#write_u32(address : UInt64 | String, value : UInt32) : self
Writes a 32-bit integer.
-
#write_u64(address : UInt64 | String, value : UInt64) : self
Writes a 64-bit integer.
Constructor Detail
Instance Method Detail
Returns formatted hexdump text for human inspection.
Reads raw bytes from address as a Crystal Bytes slice.
Reads bytes formatted as a continuous hex string.
Reads a null-terminated C string from memory address.
Searches memory for a byte pattern (e.g. Bytes[0x48, 0x89]).
Writes a slice of bytes to the given address using wx.
Writes hex characters directly (e.g. "909090" for NOPs).
Writes a string to the given address.