简体   繁体   English

在“IDA PRO”中,让“IDAPython”在启动时导入默认模块

[英]In 'IDA PRO', let 'IDAPython' import default module at startup

We know 'IDAPython' loads several modules by default at startup, such as idaapi, idautils.... I wrote a module to let python print all numbers as hex format in the command window, which I wish can be imported each time when python loads those default modules.我们知道'IDAPython'在启动时默认加载几个模块,比如idaapi,idautils....我写了一个模块让python在命令窗口中将所有数字打印为十六进制格式,我希望每次python时都可以导入加载那些默认模块。 how to achieve that?如何做到这一点?

Create a file %APPDATA%\\Hex-Rays\\IDA Pro\\idapythonrc.py with the following content:创建一个文件%APPDATA%\\Hex-Rays\\IDA Pro\\idapythonrc.py ,内容如下:

import idaapi
idaapi.require('mymodule')

With this file in place, you can even keep mymodule.py in the same directory.有了这个文件,您甚至可以将mymodule.py保存在同一目录中。

PS IDA can tell you the path to this directory, too, which could be handy on other OSes or if the relevant company name changes again ;-). PS IDA 也可以告诉您此目录的路径,这在其他操作系统上或相关公司名称再次更改时可能很方便;-)。 Just enter:只需输入:

get_user_idadir()

at the prompt.在提示下。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM