本文簡要介紹ruby語言中 Fiddle::Handle類
的用法。
Fiddle::Handle
是訪問動態庫的方式
示例
設置
libc_so = "/lib64/libc.so.6" => "/lib64/libc.so.6" @handle = Fiddle::Handle.new(libc_so) => #<Fiddle::Handle:0x00000000d69ef8>
設置,帶有標誌
libc_so = "/lib64/libc.so.6" => "/lib64/libc.so.6" @handle = Fiddle::Handle.new(libc_so, Fiddle::RTLD_LAZY | Fiddle::RTLD_GLOBAL) => #<Fiddle::Handle:0x00000000d69ef8>
見 RTLD_LAZY
和 RTLD_GLOBAL
符號地址
strcpy_addr = @handle['strcpy'] => 140062278451968
或者
strcpy_addr = @handle.sym('strcpy') => 140062278451968
相關用法
- Ruby Handler.start_sequence用法及代碼示例
- Ruby Handler.start_mapping用法及代碼示例
- Ruby Handler.scalar用法及代碼示例
- Ruby Handler.start_document用法及代碼示例
- Ruby Handle.new用法及代碼示例
- Ruby Handler.end_document用法及代碼示例
- Ruby Handler.alias用法及代碼示例
- Ruby Hash.reject用法及代碼示例
- Ruby Hash shift()用法及代碼示例
- Ruby Hash.delete()用法及代碼示例
- Ruby Hash length()用法及代碼示例
- Ruby Hash.new用法及代碼示例
- Ruby Hash.size用法及代碼示例
- Ruby Hash rehash用法及代碼示例
- Ruby Hash.delete用法及代碼示例
- Ruby Hash.hash <=用法及代碼示例
- Ruby Hash size()用法及代碼示例
- Ruby Hash each_pair()用法及代碼示例
- Ruby Hash.select!用法及代碼示例
- Ruby Hash value?用法及代碼示例
- Ruby Hash values用法及代碼示例
- Ruby Hash.ruby2_keywords_hash用法及代碼示例
- Ruby Hash.rassoc(obj)用法及代碼示例
- Ruby Hash.to_s用法及代碼示例
- Ruby Hash.values_at()用法及代碼示例
注:本文由純淨天空篩選整理自ruby-lang.org大神的英文原創作品 Handle類。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。