Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ObjC字符串加密支持 #7

Open
amimo opened this issue Oct 30, 2019 · 5 comments
Open

ObjC字符串加密支持 #7

amimo opened this issue Oct 30, 2019 · 5 comments

Comments

@amimo
Copy link
Owner

amimo commented Oct 30, 2019

这个提交实现了

  • 加密ObjC代码中出现的字符串常量
  • 混淆ObjC方法调用

不熟悉ObjC,不知道实现的有没有问题,有研究的大佬可以帮忙看看.

@amimo amimo pinned this issue Oct 30, 2019
@JunfengJia JunfengJia mentioned this issue Nov 5, 2019
@qtfreet00
Copy link

qtfreet00 commented Feb 12, 2020

我在https://github.com/apple/llvm-project apple/stable/20190619稳定分支上的 llvm 9上对string pass进行了测试,未在llvm-8.0.0-cse上进行测试

产生的异常

2.	Per-module optimization passes
3.	Running pass 'Obfuscation Pass Manager' on module '/TestEaxmple/main.m'.
0  clang-9                  0x0000000110962d84 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1  clang-9                  0x000000011096317d SignalHandler(int) + 188
2  libsystem_platform.dylib 0x00007fff5ab7fb5d _sigtramp + 29
3  libsystem_platform.dylib 0x000000011e59f938 _sigtramp + 3282173432
4  libsystem_c.dylib        0x00007fff5aa396a6 abort + 127
5  libsystem_c.dylib        0x00007fff5aa0220d basename_r + 0
6  clang-9                  0x000000011244a6e2 llvm::SmallVectorTemplateBase<char, true>::push_back(char const&) (.cold.1) + 0
7  clang-9                  0x000000011051dc61 llvm::StructType::getName() const + 37
8  clang-9                  0x0000000111306a85 (anonymous namespace)::StringEncryption::runOnModule(llvm::Module&) + 5021
9  clang-9                  0x00000001112ff528 llvm::ObfuscationPassManager::run(llvm::Module&) + 90
10 clang-9                  0x00000001112ff4bb llvm::ObfuscationPassManager::runOnModule(llvm::Module&) + 525
11 clang-9                  0x00000001104eb58b llvm::legacy::PassManagerImpl::run(llvm::Module&) + 695
12 clang-9                  0x0000000110afc1fb clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout const&, llvm::Module*, clang::BackendAction, std::__1::unique_ptr<llvm::raw_pwrite_stream, std::__1::default_delete<llvm::raw_pwrite_stream> >) + 11368
13 clang-9                  0x0000000110cbc5f8 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 1006
14 clang-9                  0x00000001117cb62c clang::ParseAST(clang::Sema&, bool, bool) + 545
15 clang-9                  0x0000000110e7a22a clang::FrontendAction::Execute() + 84
16 clang-9                  0x0000000110e435fe clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 1128
17 clang-9                  0x0000000110ebfcc8 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1410
18 clang-9                  0x000000010f5ee96e cc1_main(llvm::ArrayRef<char const*>, char const*, void*) + 1471
19 clang-9                  0x000000010f5ed90c main + 7833
20 libdyld.dylib            0x00007fff5a9943d5 start + 1
21 libdyld.dylib            0x00000000000000a5 start + 2774973649
clang-9: error: unable to execute command: Abort trap: 6
clang-9: error: clang frontend command failed due to signal (use -v to see invocation)

@amimo
Copy link
Owner Author

amimo commented Feb 12, 2020

不加这个patch是正常的?

@qtfreet00
Copy link

测试了下 别的pass暂时未发现问题,不开启stringEncrypt就可以正常编译

@qtfreet00
Copy link

已修复

稍后我给你提个pr吧

@wswm2009
Copy link

好像 我开启后 没效果 使用的是 swift-llvm-5.1分支 不知道你们有没有效果

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants