免责声明:本文仅供学习和研究使用,请勿将其用于非法用途。破解软件违反相关法律法规,请尊重知识产权。作者不对任何非法使用或后果负责。

IDA Pro 是一款强大的逆向工程工具,学习逆向工程不可或缺。以下教程是基于 M1 系列芯片的 Mac 设备,教你如何安装和破解 IDA Pro 9.0 Beta。


一、环境与文件准备

在开始安装和破解之前,需要准备以下环境和文件:

1.1 文件准备

需要以下两个文件:

  1. idapro_90_armmac.app.zip:IDA Pro 9.0 Beta 的安装包。
    链接: https://pan.baidu.com/s/1rRvodNhynLezLrvkpbbVlw 提取码: u3wr

  2. crack.py:用于生成密钥和破解文件的 Python 脚本。【随便改下name和email就行】

Text
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
import json
import hashlib
import os

# originally made by alula
# v3 - auth.lol
license = {
"header": {"version": 1},
"payload": {
"name": "OrientalGlass", # 随便改一个名字
"email": "oriental0glass@gmail.com", # 随便改一个邮箱
"licenses": [
{
"description": "license",
"edition_id": "ida-pro",
"id": "48-2137-ACAB-99",
"license_type": "named",
"product": "IDA",
"seats": 1,
"start_date": "2024-08-10 00:00:00",
"end_date": "2033-12-31 23:59:59", # This can't be more than 10 years!
"issued_on": "2024-08-10 00:00:00",
"owner": "",
"product_id": "IDAPRO",
"product_version": "9.1",
"add_ons": [
# {
# "id": "48-1337-DEAD-01",
# "code": "HEXX86L",
# "owner": "48-0000-0000-00",
# "start_date": "2024-08-10 00:00:00",
# "end_date": "2033-12-31 23:59:59",
# },
# {
# "id": "48-1337-DEAD-02",
# "code": "HEXX64L",
# "owner": "48-0000-0000-00",
# "start_date": "2024-08-10 00:00:00",
# "end_date": "2033-12-31 23:59:59",
# },
],
"features": [],
}
],
},
}


def add_every_addon(license):
platforms = [
"W", # Windows
"L", # Linux
"M", # macOS
]
addons = [
"HEXX86",
"HEXX64",
"HEXARM",
"HEXARM64",
"HEXMIPS",
"HEXMIPS64",
"HEXPPC",
"HEXPPC64",
"HEXRV64",
"HEXARC",
"HEXARC64",
# Probably cloud?
# "HEXCX86",
# "HEXCX64",
# "HEXCARM",
# "HEXCARM64",
# "HEXCMIPS",
# "HEXCMIPS64",
# "HEXCPPC",
# "HEXCPPC64",
# "HEXCRV",
# "HEXCRV64",
# "HEXCARC",
# "HEXCARC64",
]

i = 0
for addon in addons:
i += 1
license["payload"]["licenses"][0]["add_ons"].append(
{
"id": f"48-1337-DEAD-{i:02}",
"code": addon,
"owner": license["payload"]["licenses"][0]["id"],
"start_date": "2024-08-10 00:00:00",
"end_date": "2033-12-31 23:59:59",
}
)
# for addon in addons:
# for platform in platforms:
# i += 1
# license["payload"]["licenses"][0]["add_ons"].append(
# {
# "id": f"48-1337-DEAD-{i:02}",
# "code": addon + platform,
# "owner": license["payload"]["licenses"][0]["id"],
# "start_date": "2024-08-10 00:00:00",
# "end_date": "2033-12-31 23:59:59",
# }
# )


add_every_addon(license)


def json_stringify_alphabetical(obj):
return json.dumps(obj, sort_keys=True, separators=(",", ":"))


def buf_to_bigint(buf):
return int.from_bytes(buf, byteorder="little")


