blacknull question

05/14/2008 18:37 shitboi#1
This is a question to the programmers. I have browsed through the forum and found out that blacknull is the solution to bypass autopatch. However i do have some doubts.


1) Conquer.exe blacknull
-the blacknull argument is passed into conquer.exe. What is the meaning of blacknull?
-what kind of language is it exactly?
-how has blacknull got to do with autopatch?
-how is conquer.exe related to autopatch.exe

2) About blacknull in specific
-How was it discovered? To be more exact, how did someone realize that blacknull can be passed to conquer.exe as a parameter?
-can blacknull be passed into other programs too? And what would most likely be the outcome of the action?


Regarding programming.
I have noticed that starting from vc++/vs 2005, body codes are provided with main(arg, arg). I started learning vc++ vc6.0, and have only did 1 tutorial that requires an argument in the main function parameters. Can you tell me, is it good to always have arguments in main function declaration?

With my limited knowledge. i thought that main() programs can run by double clicking, and main(arg) programs will crash if a parameter isn't passed in. So, how is a program like Conquer be made since it can run as a standalone function, and also accepts arguments?:confused:
05/14/2008 19:59 unknownone#2
When you create an application in a language like C or C++ (like CO), your initial function can take some arguments. If you ever run command line apps, for example, ping, netstat etc, any information you pass is one of these arguments.
The main function of conquer would look like this

Code:
int main(int argc, char* argv[])
{
    if (strcmp("blacknull", argv[0])
    {
	launchgame();
    } else {
    	MessageBox("Please run play.exe");
	return 0; //ie, don't start the game
    }
}
blacknull itself has no meaning in computing terms. I believe it's the alias of one of the original programmers of CO (Look at the credits).

You can find out the arguments that have been passed to an open application using the windows API, or if you want an off-the-shelf application that can check, download the sysinternals suite from microsoft (It's almost essential for finding information about applications you want to hack) and run procmon/procexp and check the properties of a running Conquer process. Note that some applications will protect against viewing their properties, such as games running XTrap etc.

Regarding the programming: All arguments are optional, but the programmer can decide what he wants to do if there are no arguments etc. Applications using just main() won't crash if you pass args to them, the args will just be omitted. If you're not expecting any args, there's no need for them in the main delaration.
05/14/2008 20:12 shitboi#3
yeah, that was what i was talking about in vc2005+
"int main(int argc, char* argv[])"
I have not used any versions higher than 6.0 and do not know what does argc and argv[] mean exactly.

-These parameters does not necessarily need to be passed in for the program to run, yes?
-(int argc, char* argv[]) an int and array parameter is to open up more choices for the arguments recieved?
-arg*, is the * part user defined?
-Does (int argc, float argx, char* argv[]) work?
-Finally why is the array been declared as a pointer?


[Edit]Thanks unknownone for answering my first post, it was really helpful [EndOfEdit]
Sorry for raising so many questions. I always had these doubts and thought it might be beneficial for me to clear them all at once. Hopefully it also voices out other member's thoughts.
05/14/2008 22:19 unknownone#4
argc and argv are defined by the compiler, you don't edit them. argc is the argument count, and argv[] are the values of the arguments themselves - an array the size of argc. The char* is because the arguments are strings, and C/C++ have no built in string type, instead they're pointers to the location of the string.
05/15/2008 03:06 flowerpot!#5
argv[0] is the exe name, argv[1] would be blacknull in this case. Minor details. :)
05/15/2008 04:16 shitboi#6
i think i got what you mean unknownone. I'll re-iterate what i understood, just to confirm that i took it correctly.

i'll use non compiler defined terms in the following example to express my understanding:

int main(int size_of_string, char * an_array_of_pointers_to_string)