Beam = code:which(MyModuleName). {ok,{_,[{abstract_code,{_,AC}}]}} = beam_lib:chunks(Beam,[abstract_code]). io:fwrite("~s~n", [erl_prettypr:format(erl_syntax:form_list(AC))]).
防止被反编译,rebar.conf里面添加
{erl_opts, [no_debug_info]}.
Beam = code:which(MyModuleName). {ok,{_,[{abstract_code,{_,AC}}]}} = beam_lib:chunks(Beam,[abstract_code]). io:fwrite("~s~n", [erl_prettypr:format(erl_syntax:form_list(AC))]).
防止被反编译,rebar.conf里面添加
{erl_opts, [no_debug_info]}.