Пример #1
0
int main(int argc, const char **argv)
{
	unitTests();

	Settings settings;
	ArgumentList args = gatherArguments(argc, argv, settings);	

	// TODO: Probably don't want to share them between files
	Bindings bindings = bindStandardLibrary();
	Interpreter interpreter(bindings, settings);

	if (args.empty())
	{
		repl(interpreter, settings);
	}
	else
	{
		for (ArgumentList::const_iterator it = args.begin() ; it != args.end() ; ++it) 
		{
			execute(interpreter, *it, settings);
		}
	}
	// If you use CTRL-D, nice to output a newline...
	std::cout << '\n';
}
Пример #2
0
int main (int argc, char **argv)
{


	prnlog("IClass Cipher version 1.2, Copyright (C) 2014 Martin Holst Swende\n");
	prnlog("Comes with ABSOLUTELY NO WARRANTY");
	prnlog("Released as GPLv2\n");
	prnlog("WARNING");
	prnlog("");
	prnlog("THIS TOOL IS CREATED FOR EXPERIMENTATION AND EDUCATIONAL USE ONLY. ");
	prnlog("");
	prnlog("USAGE OF THIS TOOL IN OTHER WAYS MAY INFRINGE UPON THE INTELLECTUAL ");
	prnlog("PROPERTY OF OTHER PARTIES, SUCH AS INSIDE SECURE AND HID GLOBAL, ");
	prnlog("AND MAY EXPOSE YOU TO AN INFRINGEMENT ACTION FROM THOSE PARTIES. ");
	prnlog("");
	prnlog("THIS TOOL SHOULD NEVER BE USED TO INFRINGE PATENTS OR INTELLECTUAL PROPERTY RIGHTS. ");

	char *fileName = NULL;
	int c;

    while ((c = getopt (argc, argv, "xthf:")) != -1)
	  switch (c)
		{
        case  'x':
            brute_hash1();
            return 0;
		case 't':
		  return unitTests();
		case 'h':
		  return showHelp();
		case 'f':
		  fileName = optarg;
		  return bruteforceFileNoKeys(fileName);
		case '?':
		  if (optopt == 'f')
			fprintf (stderr, "Option -%c requires an argument.\n", optopt);
		  else if (isprint (optopt))
			fprintf (stderr, "Unknown option `-%c'.\n", optopt);
		  else
			fprintf (stderr,
					 "Unknown option character `\\x%x'.\n",
					 optopt);
		  return 1;
		//default:
		  //showHelp();
		}

    showHelp();

	return 0;
}
Пример #3
0
int main()
{
	// Produce all the indices in the example figure, left to right, top to
	// bottom.
	const int treeDepth = 4;
	const int numXSubdivs = 4;
	const int numYSubdivs = 2;

	std::cout << "The following indices should correspond to the example figure in the source\n";
	for(int y = 0; y < numYSubdivs; ++y)
	{
		for(int x = 0; x < numXSubdivs; ++x)
		{
			Point p = Point((x+0.5)/numXSubdivs,(y+0.5)/numYSubdivs);
			std::cout << treeIndexForPoint_fast(treeDepth, p) << ", ";
		}
		std::cout << "\n";
	}

	unitTests();

	return 0;
}
Пример #4
0
bool registerUnitTest(UnitTestFunction func) {
    unitTests().push_back(func);
    return true;
}
Пример #5
0
int main()
{
    return unitTests();
}