Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NtCreateUserProcess returns XXXXXXXX #48

Closed
nomi-san opened this issue Mar 29, 2023 · 0 comments
Closed

NtCreateUserProcess returns XXXXXXXX #48

nomi-san opened this issue Mar 29, 2023 · 0 comments
Labels
bug Something isn't working enhancement New feature or request system-mode

Comments

@nomi-san
Copy link
Member

nomi-san commented Mar 29, 2023

Commonly 0xC0000039 (STATUS_OBJECT_PATH_INVALID), this error status usually occurs on Windows 7/8.
NtCreateUserProcess is an undocumented function, so there is no good info about usage.

image

I just found the best way to detach the debugger when create process with flag DEBUG_ONLY_THIS_PROCESS to avoid IFEO recursion.

CreateProcessW(NULL, commandLine, NULL, NULL, FALSE,
  CREATE_SUSPENDED | DEBUG_ONLY_THIS_PROCESS, NULL, NULL, &si, &pi);

HANDLE hDebug;
if (0 <= NtQueryInformationProcess(pi.hProcess, ProcessDebugObjectHandle, &hDebug, sizeof(HANDLE), 0))
{
  NtRemoveProcessDebug(pi.hProcess, hDebug);
  NtClose(hDebug);
}
@nomi-san nomi-san added bug Something isn't working enhancement New feature or request system-mode labels Mar 29, 2023
nomi-san added a commit that referenced this issue Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request system-mode
Projects
None yet
Development

No branches or pull requests

1 participant