MCPcopy Create free account
hub / github.com/dobin/RedEdr / InitializeLogReader

Function InitializeLogReader

RedEdr/logreader.cpp:123–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121
122
123BOOL InitializeLogReader(std::vector<HANDLE>& threads) {
124 std::wstring directory;
125 std::wstring pattern;
126
127 directory = L"C:\\ProgramData\\Microsoft\\Windows Defender\\Support";
128 pattern = L"MPLog-*";
129
130 if (TRUE) {
131 directory = L"C:\\temp";
132 pattern = L"test*";
133 }
134
135 std::wstring path = findFiles(directory, pattern);
136 if (path == L"") {
137 LOG_A(LOG_ERROR, "LOG: File not found: %ls", pattern.c_str());
138 return 1;
139 }
140
141 wchar_t* real_path = wstring2wcharAlloc(path);
142 HANDLE thread = CreateThread(NULL, 0, LogReaderProcessingThread, (LPVOID)real_path, 0, NULL);
143 if (thread == NULL) {
144 LOG_A(LOG_ERROR, "LOG: Failed to create thread for trace session logreader");
145 return 1;
146 }
147 threads.push_back(thread);
148
149 //tailFileW(path.c_str());
150 return TRUE;
151}
152

Callers

nothing calls this directly

Calls 3

findFilesFunction · 0.85
wstring2wcharAllocFunction · 0.85
LOG_AFunction · 0.70

Tested by

no test coverage detected