Skip to content

Commit

Permalink
Merge pull request mandiant#8 from re-fox/patch-1
Browse files Browse the repository at this point in the history
Adding support for msvcrt.wcslen
  • Loading branch information
drewvis authored Aug 27, 2020
2 parents de1b884 + f182fa9 commit 8b17d8e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions speakeasy/winenv/api/usermode/msvcrt.py
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,20 @@ def strlen(self, emu, argv, ctx={}):

return rv

@apihook('wcslen', argc=1, conv=e_arch.CALL_CONV_CDECL)
def wcslen(self, emu, argv, ctx={}):
"""
size_t wcslen(
const wchar_t* wcs
);
"""
s, = argv
string = self.read_wide_string(s)
argv[0] = string
rv = len(string)

return rv

@apihook('_lock', argc=1, conv=e_arch.CALL_CONV_CDECL)
def _lock(self, emu, argv, ctx={}):
"""
Expand Down

0 comments on commit 8b17d8e

Please sign in to comment.