Skip to content

Instantly share code, notes, and snippets.

@kostiushkin
Forked from andelf/beam_decompile.erl
Created October 29, 2015 13:39
Show Gist options
  • Select an option

  • Save kostiushkin/d3f6b9bf75358a4c8407 to your computer and use it in GitHub Desktop.

Select an option

Save kostiushkin/d3f6b9bf75358a4c8407 to your computer and use it in GitHub Desktop.
Erlang BEAM file decompile to .erl file
#!/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