diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2016-08-10 00:13:54 +0200 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2016-08-10 00:19:27 +0200 |
| commit | 742f8f4e7a704057b2bc26bd58a275fa4d5531a3 (patch) | |
| tree | 5d5fa2a4db05973a14451f3cbc4de8ccc2e32216 | |
| parent | c48054bc825891857abecab337232c2ef2827f6d (diff) | |
| download | miasm-742f8f4e7a704057b2bc26bd58a275fa4d5531a3.tar.gz miasm-742f8f4e7a704057b2bc26bd58a275fa4d5531a3.zip | |
Win_api: fix setfilepointer
| -rw-r--r-- | miasm2/os_dep/win_api_x86_32.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/miasm2/os_dep/win_api_x86_32.py b/miasm2/os_dep/win_api_x86_32.py index b0cee4b2..029af8b5 100644 --- a/miasm2/os_dep/win_api_x86_32.py +++ b/miasm2/os_dep/win_api_x86_32.py @@ -2264,6 +2264,8 @@ def kernel32_GetDriveType(jitter, funcname, get_str): p = get_str(jitter, args.pathname) p = p.upper() + log.debug('Drive: %r', p) + ret = 0 if p[0] == "C": ret = 3 @@ -2368,10 +2370,10 @@ def kernel32_SetFilePointer(jitter): # data = None if args.hwnd in winobjs.files_hwnd: - winobjs.files_hwnd[winobjs.module_cur_hwnd].seek(args.distance) + winobjs.files_hwnd[winobjs.module_cur_hwnd].seek(args.distance, args.movemethod) elif args.hwnd in winobjs.handle_pool: wh = winobjs.handle_pool[args.hwnd] - data = wh.info.seek(args.distance) + wh.info.seek(args.distance, args.movemethod) else: raise ValueError('unknown filename') jitter.func_ret_stdcall(ret_ad, args.distance) @@ -2396,10 +2398,10 @@ def kernel32_SetFilePointerEx(jitter): # data = None if args.hwnd in winobjs.files_hwnd: - winobjs.files_hwnd[winobjs.module_cur_hwnd].seek(distance) + winobjs.files_hwnd[winobjs.module_cur_hwnd].seek(distance, args.movemethod) elif args.hwnd in winobjs.handle_pool: wh = winobjs.handle_pool[args.hwnd] - # data = wh.info.seek(distance) + wh.info.seek(distance, args.movemethod) else: raise ValueError('unknown filename') jitter.func_ret_stdcall(ret_ad, 1) |