2011-12-02 60 views
5

我想反編譯iOS Twitter框架,如果事實上我從xcode的模擬器中獲取twitterd文件,它預編譯爲在x86(?)上運行,而不是ARM。 至於工具,我用http://code.google.com/p/i386codedump/ 指令:反編譯Obj C框架

Usage: code-dump [options] <mach-o-file> where options are: 
    -a    show instance variable offsets 
    -A    show implementation addresses 
    --arch <arch> choose a specific architecture from a universal binary (ppc, i386, etc.) 
    -C <regex>  only display classes matching regular expression 
    -H    generate header files in current directory, or directory specified with -o 
    -I    sort classes, categories, and protocols by inheritance (overrides -s) 
    -o <dir>  output directory used for -H 
    -r    recursively expand frameworks and fixed VM shared libraries 
    -s    sort classes and categories by name 
    -S    sort methods by name 
    -t    suppress header in output, for testing 
    -d    decompile 
    -D <arch>  decompilation architecture 

我有點不明白我需要什麼選項拿,那我怎麼努力:

iMac:documents $ ./code-dump -d twitterd 
2011-12-02 18:56:35.885 code-dump[1643:707] feedface, ao: 0 
2011-12-02 18:56:35.886 code-dump[1643:707] process: feedface (86000) 
/* 
*  Generated by code-dump 2.0. 
*/ 
This file does not contain any Objective-C runtime information. 
2011-12-02 18:56:35.888 code-dump[1643:707] Building lookup table... 
2011-12-02 18:56:40.308 code-dump[1643:707] Finished lookup table 
/usr/bin/lipo: input file (twitterd) must be a fat file when the -extract option is specified 
2011-12-02 18:56:40.868 code-dump[1643:707] CDAssemblyProcessor, 22288 instructions, 0 functions 
Segmentation fault: 11 

這是什麼意思,我需要什麼去做? :)

+2

「我想反編譯iOS Twitter框架」=>也許你應該問如何去做任何你希望用這個信息做的事情,而不是嘗試去反編譯框架...... –

回答

4

該文件不包含任何Objective-C運行時信息。

這意味着該文件沒有定義任何類,協議或類別。它可能使用objective-c,但它不包含有關它使用的類的任何有用信息。

CDAssemblyProcessor,22288級的指令,0功能

這表明該文件有其象徵剝離。它包含代碼,但沒有指示任何函數開始或結束的位置,因此無法反編譯。

你得到這些是因爲twitterd不是框架,它是框架中包含的程序。實際框架代碼位於Twitter文件中。如果你試圖反編譯,那麼你至少會得到一些Objective-C頭文件。我建議使用-H選項,以便將標題創建爲當前目錄中的文件。沒有它,頭文件將會陸續發送到您的終端,並且很難找到任何東西。但是,它最有可能已經剝離了大部分符號,所以反編譯不會太多。