Skip to content

Commit

Permalink
Update momo_3 solve.py (#6)
Browse files Browse the repository at this point in the history
- remove unnecessary while loop
- uses documented concrete_value instead of _model_concrete
  • Loading branch information
f0rm2l1n authored Nov 12, 2023
1 parent 80df282 commit c07316a
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions examples/0ctf_momo_3/solve.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit c07316a

Please sign in to comment.