@@ -141,8 +141,9 @@ def patch_mem():
141141 z = Zelos(" password_check.bin" , verbosity = 1 )
142142 # The address cmp instr observed above
143143 target_address = 0x 0040107C
144- # run to the target address and stop
145- z.plugins.runner.run_to_addr(target_address)
144+ # run to the address of cmp and break
145+ z.set_breakpoint(target_address, True )
146+ z.start()
146147
147148 # Execution is now STOPPED at address 0x0040107C
148149
@@ -176,8 +177,10 @@ def patch_reg():
176177 z = Zelos(" password_check.bin" , verbosity = 1 )
177178 # The address of the first time eax is used above
178179 target_address = 0x 00401810
179- # run to the target address and stop
180- z.plugins.runner.run_to_addr(target_address)
180+ # run to the address of cmp and break
181+ z.set_breakpoint(target_address, True )
182+ z.start()
183+
181184 # Execution is now STOPPED at address 0x00401810
182185
183186 # Set eax to 0x0
@@ -215,8 +218,9 @@ def patch_code():
215218 z = Zelos(" password_check.bin" , verbosity = 1 )
216219 # The address of the cmp instr
217220 target_address = 0x 0040107C
218- # run to the address of cmp and stop
219- z.plugins.runner.run_to_addr(target_address)
221+ # run to the address of cmp and break
222+ z.set_breakpoint(target_address, True )
223+ z.start()
220224
221225 # Execution is now STOPPED at address 0x0040107C
222226
@@ -321,8 +325,10 @@ def brute():
321325 z = Zelos(" password.bin" , verbosity = 1 )
322326 # The address of strcmp observed above
323327 strcmp_address = 0x 00400BB6
324- # run to the address of call to strcmp and stop
325- z.plugins.runner.run_to_addr(strcmp_address)
328+ # run to the address of cmp and break
329+ z.set_breakpoint(strcmp_address, True )
330+ z.start()
331+
326332 # Execution is now STOPPED at address 0x00400BB6
327333
328334 # get initial reg values of rdi & rsi before strcmp is called
@@ -386,8 +392,10 @@ def brute():
386392 z = Zelos(" password.bin" , verbosity = 1 )
387393 # The address of strcmp observed above
388394 strcmp_address = 0x 00400BB6
389- # run to the address of call to strcmp and stop
390- z.plugins.runner.run_to_addr(strcmp_address)
395+ # run to the address of cmp and break
396+ z.set_breakpoint(strcmp_address, True )
397+ z.start()
398+
391399 # Execution is now STOPPED at address 0x00400BB6
392400
393401 # get initial reg values of rdi & rsi before strcmp is called
@@ -402,8 +410,10 @@ def brute():
402410
403411 # Address of the test instr
404412 test_address = 0x 00400BBB
405- # run to the address of test instr and stop
406- z.plugins.runner.run_to_addr(test_address)
413+ # run to the address of cmp and break
414+ z.set_breakpoint(test_address, True )
415+ z.start()
416+
407417 # execute one step, in this case the test instr
408418 z.step()
409419
0 commit comments