realloc

DL.realloc(addr, size) Class Public methods Change the size of the memory allocated at the memory location addr to size bytes. Returns the memory address of the reallocated memory, which may be different than the address passed in.

malloc

DL.malloc(size) Class Public methods Allocate size bytes of memory and return the integer memory address for the allocated memory.

free

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

fiddle?

fiddle?() Class Public methods Returns true if DL is using Fiddle, the libffi wrapper.

dlwrap

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

dlunwrap

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

dlopen

DL.dlopen(so_lib) Class Public methods An interface to the dynamic linking loader This is a shortcut to DL::Handle.new and takes the same arguments. Example: libc_so = "/lib64/libc.so.6" => "/lib64/libc.so.6" libc = DL.dlopen(libc_so) => #<DL::Handle:0x00000000e05b00>

wrap_args

wrap_args(args, tys, funcs, &block) Instance Public methods

wrap_arg

wrap_arg(arg, ty, funcs = [], &block) Instance Public methods

unsigned_value

unsigned_value(val, ty) Instance Public methods