已编译应用程序的修补或更新如何工作?
您能否帮助您大致了解补丁或更新的应用如何在代码级别上应用于已编译且实时的应用程序?
我的意思是,如果我们想修复某段代码中的错误(或改进功能),那么已经编译的代码会发生什么情况,它是如何改变的?
Could you help to understand generally how the applying of patch or an update works for already compiled and live application at the level of code?
I mean, if we want to fix an error (or improve a functionality) in some piece of code, what is happening with that already compiled code, how it gets changed?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你所说的是用二进制差异算法完成的。
这样的算法可以找到现有二进制文件和目标二进制文件之间的差异。这通常比再次发送整个文件占用的空间要少得多,因此速度更快。如果您推送的更新与安全相关,那么速度就很重要,因为客户端修补的速度越快,漏洞利用的机会就越少。
请参阅此和此了解已编译可执行文件的最新、最好的二进制差异算法实现。
What you talk about is done with a binary diff algorithm.
Such an algorithm finds the differences between the existing binary file and the target binary file. That is usually a lot less space than sending the whole file again, thus it's faster. Speed is relevant if the updates you push are security related, becasue the faster clients get patched the less window of opportunity exploits have.
See this and this for the latest and greatest on binary diff algorithm implementations for compiled executables.
最有可能的是,您只需将二进制文件替换为新的编译版本,并确保它们仍然可以与所有依赖库一起使用。
Most likely you're going to simply have to replace the binaries with the new compiled version and make sure they still work with all the dependent libraries as well.