title: Making a Bazel genrule that modifies an executable generated by cc_binary
body: <p>Assuming I have a cc_binary() rule like this:</p>
  <pre><code>cc_binary(
      name = &quot;App&quot;,
      srcs = [
          &quot;app.cpp&quot;,
      ],
  )
  </code></pre>
  <p>This will produce App.exe somewhere in bazel-bin. I need to write a genrule that can read App.exe and produce another version of it. How can I do that?</p>
  <p>Edit: this is my current attempt for a genrule, but it forces the recompilation of :hello_main with a different configuration and I end up getting errors like &quot;error C2955: 'std::pair': use of class template requires template argument list&quot;</p>
  <pre><code>genrule(
      name = &quot;tbds&quot;,
      srcs = [
          &quot;:data&quot;,
      ],
      outs = [&quot;tbds.exe&quot;],
      exec_tools = [&quot;@libpackfiles//FilePacker&quot;],
      tools = [&quot;:hello_main&quot;],
      cmd = &quot;cp $(location :hello_main) $(OUTS) &amp;&amp; $(location @libpackfiles//FilePacker) $(OUTS) -files $(SRCS) -append&quot;,
      executable = true,
  )
  </code></pre>