(ql: Qiling)
| 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) |
nothing calls this directly
no test coverage detected