Binary Rewriting with Dyninst.ppt
《Binary Rewriting with Dyninst.ppt》由会员分享,可在线阅读,更多相关《Binary Rewriting with Dyninst.ppt(26页珍藏版)》请在麦多课文档分享上搜索。
1、Binary Rewriting with Dyninst,Madhavi Krishnan and Dan McNulty,Talk Outline,Binary Rewriter Review Implementation Challenges New Features Rewriting Statically Linked Binaries Conclusion,2,Binary Rewriting with Dyninst,Binary Rewriting,3,Binary Rewriting with Dyninst,libc,Dyninst Binary Rewriter,a.ou
2、t.rewritten,libprofile,Rewrite executablesRewrite librariesAdd new libraries to binaries,a.out,libc.rewritten,Binary Rewriter Capabilities,Instrument once, run many Support more systems (BlueGene, FreeBSD, ) Operate on unmodified binaries No debug information required No linker relocations required
3、No symbols required Rewritten binary need not be compiled or linked,4,Binary Rewriting with Dyninst,Dynamic instrumentation and binary rewriting use the same abstractions and interfaces,/* Setup */ BPatch_addressSpace *addr_space; if (use_bin_edit)addr_space = BPatch.openFile(“a.out”); elseaddr_spac
4、e = BPatch.createProcess(“a.out”);/* Instrumentation */ addr_space-loadLibrary(“libInstrumentation.so”); addr_space-getImage()-findFunction(“func”, funcs); addr_space-insertSnippet(callExpr, point);/* Finalize */ if (use_bin_edit) app_bin-writeFile(a.rewritten.out); else app_proc-continueExecution()
5、; ,Binary Rewriter Example,6,Binary Rewriting with Dyninst,Challenges,Complex Standards Executable and Linkable Format(ELF) System V Standard Linux Standard Base (LSB) Accessing information in the original binary file Redundant information Inconsistent! E.g., Section size stored in headers and dynam
6、ic section Writing a new binary file Updating sections with new information Not precisely defined by standards! E.g., Adding new symbol to hash section,7,Binary Rewriting with Dyninst,Challenges,Implementation of the standards Libraries and tools OS Assigning meaning to undefined behavior Symbols wi
7、th no name and no type Stringent requirements by libelf Section alignment Unexpected restrictions by the OS Program header must be on first page Loader assumes relocation sections are adjacent,8,Binary Rewriting with Dyninst,What is New in the Binary Rewriter?,Linux/PowerPC32 portHandling run time e
8、vents with the binary rewriterSupport for rewriting static binaries,9,Binary Rewriting with Dyninst,Dealing with Position Independent Code (PIC) What is PIC? Why deal with PIC? PowerPC specific challenges Identifying PIC idiom Determining current PC,Linux/PowerPC32 Port,10,Binary Rewriting with Dyni
9、nst,0x1000,0x2000,0x3000,Code,Data,Shared library,Address space,PC relative references,Initialize and finalize instrumentation,Handling Run Time Events,11,Binary Rewriting with Dyninst,Dyninst Mutator,Mutatee Process,process load ,Events,OneTimeCode Callback,Initialize and finalize instrumentation,H
- 1.请仔细阅读文档,确保文档完整性,对于不预览、不比对内容而直接下载带来的问题本站不予受理。
- 2.下载的文档,不会出现我们的网址水印。
- 3、该文档所得收入(下载+内容+预览)归上传者、原创作者;如果您是本文档原作者,请点此认领!既往收益都归您。
下载文档到电脑,查找使用更方便
2000 积分 0人已下载
下载 | 加入VIP,交流精品资源 |
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- BINARYREWRITINGWITHDYNINSTPPT
