在MACOS上编译IDA Pro插件

在MACOS上编译IDA Pro插件

Building IDA Pro plugins on MACOS

环境:

  • MAC OS 10.14
  • IDASDK 70
  • IDA 7.0

主要参考idasdk70/install_make.txt

  1. 下载idasdk70
  2. 将需要编译的插件放在plugins目录下
  3. export PATH=/path/to/idasdk70/bin:$PATH,按照install_make.txt中的步骤
  4. patch以下文件,
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
diff -urN idasdk70_origin/allmake.unx idasdk70_ori/allmake.unx
--- idasdk70_origin/allmake.unx 2017-09-14 15:09:26.000000000 +0800
+++ idasdk70_ori/allmake.unx 2020-06-06 18:57:34.000000000 +0800
@@ -151,6 +151,10 @@
MACSDK=/opt/mac/SDKs/MacOSX10.4u.sdk
MACSDKVER=1004
else
+ MACSDK := $(shell /usr/bin/xcrun --sdk macosx --show-sdk-path)
+ MACSDKVER=1014
+ endif
+ ifndef MACSDK
$(error Could not find MacOSX SDK)
endif
endif
@@ -283,7 +287,7 @@
FORMAT_WARNS= # turn off because the cross compiler does not understand them
else
_OUTDLL+=-current_version 1.0 -compatibility_version 1.0 -single_module
- SYSROOT=-mmacosx-version-min=10.5 -isysroot $(MACSDK)
+ SYSROOT=-mmacosx-version-min=10.9 -isysroot $(MACSDK)
ifdef __X64__
ASM_ARCH_CFLAGS=-arch x86_64
else
diff -urN idasdk70_origin/makefile idasdk70_ori/makefile
--- idasdk70_origin/makefile 2017-09-14 15:09:28.000000000 +0800
+++ idasdk70_ori/makefile 2020-06-06 14:57:58.000000000 +0800
@@ -4,7 +4,8 @@
ENV := env
endif

-ALLDIRS=module ldr plugins
+# ALLDIRS=module ldr plugins
+ALLDIRS=plugins

.PHONY: env $(ALLDIRS) all
diff -urN idasdk70_origin/plugins/makefile idasdk70_ori/plugins/makefile
--- idasdk70_origin/plugins/makefile 2017-09-14 15:09:28.000000000 +0800
+++ idasdk70_ori/plugins/makefile 2020-06-06 19:18:16.000000000 +0800
@@ -5,7 +5,6 @@
choose \
custdata \
custview \
- debugger \
ex_debidc \
ex_events1 \
extlang \
@@ -22,7 +21,6 @@
mtsample \
navcolor \
openform \
- pdb \
procext \
script_plg \
snapshots \
  1. make __MAC__=1生成IDA32的插件
  2. make __MAC__=1 __EA__=1生成IDA64的插件
  3. 如果没有出现什么问题的话,你可以在/path/to/idasdk/bin/plugins/下找到你的.dylib