Skip to content

Commit

Permalink
Ran black on a few other source files, no functional changes
Browse files Browse the repository at this point in the history
  • Loading branch information
erocarrera committed Sep 3, 2021
1 parent 99cde43 commit 9a642b9
Show file tree
Hide file tree
Showing 5 changed files with 866 additions and 763 deletions.
22 changes: 13 additions & 9 deletions ordlookup/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,37 @@
from . import ws2_32
from . import oleaut32

'''
"""
A small module for keeping a database of ordinal to symbol
mappings for DLLs which frequently get linked without symbolic
infoz.
'''
"""

ords = {
b'ws2_32.dll': ws2_32.ord_names,
b'wsock32.dll': ws2_32.ord_names,
b'oleaut32.dll': oleaut32.ord_names,
b"ws2_32.dll": ws2_32.ord_names,
b"wsock32.dll": ws2_32.ord_names,
b"oleaut32.dll": oleaut32.ord_names,
}

PY3 = sys.version_info > (3,)

if PY3:

def formatOrdString(ord_val):
return 'ord{}'.format(ord_val).encode()
return "ord{}".format(ord_val).encode()


else:

def formatOrdString(ord_val):
return b'ord%d' % ord_val
return b"ord%d" % ord_val


def ordLookup(libname, ord_val, make_name=False):
'''
"""
Lookup a name for the given ordinal if it's in our
database.
'''
"""
names = ords.get(libname.lower())
if names is None:
if make_name is True:
Expand Down
Loading

0 comments on commit 9a642b9

Please sign in to comment.