free

Fiddle.free(addr) Class Public methods Free the memory at address addr

dlwrap

Fiddle.dlwrap(val) Class Public methods Returns a memory pointer of a function's hexadecimal address location val Example: lib = Fiddle.dlopen('/lib64/libc-2.15.so') => #<Fiddle::Handle:0x00000001342460> Fiddle.dlwrap(lib['strcpy'].to_s(16)) => 25522520

dlunwrap

Fiddle.dlunwrap(addr) Class Public methods Returns the hexadecimal representation of a memory pointer address addr Example: lib = Fiddle.dlopen('/lib64/libc-2.15.so') => #<Fiddle::Handle:0x00000001342460> lib['strcpy'].to_s(16) => "7f59de6dd240" Fiddle.dlunwrap(Fiddle.dlwrap(lib['strcpy'].to_s(16))) => "7f59de6dd240"

dlopen

dlopen(library) => Fiddle::Handle Class Public methods Creates a new handler that opens library, and returns an instance of Fiddle::Handle. See Fiddle::Handle.new for more.

to_value

to_value Instance Public methods Cast this pointer to a ruby object.

to_str

ptr.to_str => stringptr.to_str(len) => string Instance Public methods Returns the pointer contents as a string. When called with no arguments, this method will return the contents with the length of this pointer's size. When called with len, a string of len bytes will be returned. See #to_s

to_s

ptr.to_s => stringptr.to_s(len) => string Instance Public methods Returns the pointer contents as a string. When called with no arguments, this method will return the contents until the first NULL byte. When called with len, a string of len bytes will be returned. See #to_str

to_int

to_i Instance Public methods Returns the integer memory location of this pointer.

to_i

to_i Instance Public methods Returns the integer memory location of this pointer.

size=

size=(size) Instance Public methods Set the size of this pointer to size