Binary Ninja offline MSDN

Table of Contents

As I did not want to always go online, I missed the old offline MSDN library and wanted to have something like that again. For IDA there seemed to be an annotating plugin MSDN Annotations, however it looks like the Microsoft download link got removed.

So via Discord rattle posted this link “Ghidra + MSDN Offline Library” which has a still working ISO with a Help Viewer. It is not the newest help but for core Windows functionality not that much should have changed.

I installed the MSDN from the ISO to my D: drive and after a hint from the Binary Ninja discord, the script ended up like this (so based on rattle’s script)

import shlex
import os
import subprocess

def searchMSDN(topic):
    def getViewerPath(*commonFilesPathCandidates):
        for baseDir in commonFilesPathCandidates:
            path = os.path.join(baseDir, 'microsoft shared', 'Help 9', 'dexplore.exe')
            if os.path.exists(path):
                return path
    viewer = getViewerPath(
        os.environ.get('CommonProgramFiles(x86)', ''),
        os.environ.get('CommonProgramFiles', ''),
        R'C:\Program Files (x86)\Common Files',
        R'C:\Program Files\Common Files',
        R'D:\\' # added this path as for me it is installed on D drive
    )
    command = '"{}" /helpcol ms-help://MS.MSDNQTR.v90.en /LaunchFKeywordTopic {}'.format(viewer, topic)
    return subprocess.call(shlex.split(command))



try:
    searchMSDN(repr(uicontext.token.token))
except Exception as E:
    print('ERROR: Help lookup failed: {}'.format(E))


This code is a snippet with a keybinding in my Binary Ninja, so I can left click on a function and press the key to load the viewer.

select

msdn