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

Method test_gdbdebug_armeb

tests/test_debugger.py:130–169  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

128 del ql
129
130 def test_gdbdebug_armeb(self):
131 ql = Qiling(["../examples/rootfs/armeb_linux/bin/armeb_hello"], "../examples/rootfs/armeb_linux", verbose=QL_VERBOSE.DEBUG)
132 ql.debugger = True
133
134 # some random command test just to make sure we covered most of the command
135 def gdb_test_client():
136 # yield to allow ql to launch its gdbserver
137 time.sleep(1.337 * 2)
138
139 with SimpleGdbClient('127.0.0.1', 9999) as client:
140 client.send('qSupported:multiprocess+;swbreak+;hwbreak+;qRelocInsn+;fork-events+;vfork-events+;exec-events+;vContSupported+;QThreadEvents+;no-resumed+;xmlRegisters=i386')
141 client.send('vMustReplyEmpty')
142 client.send('QStartNoAckMode')
143 client.send('Hgp0.0')
144 client.send('qXfer:auxv:read::0, 1000')
145 client.send('?')
146 client.send('qXfer:threads:read::0,fff')
147 client.send(f'qAttached:{ql.os.pid}')
148 client.send('qC')
149 client.send('g')
150 client.send('m47ccd10,4')
151 client.send('qXfer:threads:read::0,1000')
152 client.send('z0,47ca5fc,4')
153 client.send('m0,4')
154 client.send('mfffffffc,4')
155 client.send('m0,4')
156 client.send('mfffffffc,4')
157 client.send('m0,4')
158 client.send('p1d')
159 client.send('qTStatus')
160 client.send('c')
161 client.send('k')
162
163 # yield to make sure ql gdbserver has enough time to receive our last command
164 time.sleep(1.337)
165
166 threading.Thread(target=gdb_test_client, daemon=True).start()
167
168 ql.run()
169 del ql
170
171 def test_gdbdebug_shellcode_server(self):
172 X8664_LIN = bytes.fromhex('31c048bbd19d9691d08c97ff48f7db53545f995257545eb03b0f05')

Callers

nothing calls this directly

Calls 3

runMethod · 0.95
QilingClass · 0.90
startMethod · 0.45

Tested by

no test coverage detected