2016-07-21 23:02:31 +00:00
|
|
|
#include <Windows.h>
|
|
|
|
#include <iostream>
|
|
|
|
#include <stdio.h>
|
2016-12-04 19:27:46 +00:00
|
|
|
#include "Helper.h"
|
|
|
|
#include "Connection.h"
|
|
|
|
#include "Commands.h"
|
2016-07-21 23:02:31 +00:00
|
|
|
|
|
|
|
#include "../HiddenLib/HiddenLib.h"
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
2016-12-04 19:27:46 +00:00
|
|
|
int wmain(int argc, wchar_t* argv[])
|
2016-07-21 23:02:31 +00:00
|
|
|
{
|
2016-12-04 19:27:46 +00:00
|
|
|
try
|
2016-07-21 23:02:31 +00:00
|
|
|
{
|
2016-12-04 19:27:46 +00:00
|
|
|
Arguments arguments(argc, argv);
|
2016-07-21 23:02:31 +00:00
|
|
|
|
2016-12-04 19:27:46 +00:00
|
|
|
if (!arguments.ArgsCount())
|
|
|
|
throw WException(
|
|
|
|
-2,
|
|
|
|
L"Welcome to HiddenCLI, please use 'hiddencli help'"
|
|
|
|
);
|
2016-07-21 23:02:31 +00:00
|
|
|
|
2016-12-04 19:27:46 +00:00
|
|
|
Connection connection(arguments);
|
|
|
|
Commands commands(arguments);
|
2016-07-21 23:02:31 +00:00
|
|
|
|
|
|
|
}
|
2016-12-04 19:27:46 +00:00
|
|
|
catch (WException& exception)
|
2016-09-05 19:30:18 +00:00
|
|
|
{
|
2016-12-04 19:27:46 +00:00
|
|
|
wcerr << exception.What() << endl;
|
|
|
|
return exception.Code();
|
2016-09-05 19:30:18 +00:00
|
|
|
}
|
2016-12-04 19:27:46 +00:00
|
|
|
catch (exception& exception)
|
2016-09-05 19:30:18 +00:00
|
|
|
{
|
2016-12-04 19:27:46 +00:00
|
|
|
cerr << exception.what() << endl;
|
|
|
|
return -1;
|
2016-09-05 19:30:18 +00:00
|
|
|
}
|
|
|
|
|
2016-07-21 23:02:31 +00:00
|
|
|
return 0;
|
|
|
|
}
|