From e134cec5fc570fd81494c2ad11710ce2bc6ecfee Mon Sep 17 00:00:00 2001 From: batuhan duras <21129845+Batugane@users.noreply.github.com> Date: Fri, 14 Jun 2024 16:25:21 +0300 Subject: [PATCH] fix: correct UTF-16 string reading in read_utf16 function --- dump_gdbindexes.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/dump_gdbindexes.py b/dump_gdbindexes.py index ffd58d7..6538d5a 100644 --- a/dump_gdbindexes.py +++ b/dump_gdbindexes.py @@ -51,12 +51,7 @@ def read_int32(f): return struct.unpack('i', v)[0] def read_utf16(f, nbcar): - # FIXME : only works with ASCII currently - val = '' - for j in range(nbcar): - val = val + '%c' % read_uint8(f) - f.read(1) - return val + return f.read(nbcar * 2).decode("utf-16le") f = open(filename, 'rb') nindexes = read_int32(f)