<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="241100" data-post-id="241100">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="al2o3cr" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/al2o3cr/120/3457_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  al2o3cr
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I’m not sure what you mean - that code from <code>decompilerl</code> depends on the existence of the <code>Abst</code> chunk in the BEAM file it’s used on. If the chunk isn’t there, it’s not going to work.</p>
<p>Each step of the compilation process drops information that’s not important to it, so the process isn’t 100% reversible - for instance, <code>decompilerl</code> uses local variables like <code>_@4</code> because the original names are not present in the AST.</p>
<p>The <code>Code</code> chunk throws away more information - for instance, the <code>Abst</code> chunk contains AST for “populate a record named <code>:holiday_info</code>” in a function like <code>list_open_total</code>:</p>
<pre data-code-wrap="erlang"><code class="lang-erlang">list_open_total() -&gt;
    [#holiday_total{id = 104,
                    name = lang:get(&lt;&lt;"HĐ Gộp SV"/utf8&gt;&gt;), type = 2,
                    start_time = {merge_day, 1},
                    end_time = {merge_day, 56, 86399}, status = 1,
                    is_show = 1},
     #holiday_total{id = 103,
                    name = lang:get(&lt;&lt;"HĐ Mở SV"/utf8&gt;&gt;), type = 1,
                    start_time = {open_day, 1},
                    end_time = {open_day, 56, 86399}, status = 1,
                    is_show = 1}].
