diff options
Diffstat (limited to 'tests/format/flat.py')
-rw-r--r-- | tests/format/flat.py | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/tests/format/flat.py b/tests/format/flat.py index 6924e42..f84f7a4 100644 --- a/tests/format/flat.py +++ b/tests/format/flat.py @@ -1,16 +1,11 @@ -#!/usr/bin/python3-dbg -# -*- coding: utf-8 -*- - - -# Tests minimalistes pour valider la gestion des erreurs relevées. - from chrysacase import ChrysalideTestCase -from pychrysalide.analysis import LoadedBinary +from pychrysalide import SourceEndian +#from pychrysalide.analysis import LoadedBinary from pychrysalide.analysis.contents import MemoryContent -from pychrysalide.arch import vmpa +#from pychrysalide.arch import vmpa from pychrysalide.format import FlatFormat -from pychrysalide.glibext import BinPortion +#from pychrysalide.glibext import BinPortion class TestFlatFormat(ChrysalideTestCase): @@ -24,18 +19,21 @@ class TestFlatFormat(ChrysalideTestCase): cnt = MemoryContent(data) - fmt = FlatFormat(cnt) - fmt.set_machine('armv7') + fmt = FlatFormat(cnt, 'armv7', SourceEndian.LITTLE) + + self.assertEqual(fmt.target_machine, 'armv7') + self.assertEqual(fmt.endianness, SourceEndian.LITTLE) + - base = vmpa(0, 0) + # base = vmpa(0, 0) - p = BinPortion(BinPortion.BPC_CODE, base, cnt.size) - p.rights = BinPortion.PAC_READ | BinPortion.PAC_EXEC + # p = BinPortion(BinPortion.BPC_CODE, base, cnt.size) + # p.rights = BinPortion.PAC_READ | BinPortion.PAC_EXEC - fmt.register_user_portion(p) + # fmt.register_user_portion(p) - binary = LoadedBinary(fmt) + # binary = LoadedBinary(fmt) - binary.analyze_and_wait() + # binary.analyze_and_wait() - self.assertTrue(list(binary.processor.instrs)[0].keyword == 'svc') + # self.assertTrue(list(binary.processor.instrs)[0].keyword == 'svc') |