是否可以编辑和重新编译iOS二进制文件? [英] Is it possible to edit and recompile an iOS Binary?

查看:265
本文介绍了是否可以编辑和重新编译iOS二进制文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

经过大量时间与Google合作,我决定在这里提出这个问题。但我无法得到我的问题的答案。以下是详细信息:

I have decided to ask this question here after a lot of time spending with Google. But I couldn't able to get the answer for my question yet. Here follows the details:

我有一个申请并最近发布到Cydia。它已被其他人破解并在torrent网站上发布。有趣的是我内部有一个二进制校验和验证机制,他们能够破解整个东西,并根据他们对二进制文件所做的更改创建了新的校验和文件。他们编辑了两个函数并对其进行反编译并将其发布给种子。

I have an application and posted to Cydia recently. It has been cracked by someone else and posted it in torrent sites. The interesting part is I have a binary checksum verification mechanism inside and they were able to hack the entire stuff and they created new checksum file based on the changes they have made to the binary. They have edited two functions and decompile it and post it to torrents.

所以我对IDA Pro进行了一些研究,发现它可以看到函数和类的实际实现。但是为了编辑函数,他们必须找到该函数的地址并通过HEX EDITOR进行编辑。这部分让我感到困惑,有没有人帮我这个?我不想让它不可撼动:) ..我猜不是那么容易。 :)但我真的想知道他们是如何破解的? :)

So I have done some research with IDA Pro and saw that its is possible to see the actual implementation of functions and classes. But in order to edit the functions they have to find address of that function and edit it via HEX EDITOR. This is part is confusing to me, is there anybody help me on this? I don’t want to make it "unhackable" :)..Its not that easy I guess. :) But I really want to find out how they hack? :)

我的问题是如何编辑iOS二进制文件中的函数并重新编译它?例如,我的一个班级中有以下方法。

My question is how to edit a function in an iOS binary and re-compile it? For example I have a following method in one of my classes.

- (id) getSomething {

   return @"Something";
}

我想编辑这个函数的返回值。那可能吗?

I want to edit the return value of this function.Is that possible??

推荐答案

通常,你不会重新编译它。只需将文件提供给IDA,查找字符串,函数调用或任何您要查找的内容,然后使用十六进制编辑器或类似命令在汇编级别编辑文件。在大多数情况下,只需将条件跳转更改为无条件跳转或nop(无操作)就足够了。如果你想改变返回值,你必须付出更多的努力,但根据我的经验,你要么在二进制文件内部编辑char序列,如果它被指定为常量或初始值 - 或者你只是写一个全新的功能,并将其汇编代码复制到原始文件中。你只需要确保你的新功能不会占用比原来更多的空间 - 或者一切都变得复杂得多。
我希望这是你要求的,否则只需告诉我们你正在谈论哪个应用程序,我们可以深入了解它:)

Usually, you don't "re-compile" it. Just feed the file to IDA, look for strings, function calls or whatever you are looking for and then use a hex editor or similar to edit the file on assembly level. In most cases it's enough to simply change a conditional jump into an unconditional jump or a nop (no operation). If you want to change return values, you have to put a little more effort into it, but in my experience you either edit the char sequence right inside the binary file, if it's specified as a constant or initial value - or you just write a completely new function and "copy" the assembler code of it into the original file. You just have to make sure your new function does not take more space than the original - or everything's getting a lot more complex. I hope that's what you were asking for, otherwise just tell us which app you are talking about and we can look deeper into it :)

这篇关于是否可以编辑和重新编译iOS二进制文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