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

Function call_DialogFunc

examples/crackme_x86_windows_auto.py:19–36  ·  view source on GitHub ↗
(ql: Qiling)

Source from the content-addressed store, hash-verified

17 lpDialogFunc = params['lpDialogFunc']
18
19 def call_DialogFunc(ql: Qiling):
20 # we would like to resume from the exact same address that used to invoke
21 # this hook. in order to prevent an endless loop of hook invocations, we
22 # remove the hook through its handle.
23 hh.remove()
24
25 WM_COMMAND = 0x111
26 IDS_APPNAME = 1001
27
28 # [steps #3 and #4]
29 # set up the arguments and call the address passed through the lpDialogFunc
30 # param. make sure it resumes back to where we were.
31 ql.os.fcall.call_native(lpDialogFunc, (
32 (HWND, 0),
33 (UINT, WM_COMMAND),
34 (UINT, IDS_APPNAME),
35 (LONG, 0),
36 ), ql.arch.regs.arch_pc)
37
38 # get DialogBoxParamA return address; should be the first item on the stack
39 retaddr = ql.arch.stack_read(0)

Callers

nothing calls this directly

Calls 2

call_nativeMethod · 0.80
removeMethod · 0.45

Tested by

no test coverage detected