Created
September 1, 2018 15:13
-
-
Save hodak/418b15613b1a66eb546fb4882b132b1b to your computer and use it in GitHub Desktop.
Courtesy of @teamon. Put these files in /usr/local/bin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env elixir | |
defmodule Decompile do | |
def main([beam_file]) do | |
{:ok,{_,[{:abstract_code,{_,ac}}]}} = :beam_lib.chunks(to_charlist(beam_file),[:abstract_code]) | |
:io.fwrite("~s~n", [:erl_prettypr.format(:erl_syntax.form_list(ac))]) | |
end | |
end | |
Decompile.main(System.argv) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# decompile.exs $@ | highlight --syntax erlang --out-format ansi | |
decompile.exs $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment