diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/arch/x86/qemu/testqemu.py | 6 | ||||
| -rw-r--r-- | test/arch/x86/qemu/testqemu64.py | 6 | ||||
| -rwxr-xr-x | test/os_dep/linux/stdlib.py | 2 | ||||
| -rwxr-xr-x | test/os_dep/win_api_x86_32.py | 9 |
4 files changed, 12 insertions, 11 deletions
diff --git a/test/arch/x86/qemu/testqemu.py b/test/arch/x86/qemu/testqemu.py index 594a826b..64312928 100644 --- a/test/arch/x86/qemu/testqemu.py +++ b/test/arch/x86/qemu/testqemu.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.vm.get_u32(esp + 8 + 4*i) if x == "s": - a = jitter.get_str_ansi(a) + a = jitter.get_c_str(a) elif x in ("x", 'X', "d"): pass elif x.lower() in ("f", "l"): @@ -102,7 +102,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(): 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(): diff --git a/test/os_dep/linux/stdlib.py b/test/os_dep/linux/stdlib.py index ef890625..a0432e65 100755 --- a/test/os_dep/linux/stdlib.py +++ b/test/os_dep/linux/stdlib.py @@ -33,7 +33,7 @@ class TestLinuxStdlib(unittest.TestCase): jit.push_uint32_t(buf) jit.push_uint32_t(0) # ret_ad stdlib.xxx_sprintf(jit) - ret = jit.get_str_ansi(buf) + ret = jit.get_c_str(buf) self.assertEqual(ret, "'coucou' 1111") diff --git a/test/os_dep/win_api_x86_32.py b/test/os_dep/win_api_x86_32.py index f759c6af..66a4e628 100755 --- a/test/os_dep/win_api_x86_32.py +++ b/test/os_dep/win_api_x86_32.py @@ -6,6 +6,7 @@ import unittest import logging from miasm.analysis.machine import Machine import miasm.os_dep.win_api_x86_32 as winapi +from miasm.os_dep.win_api_x86_32 import get_win_str_a, get_win_str_w from miasm.core.utils import pck32 from miasm.jitter.csts import PAGE_READ, PAGE_WRITE @@ -42,7 +43,7 @@ class TestWinAPI(unittest.TestCase): jit.push_uint32_t(buf) jit.push_uint32_t(0) # ret_ad winapi.msvcrt_sprintf(jit) - ret = jit.get_str_ansi(buf) + ret = get_win_str_a(jit, buf) self.assertEqual(ret, "'coucou' 1111") @@ -63,7 +64,7 @@ class TestWinAPI(unittest.TestCase): jit.push_uint32_t(buf) jit.push_uint32_t(0) # ret_ad winapi.msvcrt_swprintf(jit) - ret = jit.get_str_unic(buf) + ret = get_win_str_w(jit, buf) self.assertEqual(ret, u"'coucou' 1111") @@ -94,7 +95,7 @@ class TestWinAPI(unittest.TestCase): jit.push_uint32_t(size) # size jit.push_uint32_t(0) # @return winapi.kernel32_GetCurrentDirectoryA(jit) - dir_ = jit.get_str_ansi(addr) + dir_ = get_win_str_a(jit, addr) size_ret = jit.cpu.EAX self.assertEqual(len(dir_), size_ret) @@ -106,7 +107,7 @@ class TestWinAPI(unittest.TestCase): winapi.kernel32_GetCurrentDirectoryA(jit) size_ret = jit.cpu.EAX self.assertEqual(len(dir_)+1, size_ret) - dir_short = jit.get_str_ansi(addr) + dir_short = get_win_str_a(jit, addr) self.assertEqual(dir_short, dir_[:4]) def test_MemoryManagementFunctions(self): |