Native Processes Injection?

polaris · · 484 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I just got a question in my head, Since GoLANG is able to use C code inside itself... Would you be able to inject one processes into another native processes?</p> <p>I know that people are using GoLANG for web applications more but i am interested in it for a general use.</p> <hr/>**评论:**<br/><br/>TheMerovius: <pre><blockquote> <p>Would you be able to inject one processes into another native processes?</p> </blockquote> <p>That question is not well-formed. What do you mean by &#34;inject&#34;? Processes exist as a hierarchy (at least in unix-like-ish OSes), one process can never be &#34;part of&#34; another process. If you mean &#34;started by&#34;, there&#39;s <a href="http://godoc.org/os/exec" rel="nofollow">os/exec</a>. If you mean, you want to use the code of one program in another program, that&#39;s either cgo or what <a href="/u/nliadm" rel="nofollow">/u/nliadm</a> said.</p> <p>But without some better phrasing of your question, it won&#39;t be possible to answer it properly.</p> <p>PS: It&#39;s &#34;go&#34;, not &#34;golang&#34;, lest &#34;GoLANG&#34; :)</p></pre>SaturnsVoid: <pre><p>Guess these are terms not normally used... Take a look at this; <a href="http://www.adlice.com/runpe-hide-code-behind-legit-process/" rel="nofollow">http://www.adlice.com/runpe-hide-code-behind-legit-process/</a></p> <p>Basically it injects a program into another process and runs it alongside, as one.</p></pre>TheMerovius: <pre><p>Okay, that&#39;s a different thing. You don&#39;t talk about processes, but about code (running code in a foreign process). And yes, with the mechanism hinted at by <a href="/u/nliadm" rel="nofollow">/u/nliadm</a> this is possible (basically, all you need for that is dynamically loadable code. As of go 1.5, the gc toolchain can create that).</p></pre>scottjbarr: <pre><p>Go is great for general use. I write all kinds of apps with it.</p> <p>It sounds to me like you&#39;re wanting to write an application that uses a an existing library?</p></pre>nliadm: <pre><p><code>go help buildmode</code> explains some ways external programs can call go code.</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

484 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传