File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ def test_guids():
64
64
assert dn .net .guids .get (0 ) is None
65
65
assert dn .net .guids .get (1 ).value == b"\x8c \x8b \xc5 \x48 \xff \x24 \x91 \x45 \x9e \xc8 \x94 \xbf \xea \xbd \x9f \x3e "
66
66
67
+
67
68
def test_tables ():
68
69
path = fixtures .get_data_path_by_name ("hello-world.exe" )
69
70
@@ -313,6 +314,8 @@ def test_heap_items():
313
314
assert str_item .encoding == "utf-8"
314
315
assert str_item .value == buf_decoded
315
316
assert str_item == buf_decoded
317
+ assert len (str_item ) == len (buf_decoded )
318
+ assert str_item [5 ] == buf_decoded [5 ]
316
319
317
320
# HeapItemBinary
318
321
buf_with_compressed_int_len = b"\x0a 1234567890"
@@ -324,10 +327,14 @@ def test_heap_items():
324
327
assert bin_item == buf
325
328
326
329
# UserString
327
- buf_with_flag = b"\x0b 1234567890 \x00 "
328
- buf = b "1234567890"
330
+ buf_with_flag = b"\x15 1 \x00 2 \x00 3 \x00 4 \x00 5 \x00 6 \x00 7 \x00 8 \x00 9 \x00 0 \x00 \x00 "
331
+ us_str = "1234567890"
329
332
us_item = dnfile .stream .UserString (buf_with_flag )
330
333
assert us_item .to_bytes () == buf_with_flag
334
+ assert us_item .value == us_str
335
+ assert us_item == us_str
336
+ assert len (us_item ) == len (us_str )
337
+ assert us_item [5 ] == us_str [5 ]
331
338
332
339
# GUID
333
340
guid_bytes = b"\x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a \x0b \x0c \x0d \x0e \x0f "
You can’t perform that action at this time.
0 commit comments