[erlang-questions] Decompiling Erlang source code

Richard Carlsson carlsson.richard@REDACTED
Mon Oct 30 14:06:55 CET 2017


The first argument to beam_lib:chunks/2 should be a path to the beam file,
not just the module name.


        /Richard

2017-10-30 13:38 GMT+01:00 Prakash Parmar <prakashkumar_parmar@REDACTED>:

> I have Erlang application's beam files which I want to decompile.
>
> Application is Compiled and build with 'debug_info' options. here is
> snippet of emake file to which is used to build application :
>
>     {"apps/my_app/src/*",   [debug_info, nowarn_export_all, {outdir,
> "apps/my_app/ebin"},{pa, "deps"},{parse_transform, lager_transform},
> {parse_transform, events_transform}]}.
>
> I have tried function from beam_lib module but getting following Error :
>
>     1>{ok,{_,[{abstract_code,{_,AC}}]}} = beam_lib:chunks(abc,[abstract_
> code]).
>     ** exception error: no match of right hand side value
> {error,beam_lib,{not_a_beam_file,'abc.beam'}}
>
> I have also tried solution mentioned in following post
> <https://reverseengineering.stackexchange.com/questions/8895/decompile-erlang-beam-files-compiled-without-debug-info>
> but Its not working for me. I'm getting following error :
>
>     1> file:write_file("/tmp/my_module_disasm", io_lib:fwrite("~p.\n",
> [beam_disasm:file(abc)])).
>     ok
>
> /tmp/my_module_disasm file contains :
>
>     {error,beam_lib,{not_a_beam_file,'abc.beam'}}.
>
> Anyone have Idea ?
>
>
>
>
> ******* DISCLAIMER: This email and any files transmitted with it are
> privileged and confidential information and intended solely for the use of
> the individual or entity to which they are addressed. If you are not the
> intended recipient, please notify the sender by e-mail and delete the
> original message. Further, you are not to copy, disclose, or distribute
> this e-mail or its contents to any other person and any such actions are
> unlawful. This e-mail may contain viruses. Torry Harris Business Solutions
> has taken every reasonable precaution to minimize this risk, but is not
> liable for any damage you may sustain as a result of any virus in this
> e-mail. The recipient should check this email and any attachments for the
> presence of viruses. THBS reserves the right to monitor and review the
> content of all messages sent to or from this e-mail address********
>
> ******* DISCLAIMER: This email and any files transmitted with it are privileged and confidential information and intended solely for the use of the individual or entity to which they are addressed. If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Torry Harris Business Solutions has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail.  The recipient should check this email and any attachments for the presence of viruses. THBS reserves the right to monitor and review the content of all messages sent to or from this e-mail address.********
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20171030/e2de7035/attachment.htm>


More information about the erlang-questions mailing list