MCPcopy Index your code
hub / github.com/qilingframework/qiling / run

Method run

qiling/core.py:561–592  ·  view source on GitHub ↗

Start binary emulation. Args: begin : emulation starting address end : emulation ending address timeout : limit emulation to a specific amount of time (microseconds); unlimited by default count : limit emulation to a specific amount of

(self, begin: Optional[int] = None, end: Optional[int] = None, timeout: int = 0, count: int = 0)

Source from the content-addressed store, hash-verified

559 ###############
560
561 def run(self, begin: Optional[int] = None, end: Optional[int] = None, timeout: int = 0, count: int = 0):
562 """Start binary emulation.
563
564 Args:
565 begin : emulation starting address
566 end : emulation ending address
567 timeout : limit emulation to a specific amount of time (microseconds); unlimited by default
568 count : limit emulation to a specific amount of instructions; unlimited by default
569 """
570
571 # replace the original entry point, exit point, timeout and count
572 self.entry_point = begin
573 self.exit_point = end
574 self.timeout = timeout
575 self.count = count
576
577 # init debugger (if set)
578 debugger = select_debugger(self._debugger)
579
580 if debugger:
581 debugger = debugger(self)
582
583 # patch binary
584 self.do_bin_patch()
585
586 self.write_exit_trap()
587 # emulate the binary
588 self.os.run()
589
590 # run debugger
591 if debugger and self.debugger:
592 debugger.run()
593
594 def patch(self, offset: int, data: bytes, target: Optional[str] = None) -> None:
595 """Volatilely patch binary and libraries with arbitrary content.

Calls 3

do_bin_patchMethod · 0.95
write_exit_trapMethod · 0.95
select_debuggerFunction · 0.85

Tested by 15

test_edl_arm64Method · 0.76
test_gdbdebug_mips32Method · 0.76
test_gdbdebug_armebMethod · 0.76
test_android_arm64Method · 0.76
test_android_armMethod · 0.76