<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Dear Carter,<br>
      <br>
      You should look at tools like s2e and Revgen (from EPFL) and BAP
      (from CMU, I think).  These projects convert binary code into LLVM
      IR.<br>
      <br>
      The issues that you raise are somewhat orthogonal to conversion to
      SSA form.  Regardless of whether one is decompiling machine code
      to an SSA-based IR or a non-SSA IR, one must deal with the
      challenges of disassembly (if doing static decompilation),
      self-modifying code, and control-flow graph reconstruction.  Once
      you get some sort of IR reconstructed, standard algorithms for
      converting the IR into SSA form apply.<br>
      <br>
      Regards,<br>
      <br>
      John Criswell<br>
      <br>
      <br>
      On 1/23/16 10:00 AM, Carter Cheng via llvm-dev wrote:<br>
    </div>
    <blockquote
cite="mid:CALS6=qUoNOBGW_ich4Uz_kD5TbCb_LTabyyGYZ_Um1TJz2qF+g@mail.gmail.com"
      type="cite">
      <meta http-equiv="Context-Type" content="text/html; charset=UTF-8">
      <div dir="ltr">Hi,
        <div><br>
        </div>
        <div>Is decompilation possible in general to the SSA form for
          binaries? I assume one has to make certain assumptions about
          code in general to get tools like these to work. For example
          if code like with dlsym or jit heap allocated functions can be
          incorporated at runtime it would seem that in general it is
          quite difficult to ascertain the boundaries of a basic block
          and insert the correct phi functions for the predecessors
          since one could have jumps from the new code into the middle
          of the static code. This is already ignoring the problem of
          self modification.</div>
        <div><br>
        </div>
        <div>I haven't managed to find many references on the topic but
          I am curious about what sorts of assumptions are made in
          decompilation code recovery and general issues theoretical
          issues about when it is possible to do.  </div>
        <div><br>
        </div>
        <div>Thanks in advance,</div>
        <div><br>
        </div>
        <div>Carter,</div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
<a class="moz-txt-link-freetext" href="http://www.cs.rochester.edu/u/criswell">http://www.cs.rochester.edu/u/criswell</a></pre>
  </body>
</html>