-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Coding style, transparency to idapython plugins and redundant code #65
Comments
Well, I'm slowly realising all this redundant disorder has been boosted one level further with the introduction of modern IDAPython modules. Maybe it's better to stick with the modern interface and expect that IDAPython scripts get "modernised" as well. |
hey @invano yeah, you've highlighted a dark corner of this library that i've avoided thinking about too much :-) i often find myself cringing while implementing the IDAPython API, because there are things i'd like to change, but can't for API compatibility (e.g. returning None vs raising exceptions, etc). in any case, i think we should generally try to stick to "modern" IDAPython scripting, and primarily place constants within the "most specific module" (e.g. avoid declaring them in the existing code probably doesn't do this too well - sorry about that! side note: crazy idea: we should be able to programmatically enumerate all constants across all IDAPython modules and use that to generate code. maybe this is better than manually importing constants as necessary. |
Same holds for methods and so on. Consider
I agree that manually importing everything would be a mess. Your crazy idea makes actually sense to me! About modern/ancient API and code, there is also the API transition to IDA >= 7.0 to consider (https://www.hex-rays.com/products/ida/7.0/docs/api70_porting_guide.shtml). How do you usually behave with this? |
@invano I saw your code in master...bjchan9an:master |
Hi,
I always used python-idb for very quick stuff and it works great. However, I'd like to run some idapython scripts without having the IDA open/close bottleneck.
I'm working on the implementation of some missing idaapi and idc routines but I need some clarifications before I open any pull request.
Constants coming from
op_t
and exposed through theida_ua
module, likeo_near
,o_imm
,o_reg
and so on, can be accessed using bothidaapi
andidc
... in other words, a hypotheticalclass ida_ua
would defineo_imm = 5
, then insideclass idaapi
we geto_imm = self.api.ida_ua.o_imm
. Same forclass idc
.This is just an example for a more general question. What is the coding rule for this kind of situation?
If we mirror everything—almost 1:1—from IDAPython, then we achieve full transparency to IDAPython users and scripts at the price of redundant code. On the other hand, if we want the code to be a bit more polished, we might break compatibility with existing IDAPython scripts lying around.
The text was updated successfully, but these errors were encountered: