def get_string(self, offset):
""" Get the string stored at the given offset in this string table.
"""
- return parse_cstring_from_stream(self._stream,
- self._table_offset + offset)
+ s = parse_cstring_from_stream(self._stream, self._table_offset + offset)
+ return s.decode('utf-8') if s else ''
class DynamicTag(object):
for t in segment.iter_tags():
if t.entry.d_tag == 'DT_NEEDED':
- libs.append(t.needed.decode('utf-8'))
+ libs.append(t.needed)
exp = ['libc.so.6']
self.assertEqual(libs, exp)
symbol_names = [x.name for x in segment.iter_symbols()]
- exp = [b'', b'__libc_start_main', b'__gmon_start__', b'abort']
+ exp = ['', '__libc_start_main', '__gmon_start__', 'abort']
self.assertEqual(symbol_names, exp)
def test_sunw_tags(self):