Register for your free account! | Forgot your password?

You last visited: Today at 23:11

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[C++]CreateProcess()

Discussion on [C++]CreateProcess() within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
Mr_PoP's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 759
Received Thanks: 285
[C++]CreateProcess()

Code:
void main(){
    STARTUPINFO si;
    PROCESS_INFORMATION pi;
    memset(&si, 0, sizeof(si));
    memset(&pi, 0, sizeof(pi));
    si.cb = sizeof(si);
    char * procName = "D:\\Conquer Online 2.0\\Conquer.exe";
    char * procArg  = "blacknull";

if(CreateProcess(procName,procArg,0,0,0,CREATE_DEFAULT_ERROR_MODE,"D:\\Conquer Online 2.0",0,&si,&pi)){
    //do something
}

printf( "CreateProcess failed (%d).\n", GetLastError() );
system("Pause");

}
now when am trying to load Conquer.exe it gives me this error "Please run Play.exe file" , how while am loading it using "blacknull" argument
Mr_PoP is offline  
Old 01/15/2012, 10:35   #2
 
elite*gold: 0
Join Date: Sep 2006
Posts: 774
Received Thanks: 8,580
Try setting lpCurrentDirectory.

Code:
CreateProcess(procName,procArg,0,0,0,CREATE_DEFAULT_ERROR_MODE,0,"D:\\Conquer Online 2.0",&si,&pi)
Also it's " blacknull" you need to pass I believe.
phize is offline  
Thanks
1 User
Old 01/15/2012, 10:49   #3
 
Mr_PoP's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 759
Received Thanks: 285
Quote:
Originally Posted by Synsia View Post
Try setting lpCurrentDirectory.

Code:
CreateProcess(procName,procArg,0,0,0,CREATE_DEFAULT_ERROR_MODE,0,"D:\\Conquer Online 2.0",&si,&pi)
Also it's " blacknull" you need to pass I believe.
yeah now it's loading but it's saying "Please run Play.exe" how while am loading it using the argument "blacknull"!!!
Mr_PoP is offline  
Old 01/15/2012, 11:00   #4


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
Quote:
Originally Posted by Mr_PoP View Post
yeah now it's loading but it's saying "Please run Play.exe" how while am loading it using the argument "blacknull"!!!
Blacknull just skips the autopatch process once its loaded, it doesnt remove the requirement for Play.exe.
Korvacs is offline  
Old 01/15/2012, 11:17   #5
 
Mr_PoP's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 759
Received Thanks: 285
Quote:
Originally Posted by Korvacs View Post
Blacknull just skips the autopatch process once its loaded, it doesnt remove the requirement for Play.exe.
but if u made a shortcut and made it's target for e.g ""D:\Conquer Online 2.0\Conquer.exe" blacknull" it will load the conquer.exe and it will bypass the requirement for Play.exe.
Mr_PoP is offline  
Old 01/15/2012, 11:29   #6


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
Hmm, i guess your right, it musnt check the memory mutex when you use blacknull, in anycase if thats not working i guess your argument isnt being sent to the application.
Korvacs is offline  
Old 01/15/2012, 14:14   #7
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,225
Received Thanks: 868
I have some code that.. could.. help.. ;s

I believe this is some unamanged code nullable helped me create a couple years back.
Code:
STARTUPINFO si;
PROCESS_INFORMATION pi;
memset($si, 0, sizeof(STARTUPINFO));
memset($pi, 0, sizeof(PRCESS_INFORMATION));
si.cb = sizeof(STARTUPINFO);
CreatePrcess(".//Conquer.exe
"blacknull",
0,
0,
0,
CREATE_DEFAULT_ERROR_MODE,
0,
0,
$si,
$pi);


::ShellExecute(0,
"open",
".\\Conquer.exe",
"blacknull",
0,
0x0000001););
_DreadNought_ is offline  
Old 01/15/2012, 16:54   #8
 
elite*gold: 0
Join Date: Mar 2009
Posts: 228
Received Thanks: 47
"blacknull" deactivate all client effects, like gears effects. it's for (low definition) PC
dego4ever is offline  
Old 01/15/2012, 17:39   #9


 
CptSky's Avatar
 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,443
Received Thanks: 1,175
Quote:
Originally Posted by dego4ever View Post
"blacknull" deactivate all client effects, like gears effects. it's for (low definition) PC
I doubt.

blacknull is the nickname of a programmer if you look in the "Credits". It is used (on older client), to indicate that the autopatch process has been used as normally. Only AutoPath will pass the argument.
CptSky is offline  
Old 01/15/2012, 18:15   #10
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,225
Received Thanks: 868
Quote:
Originally Posted by dego4ever View Post
"blacknull" deactivate all client effects, like gears effects. it's for (low definition) PC
I had to disagree, I use it on my private conquer loader for later servers and it does indeed pass the blacknull arguement and it works fine.
_DreadNought_ is offline  
Old 01/15/2012, 23:59   #11
 
elite*gold: 0
Join Date: Oct 2009
Posts: 768
Received Thanks: 550
The process args must start with a space ' ' like ' blacknull'. Most people check for args starting with position 1 so when you use 'blacknull' it will skip the first word which is blacknull itself.
-impulse- is offline  
Old 01/16/2012, 00:28   #12


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
Quote:
Originally Posted by -impulse- View Post
The process args must start with a space ' ' like ' blacknull'. Most people check for args starting with position 1 so when you use 'blacknull' it will skip the first word which is blacknull itself.
What? lol....

Thats certainly not true for 99% of the applications i've ever had to use an arguement with, and its certainly not true in the case of conquer either.

"conquer.exe blacknull"

Means that blacknull is in the Args[0] position.
Korvacs is offline  
Old 01/16/2012, 01:05   #13
 
Lateralus's Avatar
 
elite*gold: 0
Join Date: May 2005
Posts: 1,892
Received Thanks: 920
It just happens that the executable checks if the argument passed to the executable is "blacknull", and if it is, it bypasses the "Please run play.exe" error message. It's arbitrary, but it's hardcoded in the executable. Perhaps this blacknull guy implemented it as a debugging feature or just for putting his credits there.
Lateralus is offline  
Old 01/16/2012, 01:16   #14
 
elite*gold: 0
Join Date: Oct 2009
Posts: 768
Received Thanks: 550
Quote:
Originally Posted by Korvacs View Post
What? lol....

Thats certainly not true for 99% of the applications i've ever had to use an arguement with, and its certainly not true in the case of conquer either.

"conquer.exe blacknull"

Means that blacknull is in the Args[0] position.
You are probably right about that 'most', but I did find sittuations when the checks started with arg 1. In co.exe case it never worked for me to start the process from another program without having a space in front of blacknull.
From a shortcut just adding blacknull at program's path works but not from another program. Test yourself with C++ and if your code starts co without please run play.exe post your code here so we can end this discussion. I myself cant atm as I don't have a charger for my laptop and I am writing from my phone(sorry for typos).
-impulse- is offline  
Old 01/16/2012, 08:49   #15


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
Yes you need a space, but that's not in order to put the argument at the second position, that's just to separate the Arguments from the executable path. All applications require this.
Korvacs is offline  
Reply


Similar Threads Similar Threads
CreateProcess Problem
12/16/2009 - General Coding - 17 Replies
STARTUPINFO si; PROCESS_INFORMATION pi; ZeroMemory( &si, sizeof(si) ); si.cb = sizeof(si); ZeroMemory( &pi, sizeof(pi) ); TCHAR buf; GetCurrentDirectory(MAX_PATH,buf); TCHAR path = L"\"";



All times are GMT +1. The time now is 23:11.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.