From c07316ab743885a216f08146fbcda4a8ce2f2945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E9=BA=9F?= <37041372+f0rm2l1n@users.noreply.github.com> Date: Mon, 13 Nov 2023 02:46:16 +0800 Subject: [PATCH] Update momo_3 solve.py (#6) - remove unnecessary while loop - uses documented concrete_value instead of _model_concrete --- examples/0ctf_momo_3/solve.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/examples/0ctf_momo_3/solve.py b/examples/0ctf_momo_3/solve.py index df84202..a3ebc13 100644 --- a/examples/0ctf_momo_3/solve.py +++ b/examples/0ctf_momo_3/solve.py @@ -74,17 +74,11 @@ def main(): assert len(e.found) == 1 np = e.found[0] - while True: - nb_size = target - np.addr - if nb_size <= 0: - break - np = p.factory.successors(np, size=nb_size).flat_successors[0] + nb_size = target - np.addr assert nb_size == 0 - al = np.regs.eax[7:0] - dl = np.regs.edx[7:0] - al_val = al._model_concrete.value - dl_val = dl._model_concrete.value + al_val = np.regs.al.concrete_value + dl_val = np.regs.dl.concrete_value if al_val == dl_val: flag_arr.append(ord(trychar))