diff options
| author | stanislas <stanislas.arnoud@navcert.int> | 2019-09-24 10:18:21 +0200 |
|---|---|---|
| committer | stanislas <stanislas.arnoud@navcert.int> | 2019-09-24 10:18:21 +0200 |
| commit | 4d41b8465edb7190f50a12b088d162edc53a701c (patch) | |
| tree | 6e98d5a55f8759c7601b670e85fef3649ddb0712 | |
| parent | e37e481c7bdae0dbbeb5e07d0f943b4b3840f465 (diff) | |
| download | miasm-4d41b8465edb7190f50a12b088d162edc53a701c.tar.gz miasm-4d41b8465edb7190f50a12b088d162edc53a701c.zip | |
modify CreateFile to open file in binary-mode
| -rw-r--r-- | miasm/os_dep/win_api_x86_32.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/miasm/os_dep/win_api_x86_32.py b/miasm/os_dep/win_api_x86_32.py index 5ef1b845..be6e7677 100644 --- a/miasm/os_dep/win_api_x86_32.py +++ b/miasm/os_dep/win_api_x86_32.py @@ -612,7 +612,7 @@ def kernel32_CreateFile(jitter, funcname, get_str): winobjs.lastwin32error = 80 else: # first create an empty file - open(sb_fname, 'w').close() + open(sb_fname, 'wb').close() # then open h = open(sb_fname, 'r+b') ret = winobjs.handle_pool.add(sb_fname, h) @@ -654,7 +654,7 @@ def kernel32_CreateFile(jitter, funcname, get_str): raise NotImplementedError("Untested case") # to test else: # raise NotImplementedError("Untested case") # to test - h = open(sb_fname, 'w') + h = open(sb_fname, 'wb') ret = winobjs.handle_pool.add(sb_fname, h) else: raise NotImplementedError("Untested case") |