(ql: Qiling, key: bytes, key_address)
| 25 | ql.emu_stop() |
| 26 | |
| 27 | def one_round(ql: Qiling, key: bytes, key_address): |
| 28 | gkeys = generate_key(key) |
| 29 | ql.mem.write(key_address, gkeys) |
| 30 | ql.run(begin=verfication_start_ip, end=verfication_start_ip+6) |
| 31 | lba37 = ql.mem.read(ql.arch.regs.sp + 0x220, 0x200) |
| 32 | for ch in lba37: |
| 33 | if ch != 0x37: |
| 34 | return False |
| 35 | return True |
| 36 | |
| 37 | # In this stage, we show that the password is correct. |
| 38 | def third_stage(key): |
no test coverage detected