summaryrefslogtreecommitdiff
path: root/tests/format/elf/oob_section_name.py
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2015-11-04 22:02:31 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2015-11-04 22:02:31 (GMT)
commit4bafbf79e8143941d744c9c47e6fc9216fcec47a (patch)
treee0dc679daaa255d289c84ab0630e42256ab7a58c /tests/format/elf/oob_section_name.py
parent72da49fdf05285169a9465b34f7869dafc4715ec (diff)
Fixed some bugs and defined some first test cases.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@604 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'tests/format/elf/oob_section_name.py')
-rw-r--r--tests/format/elf/oob_section_name.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/format/elf/oob_section_name.py b/tests/format/elf/oob_section_name.py
new file mode 100644
index 0000000..da58e29
--- /dev/null
+++ b/tests/format/elf/oob_section_name.py
@@ -0,0 +1,24 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
+
+# Une section peut avoir un index pour son nom démesurément grand (et invalide).
+#
+# Si la section des chaînes de caractères est toute aussi grande et invalide,
+# l'index invalide reste suffisamment cohérent pour passer les premiers tests
+# de extract_name_from_elf_string_section() et conduire ensuite à un plantage
+# lors de l'accès concret, au moment de l'appel à strlen().
+
+
+import pychrysalide
+
+from pychrysalide.analysis.contents import FileContent
+from pychrysalide.format.elf import ElfFormat
+
+cnt = FileContent("oob_section_name")
+
+fmt = ElfFormat(cnt)
+
+print(fmt)
+
+print(isinstance(fmt, ElfFormat))