[C++]CreateProcess()

01/15/2012 10:26 Mr_PoP#1
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
01/15/2012 10:35 phize#2
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.
01/15/2012 10:49 Mr_PoP#3
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"!!!
01/15/2012 11:00 Korvacs#4
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.
01/15/2012 11:17 Mr_PoP#5
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.
01/15/2012 11:29 Korvacs#6
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.
01/15/2012 14:14 _DreadNought_#7
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););
01/15/2012 16:54 dego4ever#8
"blacknull" deactivate all client effects, like gears effects. it's for (low definition) PC
01/15/2012 17:39 CptSky#9
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.
01/15/2012 18:15 _DreadNought_#10
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.
01/15/2012 23:59 -impulse-#11
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.
01/16/2012 00:28 Korvacs#12
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.
01/16/2012 01:05 Lateralus#13
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.
01/16/2012 01:16 -impulse-#14
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).
01/16/2012 08:49 Korvacs#15
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.