MCPcopy Create free account
hub / github.com/antonioCoco/RogueWinRM / wmain

Function wmain

RogueWinRM.cpp:53–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53int wmain(int argc, wchar_t** argv)
54{
55 wchar_t* processargs = NULL;
56 wchar_t* processname = NULL;
57 wchar_t* listen_port = NULL;
58 wchar_t default_listen_port[] = L"5985";
59 bool debug = false;
60 while ((argc > 1) && (argv[1][0] == '-'))
61 {
62 switch (argv[1][1])
63 {
64 case 'p':
65 ++argv;
66 --argc;
67 processname = argv[1];
68 break;
69 case 'a':
70 ++argv;
71 --argc;
72 processargs = argv[1];
73 break;
74 case 'l':
75 ++argv;
76 --argc;
77 listen_port = argv[1];
78 break;
79 case 'd':
80 ++argv;
81 --argc;
82 debug = true;
83 break;
84 default:
85 printf("Wrong Argument: %s\n", argv[1]);
86 usage();
87 exit(-1);
88 }
89 ++argv;
90 --argc;
91 }
92 if (processname == NULL) {
93 usage();
94 exit(-1);
95 }
96
97 // Default WinRM port
98 if (listen_port == NULL)
99 listen_port = default_listen_port;
100
101 exit(RunRogueWinRM(processname, listen_port, processargs, debug));
102 return 0;
103}
104
105int RunRogueWinRM(wchar_t* processname, wchar_t* listen_port, wchar_t *processargs, bool debug) {
106 LocalNegotiator* negotiator = new LocalNegotiator();

Callers

nothing calls this directly

Calls 2

usageFunction · 0.85
RunRogueWinRMFunction · 0.85

Tested by

no test coverage detected