the structure of CreateProcessA is as follows:
BOOL CreateProcessA(
LPCSTR lpApplicationName,
LPSTR lpCommandLine,
LPSECURITY_ATTRIBUTES lpProcessAttributes,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL bInheritHandles,
DWORD dwCreationFlags,
LPVOID lpEnvironment,
LPCSTR lpCurrentDirectory,
LPSTARTUPINFOA lpStartupInfo,
LPPROCESS_INFORMATION lpProcessInformation
);
I am curious to as how I can emulate/interact with this winapi inside Go. This is what I've attempted to no avail:
package main
import (
"syscall"
"unsafe"
)
func main() {
proc := []byte("C:\\Windows\\System32\\calc.exe")
CREATE_SUSPENDED := uintptr(0x00000004)
kernel32 := syscall.MustLoadDLL("kernel32.dll")
cproca := kernel32.MustFindProc("CreateProcessA")
cproca.Call(uintptr(unsafe.Pointer(&proc[0])), 0, 0, 0, 0, CREATE_SUSPENDED, 0, 0, 0, 0)
}
I can't seem to figure out how to create the STARTUPINFO and PROCESS_INFORMATION structures. I am trying to start calc.exe in suspended state. Examples of creating processes in C++ can be found here: Creating Processes (Microsoft Docs)
User contributions licensed under CC BY-SA 3.0