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

Method test_gdbdebug_shellcode_server

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

Source from the content-addressed store, hash-verified

169 del ql
170
171 def test_gdbdebug_shellcode_server(self):
172 X8664_LIN = bytes.fromhex('31c048bbd19d9691d08c97ff48f7db53545f995257545eb03b0f05')
173
174 ql = Qiling(code=X8664_LIN, archtype=QL_ARCH.X8664, ostype=QL_OS.LINUX)
175 ql.debugger = 'gdb:127.0.0.1:9998'
176
177 def gdb_test_client():
178 # yield to allow ql to launch its gdbserver
179 time.sleep(1.337 * 2)
180
181 with SimpleGdbClient('127.0.0.1', 9998) as client:
182 client.send('qSupported:multiprocess+;swbreak+;hwbreak+;qRelocInsn+;fork-events+;vfork-events+;exec-events+;vContSupported+;QThreadEvents+;no-resumed+;xmlRegisters=i386')
183 client.send('vMustReplyEmpty')
184 client.send('QStartNoAckMode')
185 client.send('Hgp0.0')
186 client.send('?')
187 client.send('qC')
188 client.send('g')
189 client.send('p10')
190 client.send('c')
191 client.send('k')
192
193 # yield to make sure ql gdbserver has enough time to receive our last command
194 time.sleep(1.337)
195
196 threading.Thread(target=gdb_test_client, daemon=True).start()
197
198 ql.run()
199 del ql
200
201
202if __name__ == "__main__":

Callers

nothing calls this directly

Calls 3

runMethod · 0.95
QilingClass · 0.90
startMethod · 0.45

Tested by

no test coverage detected