Thanks, Rodrigo. I&#39;ll try this out!<br><br><div class="gmail_quote">On Sat, Mar 13, 2010 at 6:14 AM, Rodrigo B. de Oliveira <span dir="ltr">&lt;<a href="mailto:rodrigobamboo@gmail.com">rodrigobamboo@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hey Amir!<br>
<br>
Yes, you can use Mono.Cecil:<br>
<br>
    import System<br>
    import Mono.Cecil<br>
    import Mono.Cecil.Cil<br>
<br>
    pathToAssembly = &quot;/tmp/test.exe&quot;<br>
    asm = AssemblyFactory.GetAssembly(pathToAssembly)<br>
<br>
    module = asm.MainModule<br>
    method = module.Types[&quot;Program&quot;].Methods.GetMethod(&quot;Main&quot;)[0]<br>
<br>
    worker = method.Body.CilWorker<br>
    firstInstruction = method.Body.Instructions[0]<br>
    worker.InsertBefore(firstInstruction, worker.Create(OpCodes.Ldstr,<br>
&quot;Hello!&quot;))<br>
    worker.InsertBefore(firstInstruction, worker.Create(OpCodes.Call,<br>
module.Import(typeof(Console).GetMethod(&quot;WriteLine&quot;, (string,)))))<br>
<br>
    AssemblyFactory.SaveAssembly(asm, pathToAssembly)<br>
    AppDomain.CurrentDomain.ExecuteAssembly(pathToAssembly)<br>
</blockquote></div><br><br clear="all"><br>-- <br>Amir Ebrahimi<br>Technical Account Manager<br>Unity Technologies :: <a href="http://unity3d.com">http://unity3d.com</a><br>