diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2019-11-02 22:24:23 +0100 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2019-11-12 15:10:44 +0100 |
| commit | 4dc802e3544e669cfea1d6be8a01ca2a2600dfef (patch) | |
| tree | 96a79b40469c1db9201ca46b210503d4dcf378c5 /test/arch/x86/qemu/testqemu64.py | |
| parent | 83e54bd2de945a36ab5ccd4cc5b94817d7cb0112 (diff) | |
| download | focaccia-miasm-4dc802e3544e669cfea1d6be8a01ca2a2600dfef.tar.gz focaccia-miasm-4dc802e3544e669cfea1d6be8a01ca2a2600dfef.zip | |
Clear get_str_* API
get_str_ansi decoded strings using utf8 and was blindly used for pure windows function (LoadLibraryA) and for stdlib functions (printf, strlen, ...) even if strlen does not use utf8... New API is: get_win_str_a/get_win_str_w and set_win_str_a/set_win_str_w for windows (respectively codepage1252/windows utf16) .Those functions should only be used in windows strings manipulations, so there are taken out of the jitter. get_c_str/set_c_str: as those functions are "classic" in OSes, they are keeped in the jitter.
Diffstat (limited to 'test/arch/x86/qemu/testqemu64.py')
| -rw-r--r-- | test/arch/x86/qemu/testqemu64.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/arch/x86/qemu/testqemu64.py b/test/arch/x86/qemu/testqemu64.py index 636cb6a9..8d25ca68 100644 --- a/test/arch/x86/qemu/testqemu64.py +++ b/test/arch/x86/qemu/testqemu64.py @@ -48,7 +48,7 @@ def xxx___printf_chk(jitter): ret_ad, args = jitter.func_args_systemv(["out", "format"]) if args.out != 1: raise RuntimeError("Not implemented") - fmt = jitter.get_str_ansi(args.format) + fmt = jitter.get_c_str(args.format) # Manage llx fmt = fmt.replace("llx", "lx") fmt = fmt.replace("%016lx", "%016z") @@ -60,7 +60,7 @@ def xxx___printf_chk(jitter): for x in fmt_a: a = jitter.get_arg_n_systemv(2 + i) if x == "s": - a = jitter.get_str_ansi(a) + a = jitter.get_c_str(a) elif x in ("x", 'X', 'd', 'z', 'Z'): pass elif x.lower() in ("f","l"): @@ -98,7 +98,7 @@ def xxx_puts(jitter): writes the string s and a trailing newline to stdout. ''' ret_addr, args = jitter.func_args_systemv(['target']) - output = jitter.get_str_ansi(args.target) + output = jitter.get_c_str(args.target) # Check with expected result line = next(expected) if output != line.rstrip(): |