Skip to content

Instantly share code, notes, and snippets.

@eiri
Created February 11, 2016 16:33
Show Gist options
  • Save eiri/38929a7bd4b2b7d82dc9 to your computer and use it in GitHub Desktop.
Save eiri/38929a7bd4b2b7d82dc9 to your computer and use it in GitHub Desktop.
Decompile .beam files
#!/usr/bin/env escript
% -*- mode: erlang -*-
main([BeamFile]) ->
{ok,{_,[{abstract_code,{_,AC}}]}} = beam_lib:chunks(BeamFile,[abstract_code]),
io:fwrite("~s~n", [erl_prettypr:format(erl_syntax:form_list(AC))]).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment