MCPcopy Create free account
hub / github.com/qilingframework/qiling / test_mcu_hackme_stm32f429

Method test_mcu_hackme_stm32f429

tests/test_mcu.py:403–425  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

401 del ql
402
403 def test_mcu_hackme_stm32f429(self):
404 ql = Qiling(["../examples/rootfs/mcu/stm32f429/bof.elf"],
405 archtype=QL_ARCH.CORTEX_M, ostype=QL_OS.MCU, env=stm32f429, verbose=QL_VERBOSE.DISABLED)
406
407 ql.hw.create('rcc')
408 ql.hw.create('usart2')
409 ql.hw.create('usart3')
410
411 snapshot = ql.save(hw=True)
412
413 ql.restore(snapshot)
414 ql.hw.usart3.send(b'hbckme\nabc\n')
415 ql.run(count=20000)
416
417 self.assertEqual(ql.hw.usart2.recv(), b'')
418 self.assertEqual(ql.hw.usart3.recv(), b'Wrong password!\n')
419
420 ql.restore(snapshot)
421 ql.hw.usart3.send(b'hackme\naaaaaaaaaaaaaaaaaaaa\xa9\x05\n')
422 ql.run(count=40000)
423
424 self.assertEqual(ql.hw.usart2.recv(), b'Nice Hack!\n')
425 self.assertEqual(ql.hw.usart3.recv(), b'Welcome to the world of Hacking!\naaaaaaaaaaaaaaaaaaaa\xa9\x05\n')
426
427 def test_mcu_fastmode_stm32f429(self):
428 ql = Qiling(["../examples/rootfs/mcu/stm32f429/bof.elf"],

Callers

nothing calls this directly

Calls 7

saveMethod · 0.95
restoreMethod · 0.95
runMethod · 0.95
QilingClass · 0.90
createMethod · 0.45
sendMethod · 0.45
recvMethod · 0.45

Tested by

no test coverage detected