1

I've tried to decompile .beam file (compiled from elixir code)

I used this escript

main([BeamFile]) ->
    {ok,{_,[{abstract_code,{_,AC}}]}} = beam_lib:chunks(BeamFile,[abstract_code]),
    io:fwrite("~s~n", [erl_prettypr:format(erl_syntax:form_list(AC))]).

Which generated a file. But on compiling this code again I get error on '-spec' annotation

lib/renlim.erl:7: syntax error before: '{'

The code is unchanged. Is it related to new Erlang version or am I doing something wrong?

Erlang spec Error

Krzysztof Wende
  • 3,208
  • 25
  • 38
  • Pretty sure it's the `erl_prettypr` pretty-printer that's broken, failing to turn the abstract format for the `spec` attribute back into proper Erlang source. Specifically, the `erl_syntax:attribute_arguments/1` function called by the pretty-printer does not appear to handle the `spec` attribute. – Steve Vinoski Apr 14 '15 at 20:33

0 Answers0