def bigint_to_buf(i):
return i.to_bytes((i.bit_length() + 7) // 8, byteorder="little")


# Yup, you only have to patch 5c -> cb in libida64.so
pub_modulus_hexrays = buf_to_bigint(
bytes.fromhex(
"edfd425cf978546e8911225884436c57140525650bcf6ebfe80edbc5fb1de68f4c66c29cb22eb668788afcb0abbb718044584b810f8970cddf227385f75d5dddd91d4f18937a08aa83b28c49d12dc92e7505bb38809e91bd0fbd2f2e6ab1d2e33c0c55d5bddd478ee8bf845fcef3c82b9d2929ecb71f4d1b3db96e3a8e7aaf93"
)
)
pub_modulus_patched = buf_to_bigint(
bytes.fromhex(
"edfd42cbf978546e8911225884436c57140525650bcf6ebfe80edbc5fb1de68f4c66c29cb22eb668788afcb0abbb718044584b810f8970cddf227385f75d5dddd91d4f18937a08aa83b28c49d12dc92e7505bb38809e91bd0fbd2f2e6ab1d2e33c0c55d5bddd478ee8bf845fcef3c82b9d2929ecb71f4d1b3db96e3a8e7aaf93"
)
)

private_key = buf_to_bigint(
bytes.fromhex(
"77c86abbb7f3bb134436797b68ff47beb1a5457816608dbfb72641814dd464dd640d711d5732d3017a1c4e63d835822f00a4eab619a2c4791cf33f9f57f9c2ae4d9eed9981e79ac9b8f8a411f68f25b9f0c05d04d11e22a3a0d8d4672b56a61f1532282ff4e4e74759e832b70e98b9d102d07e9fb9ba8d15810b144970029874"
)
)


def decrypt(message):
decrypted = pow(buf_to_bigint(message), exponent, pub_modulus_patched)
decrypted = bigint_to_buf(decrypted)
return decrypted[::-1]


def encrypt(message):
encrypted = pow(buf_to_bigint(message[::-1]), private_key, pub_modulus_patched)
encrypted = bigint_to_buf(encrypted)
return encrypted


exponent = 0x13


def sign_hexlic(payload: dict) -> str:
data = {"payload": payload}
data_str = json_stringify_alphabetical(data)

buffer = bytearray(128)
# first 33 bytes are random
for i in range(33):
buffer[i] = 0x42

# compute sha256 of the data
sha256 = hashlib.sha256()
sha256.update(data_str.encode())
digest = sha256.digest()

# copy the sha256 digest to the buffer
for i in range(32):
buffer[33 + i] = digest[i]

# encrypt the buffer
encrypted = encrypt(buffer)

return encrypted.hex().upper()


def generate_patched_dll(filename):
if not os.path.exists(filename):
print(f"Didn't find {filename}, skipping patch generation")
return

with open(filename, "rb") as f:
data = f.read()

if data.find(bytes.fromhex("EDFD42CBF978")) != -1:
print(f"{filename} looks to be already patched :)")
return

if data.find(bytes.fromhex("EDFD425CF978")) == -1:
print(f"{filename} doesn't contain the original modulus.")
return

data = data.replace(
bytes.fromhex("EDFD425CF978"), bytes.fromhex("EDFD42CBF978")
)

patched_filename = f"{filename}.patched"
with open(patched_filename, "wb") as f:
f.write(data)

print(f"Generated modulus patch to {patched_filename}! To apply the patch, replace the original file with the patched file")


# message = bytes.fromhex(license["signature"])
# print(decrypt(message).hex())
# print(encrypt(decrypt(message)).hex())

license["signature"] = sign_hexlic(license["payload"])

serialized = json_stringify_alphabetical(license)

# write to ida.hexlic
filename = "idapro.hexlic"

with open(filename, "w") as f:
f.write(serialized)

print(f"Saved new license to {filename}!")

generate_patched_dll("ida32.dll")
generate_patched_dll("ida.dll")
generate_patched_dll("libida32.so")
generate_patched_dll("libida.so")
generate_patched_dll("libida32.dylib")
generate_patched_dll("libida.dylib")

1.2 Python 环境

IDA Pro 要求 Python 3.4 或更高版本。如果你的 Mac 没有安装 Python,可以使用以下方法安装:

  • 打开终端,输入以下命令安装 Python(推荐使用 Homebrew):

    1
    brew install python
  • 检查 Python 版本:

    1
    python3 --version

确保 Python 版本为 3.4 或更高。

1.3 关闭 SIP(System Integrity Protection)

由于破解过程需要修改系统文件,必须关闭 SIP。

关闭 SIP 的步骤:

  1. 关机后按住电源按钮,直到进入 恢复模式

  2. 点击 选项,输入管理员密码。

  3. 在左上角点击 实用工具,选择 终端

  4. 在终端中输入以下命令:

    1
    csrutil disable
  5. 按提示输入管理员密码,确认后重启电脑。

关闭 SIP 后,可以通过以下命令检查状态:

1
csrutil status

显示 System Integrity Protection status: disabled. 表示 SIP 已关闭。

alt text


二、安装 IDA Pro 9.0 Beta

2.1 解压安装包

双击解压 idapro_90_armmac.app.zip,得到一个文件夹 idapro_90_armmac

alt text

2.2 安装 IDA Pro

双击文件夹中的 idapro_90_armmac,进入安装界面,按照提示完成安装。

安装完成后,IDA Pro 的默认路径为 /Applications/idapro.app


三、破解 IDA Pro 9.0 Beta

3.1 使用 Python 脚本生成密钥

  1. crack_i.py 脚本复制到/Applications/IDA Professional 9.0.app/Contents/MacOS/目录下,打开终端,导航到脚本所在目录:
1
cd /Applications/IDA Professional 9.0.app/Contents/MacOS/
  1. 运行脚本:

    1
    python3 crack_ida90_beta.py
  2. 执行后会生成idalic.hexliclibida.dylib.patchedlibida64.dylib.patched三个文件。

alt text


3.2 替换 IDA Pro 文件

  1. idalic.hexlic许可证文件复制到$home/.idapro目录下。如果不知道$home目录在哪里可以使用echo $home打印出来。这是讲ida.hexlic复制到$home/.idapro目录下的结果

alt text

将libida.dylib.patched、libida64.dylib.patched替换掉安装目录下默认的libida.dylib、libida32.dylib文件。【我的是libida32,根据自己的系统架构版本,同理替换就行】


3.3 验证破解

  1. 打开 IDA Pro。

  2. 如果界面没有提示输入许可证,并且可以正常使用全部功能,说明破解成功。

alt text

alt text


四、每次安装都需重新生成 patched 文件

由于 IDA Pro 9.0 Beta 的破解机制,可能需要每次安装都重新生成 patched 文件。具体原因是 IDA Pro 在运行时会验证许可证文件的完整性。

解决方法:

  • 如果重新安装 IDA Pro,重复以上步骤即可。

  • 如果破解后仍然提示许可证错误,建议检查 Python 脚本的版本是否与 IDA Pro 9.0 Beta 匹配。


五、常见问题

1. 安装时提示 Python 版本过低

  • 检查是否安装了 Python 3.4 或更高版本:

    1
    python3 --version
  • 如果版本过低,请通过 Homebrew 安装最新版 Python。

2. 替换 patched 文件后无法打开 IDA Pro

  • 检查文件路径是否正确:/Applications/idapro.app/Contents/MacOS/

  • 确认关闭了 SIP,否则系统可能会阻止文件替换。

3. 运行 Python 脚本报错

  • 检查脚本是否完整,或者重新下载脚本。

  • 确认 Python 环境是否配置正确。


六、总结

以上是 M1/M2 系列 Mac 下 IDA Pro 9.0 Beta 的破解教程。通过关闭 SIP、运行 Python 脚本生成密钥并替换文件,可以成功完成破解。希望本文能为刚入门逆向工程的同学提供一些帮助。

再次提醒:请勿将破解软件用于非法用途,尊重知识产权,支持正版软件!


如果你在操作过程中遇到问题,欢迎留言讨论或咨询。祝你学习逆向工程愉快!