and I have found the relevant information, but unfortunately I can't read the C code in it. How can I convert it to ahk please?
I tried to modify it like this, but apparently this is not correct
Code: Select all
if script
{
scr:=Struct("LPTSTR code, opt, title", ,{code: "MsgBox 123", opt: "opt", title: "test"})
if !pBufferScript := DllCall("VirtualAllocEx", "Ptr", hProc, "Ptr", 0, "Ptr", scr.size, "UInt", MEM_COMMIT, "UInt", PAGE_EXECUTE_READWRITE, "Ptr")
return (DllCall("MessageBox", "Ptr", 0, "Str", "Could not reserve memory for process.", "Str", "Error", "UInt", 0)
, DllCall("CloseHandle", "Ptr", hProc))
; Write script to remote process memory
DllCall("WriteProcessMemory", "Ptr", hProc, "Ptr", pBufferScript, "Ptr", scr.ptr, "Ptr", scr.size, "Ptr", 0)