README.md 3.7 KB
Newer Older
冯建华(冯子) 已提交
1
#### IDA7.0_SP
冯建华 已提交
2 3
- Fixed when multiply input method the IDA pro7.0 on mojave, ida will crash in non-english input method.
- Fixed shortcuts do not work in non-english input method. Eg: F2, tab, ctrl+enter etc.
冯建华(冯子) 已提交
4 5
- Added load bundle for open dialog (The official Qt does not support this feature, but this is suitable for ida
)
F
fjh658 已提交
6 7 8 9 10 11 12 13
```
Replace the "libqcocoa.dylib" to 
/Applications/IDA Pro 7.0/ida.app/Contents/PlugIns/platforms/libqcocoa.dylib
```



#### Binary file checksum:
F
fjh658 已提交
14

冯建华 已提交
15 16
```
md5 libqcocoa.dylib
冯建华(冯子) 已提交
17
MD5 (libqcocoa.dylib) = 9c8fa1ec2d16bc18e326f362918b0cb9
冯建华 已提交
18 19

shasum libqcocoa.dylib
冯建华(冯子) 已提交
20
23d94e8dae902515f1587e4bda8292e536c8e25a  libqcocoa.dylib
冯建华 已提交
21
```
F
fjh658 已提交
22

F
fjh658 已提交
23 24 25 26 27




#### Detail:
冯建华(冯子) 已提交
28 29
#### Added load bundle for open dialog
![](./images/load_bundle_open_dlg.png)
F
fjh658 已提交
30 31 32 33

#### When multiply input method the IDA pro7.0 on mojave, ida will crash in non-english input method.

![](./images/ida7.0_crash.png)
F
fjh658 已提交
34 35
------

F
fjh658 已提交
36 37 38 39
##### Solution: 
##### ida7.0 using Qt5.6

##### **crash stack:**
F
fjh658 已提交
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74

```
Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x00003eadde8f1958
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [13886]  

Application Specific Information:
objc_msgSend() selector name: length

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libobjc.A.dylib               	0x00007fff686faa1d objc_msgSend + 29
1   org.qt-project.QtCore         	0x0000000101903924 QT::QCFString::toQString(__CFString const*) + 52
2   libqcocoa.dylib               	0x0000000103508f67 0x1034c0000 + 298855
```

Cause:
``` c++
    TISInputSourceRef source = TISCopyCurrentKeyboardInputSource();
    CFArrayRef languages = (CFArrayRef) TISGetInputSourceProperty(source, kTISPropertyInputSourceLanguages);
    if (CFArrayGetCount(languages) > 0) {
        CFStringRef langRef = (CFStringRef)CFArrayGetValueAtIndex(languages, 0);
        QString name = QCFString::toQString(langRef);
        QLocale locale(name);
        if (m_locale != locale) {
            m_locale = locale;
            emitLocaleChanged();
        }
        CFRelease(langRef);
    }
```

F
fjh658 已提交
75
**langRef** dangling pointer
F
fjh658 已提交
76 77 78

#### Fixed:
``` c++
F
fjh658 已提交
79 80
#import <Foundation/Foundation.h>

F
fjh658 已提交
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
void QCocoaInputContext::updateLocale()
{
    /* https://bugreports.qt.io/browse/QTBUG-48772

    TISInputSourceRef source = TISCopyCurrentKeyboardInputSource();
    CFArrayRef languages = (CFArrayRef) TISGetInputSourceProperty(source, kTISPropertyInputSourceLanguages);
    if (CFArrayGetCount(languages) > 0) {
        CFStringRef langRef = (CFStringRef)CFArrayGetValueAtIndex(languages, 0);
        QString name = QCFString::toQString(langRef);
        QLocale locale(name);
        if (m_locale != locale) {
            m_locale = locale;
            emitLocaleChanged();
        }
        CFRelease(langRef);
    }
    
    */

    QString name = QString::fromNSString([[NSLocale currentLocale] objectForKey:NSLocaleIdentifier]);
    QLocale locale(name);
    if (m_locale != locale) {
        m_locale = locale;
        emitLocaleChanged();
    }
} 
```

F
fjh658 已提交
109
#### Recompile Qt5.6
冯建华(冯子) 已提交
110
**Download (Xcode10 supported)** 
F
fjh658 已提交
111 112 113 114 115 116 117 118 119 120 121
```
https://download.developer.apple.com/Developer_Tools/Xcode_7.3.1/Xcode_7.3.1.dmg
```

**Switch**
```
sudo xcode-select -switch /Applications/Xcode7.app/Contents/Developer
```

**Compile argument**

F
fjh658 已提交
122 123 124 125
```
sh configure "-nomake" "tests" "-qtnamespace" "QT" "-confirm-license" "-accessibility" "-opensource" "-force-debug-info" "-platform" "macx-g++" "-debug-and-release" "-fontconfig" "-qt-freetype" "-qt-libpng" "-qt-sql-sqlite" "-prefix" "Qt/5.6.0-x64"
```
FAQ
F
fjh658 已提交
126

F
fjh658 已提交
127 128
Xcode not set up properly. You may need to confirm the license agreement by running /usr/bin/xcodebuild.

F
fjh658 已提交
129 130 131 132

```
Replace "/usr/bin/xcrun -find xcrun" 
to "/usr/bin/xcrun -find xcodebuild"  
F
fjh658 已提交
133
```
F
fjh658 已提交
134