MCPcopy Create free account
hub / github.com/qilingframework/qiling / check_print

Method check_print

tests/test_pe.py:429–452  ·  view source on GitHub ↗
(ql: Qiling, address: int, params)

Source from the content-addressed store, hash-verified

427 target_txt = None
428
429 def check_print(ql: Qiling, address: int, params):
430 nonlocal target_txt
431 ql.os.fcall = ql.os.fcall_select(CDECL)
432
433 params = ql.os.resolve_fcall_params({
434 '_Options' : PARAM_INT64,
435 '_Stream' : POINTER,
436 '_Format' : STRING,
437 '_Locale' : DWORD,
438 '_ArgList' : POINTER
439 })
440
441 format = params['_Format']
442 arglist = params['_ArgList']
443
444 count = format.count("%")
445 fargs = [ql.mem.read_ptr(arglist + i * ql.arch.pointersize) for i in range(count)]
446
447 try:
448 target_txt = ql.mem.string(fargs[1])
449 except:
450 target_txt = ""
451
452 return address, params
453
454 ql = Qiling(["../examples/rootfs/x86_windows/bin/argv.exe"], "../examples/rootfs/x86_windows")
455 ql.os.set_api('__stdio_common_vfprintf', check_print, QL_INTERCEPT.ENTER)

Callers

nothing calls this directly

Calls 3

resolve_fcall_paramsMethod · 0.80
read_ptrMethod · 0.80
stringMethod · 0.80

Tested by

no test coverage detected