美文网首页TheosiOS进阶iOS Developer
iOS逆向工程thoes报错处理方案总结

iOS逆向工程thoes报错处理方案总结

作者: wg689 | 来源:发表于2016-07-02 15:10 被阅读3391次

    打开.xm文件,目前没有发现啥编辑器可以打开,命令行是万能的

    open -e /Users/wanggang/Downloads/nixianggongchenggood/iosregreetings/Tweak.xm 
    
    

    .xm文件中输入汉字报错,汉字在xcode中写好黏贴进.xm文件

    ==> Preprocessing Tweak.xm…
    ==> Compiling Tweak.xm (armv7)…
    Tweak.xm:3:24: error: non-ASCII characters are not allowed outside of literals
          and identifiers
          NSString *str = @“看专”;
                           ^
    Tweak.xm:3:33: error: non-ASCII characters are not allowed outside of literals
          and identifiers
          NSString *str = @“看专”;
                                ^
    Tweak.xm:3:23: error: unexpected '@' in program
          NSString *str = @“看专”;
                          ^
    

    报错:/makefiles/common.mk: No such file or directory
    Makefile:11: /tweak.mk: No such file or directory

    解决办法:include /opt/theos/makefiles/common.mkinclude /opt/theos/makefiles/tweak.mk,虽说这样写不是很好,但是没有找到其他的方法,其他的按照文档一步步的来,傻瓜式的

    THEOS_DEVICE_IP = 192.168.1.100
    ARCHS = armv7 arm64
    TARGET = iphone:latest:8.0
    include /opt/theos/makefiles/common.mk
    TWEAK_NAME = iOSREGreetings
    iOSREGreetings_FILES = Tweak.xm
    iOSREGreetings_FRAMEWORKS = UIKit
    include $(THEOS_MAKE_PATH)/tweak.mk
    after-install::
        install.exec "killall -9 SpringBoard"
    

    报错: Preprocessing Tweak.xm…
    Tweak.xm:2: error: Tweak.xm…的问题重新写

    ==> Preprocessing Tweak.xm…
    Tweak.xm:2: error: %end does not make sense inside a block
    make[3]: *** [/Users/wanggang/Downloads/nixianggongchenggood/iosregreetings/.theos/obj/debug/armv7/Tweak.xm.07780871.o] Error 22
    make[2]: *** [/Users/wanggang/Downloads/nixianggongchenggood/iosregreetings/.theos/obj/debug/armv7/iOSREGreetings.dylib] Error 2
    make[1]: *** [internal-library-all_] Error 2
    make: *** [iOSREGreetings.all.tweak.variables] Error 2
    wanggangdeMacBook-Pro:iosregreetings wanggang$ make package install
    

    报错Error: The vendor/include and/or vendor/lib directories are missing. Please run git submodule update --init --recursive in your Theos directory.* 按照这个文档 https://github.com/theos/theos/wiki/Installation,一步步的配置,重点说说文档这一句add to your ~/.bash_profile or equivalent:export PATH=/usr/local/opt/gnu-sed/bin/:$PATHIn order to use make troubleshoot,需要用命令行打开open ~/.bash_profile

    打开和添加示意图
    ==> Error: The vendor/include and/or vendor/lib directories are missing. 
    Please run `git submodule update --init --recursive` in your Theos directory. 
    More information: https://github.com/theos/theos/wiki/Installation.
    

    control文件

    Package: com.iosre.iosregreetings
    Name: iOSREGreetings
    Depends: mobilesubstrate
    Version: 0.0.1
    Architecture: iphoneos-arm
    Description: An awesome MobileSubstrate tweak!
    Maintainer: snakeninny
    Author: snakeninny
    Section: Tweaks
    

    makefile文件

    
    THEOS_DEVICE_IP = 192.168.1.100
    ARCHS = armv7 arm64
    TARGET = iphone:latest:8.0
    include /opt/theos/makefiles/common.mk
    TWEAK_NAME = iOSREGreetings
    iOSREGreetings_FILES = Tweak.xm
    iOSREGreetings_FRAMEWORKS = UIKit
    include $(THEOS_MAKE_PATH)/tweak.mk
    after-install::
        install.exec "killall -9 SpringBoard"
    
    

    **tream.xm文件 **

    %hook SBLockScreenDateViewController
    - (void)setCustomSubtitleText:(id)arg1 withColor:(id)arg2
    {
        NSString *str = @"主人翁健康专注小儿推拿!";
        %orig(str, arg2);
    }
    %end
    
    %hook SpringBoard
     - (void)applicationDidFinishLaunching:(id)application
        {
            %orig;
            UIAlertView *alert = [[UIAlertView alloc]
                                  initWithTitle:@"Come to http://bbs.iosre.com for more fun!" message:nil delegate:self cancelButtonTitle:@"OK"
                                  otherButtonTitles:nil];
            [alert show];
            [alert release];
     }
    %end
    
    

    最后编译运行

    这么问题解决了展示下最后做的效果

    Snip20160702_11.png

    相关文章

      网友评论

      • 魏天晨:不好意思打扰一下,怎么发帖?我按照书上写的配置后无法make文件提示
        The "iphone " target is not supported on the “macosx” platform. Stop.
      • HChase:升级了macOS Mojave 10.14 , Xcode10 后make 编译的时候报错

        include path for stdlibc++ headers not found; pass '-std=libc++' on the
        command line to use the libc++ standard library instead
        [-Werror,-Wstdlibcxx-not-found]

        楼主知道怎么解决吗?
      • 顺其自然2017:您好,在吗?我有一个问题想请教一下,就是编译(make)的时候报错,说是没有对应的SDK,后来又出现 xcrun: error: SDK "iphoneos" cannot be located这个错误,不知道您能不能指点一下
        顺其自然2017:@Mr卿 ,好的我试试看,还有一个问题就是,你试过hook NSURLSession 或者是 NSURLConnect之类的函数吗?,好想不起作用
        Mr卿:@Mr卿 /Applications/Xcode.app 是你xcode的路径 一般来说是这个路径(/Applications/Xcode.app)
        Mr卿:sudo xcode-select --switch /Applications/Xcode.app
      • 草原野马:Tweak.xm:2: error: Tweak.xm…的问题重新写 这个下面的问题,是怎么解决的啊。
      • 指尖猿:楼主在吗?请教一个问题
      • ea44b28b8ca7:报错 Error: The vendor/include and/or vendor/lib directories are missing. Please run `git submodule update --init --recursive` in your Theos directory. More information: https://github.com/theos/theos/wiki/Installation.没有解决掉,企鹅号647898002
        伤心于泪:/opt/theos/makefiles/instance/library.mk:32: *** multiple target patterns. Stop. 这个怎么解决
        哎呦不错哦哦哦:cd到你these目录 我的是cd /opt/theos
        然后sudo git submodule update --init --recursive
      • ea44b28b8ca7:楼主遇到相同的问题没有解决掉,请教请教呀
      • 水田夏木:解决了重要问题,谢谢博主!
      • 小驴拉磨:我想问一下,这个主要用在什么地方
        子夜_0b7a:> Making all for tweak iOSReGreetings…
        ==> Preprocessing Tweak.xm…
        ==> Compiling Tweak.xm (armv7)…
        ==> Linking tweak iOSReGreetings (armv7)…
        ==> Generating debug symbols for iOSReGreetings…
        ==> Preprocessing Tweak.xm…
        ==> Compiling Tweak.xm (arm64)…
        ==> Linking tweak iOSReGreetings (arm64)…
        ==> Generating debug symbols for iOSReGreetings…
        ==> Merging tweak iOSReGreetings…
        ==> Signing iOSReGreetings…
        > Making stage for tweak iOSReGreetings…
        dm.pl: building package `com.victor.iosregreetings:iphoneos-arm' in `./packages/com.victor.iosregreetings_1.0-5+debug_iphoneos-arm.deb'
        ==> Installing…
        root@192.168.2.2's password:
        (Reading database ... 4792 files and directories currently installed.)
        Preparing to unpack /tmp/_theos_install.deb ...
        Unpacking com.victor.iosregreetings (1.0-5+debug) over (1.0-4+debug) ...
        Setting up com.victor.iosregreetings (1.0-5+debug) ...
        install.exec "killall -9 AlipayWallet"
        这算是成功了吗?
        为啥不起作用呢
        sunny冲哥:你好,
        Makefile:6: /opt/theos/makefiles/common.mk: No such file or directory
        Makefile:14: /opt/theos/makefiles/tweak.mk: No such file or directory 这个怎么处理
        thoes文件的替身也找不到
        wg689:@11玥眷麗 改写别的应用

      本文标题:iOS逆向工程thoes报错处理方案总结

      本文链接:https://www.haomeiwen.com/subject/vglqjttx.html