</code></pre>
<p>The corresponding BEAM code from the <code>Code</code> section is “desugared”: the record syntax is shorthand for building a tuple that starts with <code>{:holiday_total, ...</code>:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">   {:function, :list_open_total, 0, 2,
    [
      {:label, 1},
      {:line, 1},
      {:func_info, {:atom, :holiday_role_data}, {:atom, :list_open_total}, 0},
      {:label, 2},
      {:allocate_zero, 1, 0},
      {:move, {:literal, "HĐ Gộp SV"}, {:x, 0}},
      {:line, 2},
      {:call_ext, 1, {:extfunc, :lang, :get, 1}},
      {:move, {:x, 0}, {:y, 0}},
      {:move, {:literal, "HĐ Mở SV"}, {:x, 0}},
      {:line, 3},
      {:call_ext, 1, {:extfunc, :lang, :get, 1}},
      {:test_heap, 28, 1},
      {:put_tuple, 11, {:x, 1}},
      {:put, {:atom, :holiday_total}},
      {:put, {:integer, 103}},
      {:put, {:x, 0}},
      {:put, {:integer, 0}},
      {:put, {:literal, {:open_day, 1}}},
      {:put, {:literal, {:open_day, 56, 86399}}},
      {:put, {:integer, 1}},
      {:put, {:integer, 0}},
      {:put, {:integer, 0}},
      {:put, {:integer, 1}},
      {:put, {:integer, 1}},
      {:put_list, {:x, 1}, nil, {:x, 1}},
      {:put_tuple, 11, {:x, 2}},
      {:put, {:atom, :holiday_total}},
      ...
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="241100" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/need-help-decompiling-beam-file/45441/22">Post #21</a>
	                </div>
	            </div>
              <div id="likers-container-241100" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="241100"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #21"></div>
  </section>
</div>
    <div class="postbit" id="241213" data-post-id="241213">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="erlic122" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  erlic122
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Hello, well, I don’t understand much since I’m new to this, but from what I understand your message is that when compiling the file, it loses some codes and doesn’t compile 100% since it eliminates unnecessary code, but I don’t understand how to solve the other the problem, I tried <a class="mention" href="/u/lud" rel="nofollow">@lud</a>  solution and it works perfectly but for most of the files I used the steps indicated, I created a new file with mix new project and I followed the steps and it worked, but some files throw me the error that I mentioned above</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="241213" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/need-help-decompiling-beam-file/45441/23">Post #22</a>
	                </div>
	            </div>
              <div id="likers-container-241213" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="241213"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #22"></div>
  </section>
</div>
    <div class="postbit" id="241216" data-post-id="241216">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="lud" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/lud/120/14382_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  lud
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>It means that the BEAM file does not contain the part that would allow you to reconstruct the erlang representation of the source code. Basically you will not be able to generate a .erl file from those files unfortunately.</p>
<p>Maybe there is a way to generate Erlang Code from BEAM instructions but I do not know.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="241216" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/need-help-decompiling-beam-file/45441/24">Post #23</a>
	                </div>
	            </div>
              <div id="likers-container-241216" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="241216"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #23"></div>
  </section>
</div>
    <div class="postbit" id="241221" data-post-id="241221">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="erlic122" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  erlic122
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Damn, what bad news, possibly on the part of erlang it can be done but I already looked for many ways on google and I can’t find it. wait if any user can have the answer, thank you very much in the same way</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="241221" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/need-help-decompiling-beam-file/45441/25">Post #24</a>
	                </div>
	            </div>
              <div id="likers-container-241221" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="241221"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #24"></div>
  </section>
</div>
    <div class="postbit" id="249178" data-post-id="249178">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="rayleigh" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  rayleigh
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>looks like the github niahoo/decompilerl is no more there.<br>
So its not possible to decompile beam files?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="249178" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/need-help-decompiling-beam-file/45441/26">Post #25</a>
	                </div>
	            </div>
              <div id="likers-container-249178" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="249178"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #25"></div>
  </section>
</div>
    <div class="postbit" id="249187" data-post-id="249187">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="al2o3cr" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/al2o3cr/120/3457_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  al2o3cr
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="rayleigh" data-post="26" data-topic="45441">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/r/439d5e/48.png" class="avatar"> rayleigh:</div>
<blockquote>
<p>looks like the github niahoo/decompilerl is no more there.</p>
</blockquote>
</aside>
<p>Not sure what you mean; this link works fine for me: <a href="https://github.com/niahoo/decompilerl" class="inline-onebox" rel="nofollow">GitHub - niahoo/decompilerl: 🃏 Decompile Elixir modules to Erlang abstract code · GitHub</a></p>
<p>FWIW, that’s a fork of <a href="https://github.com/aerosol/decompilerl" class="inline-onebox" rel="nofollow">GitHub - aerosol/decompilerl: 🃏 Decompile Elixir modules to Erlang abstract code · GitHub</a> which appears to have been updated much more recently.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="249187" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/need-help-decompiling-beam-file/45441/27">Post #26</a>
	                </div>
	            </div>
              <div id="likers-container-249187" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="249187"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #26"></div>
  </section>
</div>
    <div class="postbit" id="249192" data-post-id="249192">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="lud" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/lud/120/14382_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  lud
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>niahoo is me. I forked the thing because I wanted to use it as a mix task, I do not remember why. It works just fine but yes, I should merge.</p>
<p>The best would be a tool with all the output formats as in <a href="https://github.com/michalmuskala/decompile" class="inline-onebox" rel="noopener nofollow ugc">GitHub - michalmuskala/decompile · GitHub</a> but with stdio output as a default and configurable output path as decompilerl does.</p>
<p><a href="https://github.com/michalmuskala/decompile" class="inline-onebox" rel="noopener nofollow ugc">GitHub - michalmuskala/decompile · GitHub</a> can output Elixir code directly now, I guess it is the best tool for newcomers.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="249192" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/need-help-decompiling-beam-file/45441/28">Post #27</a>
	                </div>
	            </div>
              <div id="likers-container-249192" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="249192"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #27"></div>
  </section>
</div>
    <div class="postbit" id="249193" data-post-id="249193">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="rayleigh" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  rayleigh
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>hi thx for the anwser.<br>
But how to use this in description is only this</p>
<p>mix decompile ElixirModule --to erlang</p>
<p>But this not working.<br>
And the other solustion with mix.exs<br>
I change this</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">deps({:decompilerl, github: "niahoo/decompilerl"})
</code></pre>
<p>but not realy working  get this error</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">:\testproject\myproject&gt;mix run tt.exs &gt; holiday_role_data.erl
warning: function deps/0 is unused
  mix.exs:23

** (CompileError) mix.exs:10: undefined function deps/1 (expected Myproject.MixProject to define such a function or for it to be imported, but none are available)
</code></pre>
<pre data-code-wrap="elixir"><code class="lang-elixir"></code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="249193" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/need-help-decompiling-beam-file/45441/29">Post #28</a>
	                </div>
	            </div>
              <div id="likers-container-249193" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="249193"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #28"></div>
  </section>
</div>
    <div class="postbit" id="249267" data-post-id="249267">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="lud" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/lud/120/14382_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  lud
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="rayleigh" data-post="29" data-topic="45441">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/r/439d5e/48.png" class="avatar"> rayleigh:</div>
<blockquote>
<pre data-code-wrap="elixir"><code class="lang-elixir">mix decompile ElixirModule --to erlang
</code></pre>
<p>But this not working.</p>
</blockquote>
</aside>
<p>It should output an .erl file in the current working directory.</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">:\testproject\myproject&gt;mix run tt.exs &gt; holiday_role_data.erl
warning: function deps/0 is unused
  mix.exs:23

** (CompileError) mix.exs:10: undefined function deps/1 
</code></pre>
<p>How is your mix.exs file like? The <code>deps({:decompilerl, github: "niahoo/decompilerl"})</code> is strange.</p>
<p>Generally you will have a <code>deps: deps(),</code> call in the <code>project/0</code> function of the mix.exs file and dependencies defined like this:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">  defp deps do
    [
      # ...
      {:decompilerl, github: "niahoo/decompilerl"}
    ]
  end
</code></pre>
<p>But you do not need the dependency in your project, you can just install the tool:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">mix archive.install github niahoo/decompilerl
# or
mix archive.install github michalmuskala/decompile
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="249267" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/need-help-decompiling-beam-file/45441/30">Post #29</a>
	                </div>
	            </div>
              <div id="likers-container-249267" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="249267"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>