mirror of
https://github.com/cemu-project/idapython.git
synced 2024-12-18 05:41:55 +01:00
109158fabb
- Added AskUsingForm() with embedded forms support (check ex_askusingform.py example and formchooser.py in the SDK) - Added idautils.DecodePreviousInstruction() / DecodePrecedingInstruction() - Added idc.BeginTypeUpdating() / EndTypeUpdating() for fast batch type update operations - Added more IDP callbacks - Added UI_Hooks with a few notification events - Added idaapi.process_ui_action() / idc.ProcessUiAction() - Added netnode.index() to get netnode number - Better handling of ea_t values with bitwise negation - Execute statement hotkey (Ctrl-F3), script timeout, and other options are now configurable with Python.cfg - bugfix: idaapi.msg() / error() and warning() so they don't accept vararg - bugfix: processor_t.id constants were incorrect - bugfix: get_debug_names() was broken with IDA64 - Various bugfixes
69 lines
1.8 KiB
Python
69 lines
1.8 KiB
Python
"""
|
|
User contributed script: MSDN API HELP plugin
|
|
|
|
This script fetches the API reference (from MSDN) of a given highlighted identifier
|
|
and returns the results in a new web browser page.
|
|
|
|
This script depends on the feedparser package: http://code.google.com/p/feedparser/
|
|
|
|
10/05/2010
|
|
- initial version
|
|
|
|
|
|
"""
|
|
|
|
import idaapi
|
|
|
|
# -----------------------------------------------------------------------
|
|
class msdnapihelp_plugin_t(idaapi.plugin_t):
|
|
flags = idaapi.PLUGIN_UNL
|
|
comment = "Online MSDN API Help"
|
|
help = "Help me"
|
|
wanted_name = "MSDN API Help"
|
|
wanted_hotkey = "F3"
|
|
|
|
def init(self):
|
|
return idaapi.PLUGIN_OK
|
|
|
|
|
|
@staticmethod
|
|
def sanitize_name(name):
|
|
t = idaapi.FUNC_IMPORT_PREFIX
|
|
if name.startswith(t):
|
|
return name[len(t):]
|
|
return name
|
|
|
|
|
|
def run(self, arg):
|
|
# Get the highlighted identifier
|
|
id = idaapi.get_highlighted_identifier()
|
|
if not id:
|
|
print "No identifier was highlighted"
|
|
return
|
|
|
|
import webbrowser
|
|
|
|
try:
|
|
import feedparser
|
|
except:
|
|
idaapi.warning('Feedparser package not installed')
|
|
return
|
|
|
|
id = self.sanitize_name(id)
|
|
print "Looking up '%s' in MSDN online" % id
|
|
d = feedparser.parse("http://social.msdn.microsoft.com/Search/Feed.aspx?locale=en-us&format=RSS&Query=%s" % id)
|
|
if len(d['entries']) > 0:
|
|
url = d['entries'][0].link
|
|
webbrowser.open_new_tab(url)
|
|
else:
|
|
print "API documentation not found for: %s" % id
|
|
|
|
|
|
def term(self):
|
|
pass
|
|
|
|
|
|
# -----------------------------------------------------------------------
|
|
def PLUGIN_ENTRY():
|
|
return msdnapihelp_plugin_t()
|