反编译 Objective-C 库

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2334072/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-03 23:08:47  来源:igfitidea点击:

Decompiling Objective-C libraries

objective-cxcodedecompilingcracking

提问by Cy.

I've just finished a library in Objective-C that I compiled as a Static Library for distribution.

我刚刚在 Objective-C 中完成了一个库,我将其编译为静态库以进行分发。

I'd wanted to know what chances to get this decompiled are out there.

我想知道有什么机会可以反编译。

  • Do you know any software that can do this?
  • If so, how could I protect me better?
  • 你知道有什么软件可以做到这一点吗?
  • 如果是这样,我怎样才能更好地保护我?

EDIT:My static lib is made for iPhone / ARM

编辑:我的静态库是为 iPhone/ARM 制作的

I created an algorithm that depending on the some parameters of the app, it can run as demo or as full code. You init the object with X variables and unlock the full version. I was wondering if they'll be able to see this algorithm so they can create a key generator.

我创建了一个算法,根据应用程序的一些参数,它可以作为演示或完整代码运行。您使用 X 变量初始化对象并解锁完整版本。我想知道他们是否能够看到这个算法,以便他们可以创建一个密钥生成器。

回答by Chuck

If it executes, it can be decompiled. Objective-C is particularly easy to decompile into readable code thanks to its dynamic features. If you want to make things a little bit harder, you could write most of your code in plain C and strip the executable — which of course has the tradeoff of making your application design harder to manage. But be honest with yourself: If somebody wants to crack your code, you are not going to be able to stop them. Crackers have practically unlimited amounts of time and enthusiasm and will actually be excited by any novel efforts you put in to stop them. Nobody has yet made uncrackable software, and the biggest corporations in the world have tried. You're not going to do better than them, especially if you need to ask about it on Stack Overflow.

如果它执行,它可以被反编译。由于其动态特性,Objective-C 特别容易反编译为可读代码。如果你想让事情变得更难一点,你可以用普通的 C 语言编写大部分代码并剥离可执行文件——这当然会导致应用程序设计更难以管理。但对自己诚实:如果有人想破解您的代码,您将无法阻止他们。饼干实际上有无限的时间和热情,并且实际上会因您为阻止他们而付出的任何新努力而感到兴奋。还没有人开发出不可破解的软件,世界上最大的公司已经尝试过。你不会比他们做得更好,尤其是当你需要在 Stack Overflow 上询问时。

Take the time that you would have put into thwarting decompilation and use it to make your product better — that will have a much better ROI.

花些时间来阻止反编译,并用它来改进你的产品——这将有更好的投资回报率。

回答by Rob Napier

It's not clear what you are trying to protect yourself from. Yes, it can be reverse engineered. The simplest tool is otool, part of the standard developer distribution:

目前尚不清楚您试图保护自己免受什么侵害。是的,它可以被逆向工程。最简单的工具是otool,标准开发者发行版的一部分:

otool -tV <library>

From that they run up to things like IDA Pro, which has iPhone support and is very nice for this kind of work. In between, I'm really surprised that I haven't seen a rework of otxfor iPhone/ARM yet. I wouldn't be surprised to see one show up eventually. And of course there's gdb if you're trying to work out how things flow and what the data is at various points.

从那以后,他们运行了像IDA Pro这样的东西,它支持 iPhone,非常适合这种工作。在这中间,我真的很惊讶我还没有看到针对 iPhone/ARM的otx返工。看到一个最终出现,我不会感到惊讶。当然,如果您想弄清楚事物是如何流动的以及在不同点上的数据是什么,那么还有 gdb。

If you have more details about what you're trying to protect yourself from, there may be some targeted answers. Beyond that, read Chuck's comments.

如果您有更多关于您试图保护自己免受什么侵害的详细信息,那么可能会有一些有针对性的答案。除此之外,请阅读查克的评论。

回答by jamone

ChanceGetsDecompiled = ExpectedGainFromBeingDecompiled / PopularityOfLibrary

ChanceGetsDecompiled = ExpectedGainFromBeingDecompiled / PopularityOfLibrary

Well if you REALLY want to know I would try decompiling it your self. You don't say if this is for PPC, Intel, or ARM which makes a difference. Here is a decompiler for Intel i386 Decompiler

好吧,如果您真的想知道我会尝试自己反编译它。您不会说这是针对 PPC、Intel 还是 ARM,这会有所不同。这是 Intel i386 Decompiler 的反编译器

I don't know what you could do (I don't think there is much) to limit this. Code can always be reverse engineered. Be happy that your not using java or .net. Their decompilation is so nice.

我不知道你能做些什么(我认为没有太多)来限制这一点。代码总是可以逆向工程的。很高兴您没有使用 java 或 .net。他们的反编译非常好。