小编uns*_*ble的帖子

将MH_EXECUTE转换为MH_DYLIB(mach-o)

问题:

我有2个MH_EXECUTE iOS二进制文件(已编译,没有源代码).
让我们来命名binary1binary2.
UIApplicationMain调用之前我尝试在它们之间切换!

1尝试

我成功地做了这个binary1和一个dylib.所以我尝试将MH_EXECUTE转换为MH_DYLIB.


第1步
创建iOS应用程序binary1

#import <dlfcn.h>

int main(int argc, char * argv[])
{
    NSLog(@"binary1 -> Hello, World!");

    void *handle = dlopen([[[NSBundle mainBundle] pathForResource:@"binary2" ofType:nil] cStringUsingEncoding:NSUTF8StringEncoding], RTLD_NOW);

    if (handle)
    {
        NSLog(@"DLOPEN is OK!");
    }
    else
    {
        NSLog(@"!OK ... --> %s", dlerror());

    }

    return 0;
}
Run Code Online (Sandbox Code Playgroud)

创建iOS应用程序 binary2

int main(int argc, char * argv[])
{
    NSLog(@"binary2 -> Hello, World!");

    return 0;
}
Run Code Online (Sandbox Code Playgroud)

当我跑步时,binary1我得到:

在此输入图像描述

第2步 …

reverse mach-o dylib ios

8
推荐指数
1
解决办法
620
查看次数

标签 统计

dylib ×1

ios ×1

mach-o ×1

reverse ×1