MCPcopy Create free account
hub / github.com/Adaptix-Framework/AdaptixC2 / GetRootPathWindows

Function GetRootPathWindows

AdaptixClient/Source/Utils/FileSystem.cpp:39–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37
38
39QString GetRootPathWindows(const QString& path)
40{
41 if (path.startsWith("\\\\") && path.count("\\") == 2)
42 return path;
43
44 if (path.startsWith("\\\\")) {
45 int secondSlash = path.indexOf('\\', 2);
46 if (secondSlash != -1) {
47 return path.left(secondSlash);
48 }
49 }
50
51 int firstSlash = path.indexOf('\\');
52 if (firstSlash != -1) {
53 return path.left(firstSlash);
54 }
55
56 return path;
57}
58
59QString GetRootPathUnix(const QString& path)
60{

Callers 1

CreateBrowserFileDataMethod · 0.85

Calls 4

startsWithMethod · 0.80
countMethod · 0.45
indexOfMethod · 0.45
leftMethod · 0.45

Tested by

no test coverage detected