Skip to content

Commit

Permalink
dnfile 0.15.0 changed API (#105)
Browse files Browse the repository at this point in the history
* dnfile 0.15.0 changed API

* fix type check
  • Loading branch information
malwarefrank authored Apr 10, 2024
1 parent 59b5557 commit b7c0f19
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions scripts/print_cil_from_dn_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ def seek(self, offset: int) -> int:
def read_dotnet_user_string(pe: dnfile.dnPE, token: StringToken) -> Union[str, InvalidToken]:
"""read user string from #US stream"""
try:
user_string: Optional[dnfile.stream.UserString] = pe.net.user_strings.get_us(token.rid)
user_string: Optional[dnfile.stream.UserString] = pe.net.user_strings.get(token.rid)
except UnicodeDecodeError as e:
return InvalidToken(token.value)

if user_string is None:
if user_string is None or user_string.value is None:
return InvalidToken(token.value)

return user_string.value
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"black==24.3.0",
"isort==5.13.2",
"mypy==1.9.0",
"dnfile==0.14.1",
"dnfile==0.15.0",
"hexdump==3.3.0",
],
},
Expand Down

0 comments on commit b7c0f19

Please sign in to comment.