unix api -mmap() 可以在 iPhone 操作系统上正常工作吗?
我需要知道“映射”虚拟内存并将二进制代码加载到其中并执行二进制代码的可行性。二进制代码(以共享库的形式呈现)可以是mach格式或elf格式,它们将通过我们的二进制加载器(而不是苹果自己的unix二进制加载器)通过文件映射方式加载到内存中。
以前有人尝试过吗?如果您对此有任何线索,请告诉我,我们可以进一步讨论。 顺便问一下,有谁知道如何将共享库(不是通过应用程序链接)上传到iPhone模拟器或与iPhone应用程序一起开发的设备?
I need to know the feasibility of "mmaping" a virtualmemory and loading binary code into it and execute the binary code. The binary code (presented as shared library) may be mach format or elf format, which will be loaded into the memory through file-mapping way by our binary loader other than the apple's own unix binary loader.
Has someone tried it before? If you have any clue about that please tell me, and we can discuss it more.
By the way, does anyone know how to upload a shared library (not linked by app) to iPhone simulator or device with iPhone app developed together?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在 iPhone 上使用
mmap()
。 iOS SDK 协议通常反对动态代码加载,因此您可能不被允许使用它来提供应用程序发布时不可用的代码。你会想和苹果谈谈这个问题,但我很有信心预测你想做的事情不会被允许。考虑一下您提供自己的代码加载器的原因是否真实,或者您是否真的可以使用 iOS
dyld
。You can use
mmap()
on the iPhone. The iOS SDK agreement is generally against dynamic code loading, so you will probably not be allowed to use it to provide code that was not available when the app was shipped. You will want to talk to Apple about that, but I feel quite confident in predicting that what you want to do won't be permitted.Consider whether your reason for supplying your own code loader is genuine, or whether you can actually get away with using the iOS
dyld
.