Skip to content

Commit

Permalink
move API name normalization to helper function
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-hunhoff committed Apr 6, 2022
1 parent 6947497 commit e3c749d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 3 additions & 0 deletions capa/features/extractors/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ def generate_symbols(dll: str, symbol: str) -> Iterator[str]:
- CreateFileA
- CreateFile
"""
# normalize dll name
dll = dll.lower()

# kernel32.CreateFileA
yield "%s.%s" % (dll, symbol)

Expand Down
5 changes: 0 additions & 5 deletions capa/features/insn.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@

class API(Feature):
def __init__(self, name: str, description=None):
# Downcase library name if given
if "." in name:
modname, _, impname = name.rpartition(".")
name = modname.lower() + "." + impname

super(API, self).__init__(name, description=description)


Expand Down

0 comments on commit e3c749d

Please sign in to comment.