diff options
Diffstat (limited to 'checklink/Disassembler.ml')
-rw-r--r-- | checklink/Disassembler.ml | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/checklink/Disassembler.ml b/checklink/Disassembler.ml new file mode 100644 index 00000000..0e2c6883 --- /dev/null +++ b/checklink/Disassembler.ml @@ -0,0 +1,15 @@ +open ELF_parsers +open ELF_types +open PPC_printers +open PPC_utils + +let disassemble elf sym_name = + let sym = + List.find + (fun sym -> sym.st_name = sym_name) + (Array.to_list elf.e_symtab) + in + match code_of_sym elf sym with + | None -> "Couldn't find the code for that symbol name" + | Some(ecode) -> + string_of_instr_list ecode |