CreateProcessEx failing on 32 bit Windows 7

c++ / delphi package - dll injection and api hooking

CreateProcessEx failing on 32 bit Windows 7

Postby hardik.choudhary » Wed Nov 13, 2019 1:05 pm

HI
I tried CreateProcessEx on a 32 bit Windows 7, it fails with GetLastError() 123(ERROR_INVALID_NAME). Any suggestions as to why this could be?
Thanks
hardik.choudhary
 
Posts: 4
Joined: Wed Nov 13, 2019 1:01 pm

Re: CreateProcessEx failing on 32 bit Windows 7

Postby iconic » Wed Nov 13, 2019 1:51 pm

Does the same thing happen with the regular Win32 API CreateProcessA/W? Obviously, you wouldn't append the extra DLL name parameter.
That error code is usually a result of needing to relocate param 1 (ApplicationName) to param 2 (Commandline), make sure to set param 1
to NULL if you end up using param 2. If you're still getting the error please post your call parameters so we can see them

--Iconic
iconic
Site Admin
 
Posts: 929
Joined: Wed Jun 08, 2005 5:08 am

Re: CreateProcessEx failing on 32 bit Windows 7

Postby hardik.choudhary » Thu Nov 14, 2019 6:34 am

Thanks, I tried that but same error. It's a createProcessW callback, and the same parameters that were there for CreateProcessW are passed into CreateProcessExW along with the extra dll. Funny thing is it works for a 64 bit OS opening a 32 bit process, so I know the callback code, and what I'm injecting works there. Is there an environment related issue, that might be interfering? (GetLastError() 123)?
hardik.choudhary
 
Posts: 4
Joined: Wed Nov 13, 2019 1:01 pm

Re: CreateProcessEx failing on 32 bit Windows 7

Postby iconic » Thu Nov 14, 2019 6:42 am

Hello,

Thanks for replying. Hmmm, can you upload a sample project
or show code? I’ll test before the weekend and try to reproduce,
but it may be hard, depending on the params etc. Will try however

--Iconic
iconic
Site Admin
 
Posts: 929
Joined: Wed Jun 08, 2005 5:08 am

Re: CreateProcessEx failing on 32 bit Windows 7

Postby iconic » Thu Nov 14, 2019 6:48 am

One last quick check, does this happen with CreateProcessExA() ? The cmdline is very different here, believe it or not, and it’s mentioned on MSDN. Basically, you shouldn’t use a literal/const string, but a buffer for the commandline arg

P.S: We really can help more with a code sample, otherwise we are reduced to *guess*work

--Iconic
iconic
Site Admin
 
Posts: 929
Joined: Wed Jun 08, 2005 5:08 am

Re: CreateProcessEx failing on 32 bit Windows 7

Postby hardik.choudhary » Thu Nov 14, 2019 11:18 am

"Basically, you shouldn’t use a literal/const string, but a buffer for the commandline arg", yes I've learnt that the hard way.

It's fine, it was a different issue, altogether.

Thanks for your time and suggestions.
hardik.choudhary
 
Posts: 4
Joined: Wed Nov 13, 2019 1:01 pm

Re: CreateProcessEx failing on 32 bit Windows 7

Postby iconic » Thu Nov 14, 2019 1:02 pm

Glad the issue is resolved. Thanks for letting us know

—Iconic
iconic
Site Admin
 
Posts: 929
Joined: Wed Jun 08, 2005 5:08 am


Return to madCodeHook

Who is online

Users browsing this forum: Google [Bot] and 11 guests

cron