mirror of
https://github.com/Auties00/Reboot-Launcher.git
synced 2026-01-13 19:22:22 +01:00
Initial commit
This commit is contained in:
18
lib/src/util/injector.dart
Normal file
18
lib/src/util/injector.dart
Normal file
@@ -0,0 +1,18 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:process_run/shell.dart';
|
||||
import 'package:reboot_launcher/src/util/locate_binary.dart';
|
||||
|
||||
File injectLogFile = File("${Platform.environment["Temp"]}/server.txt");
|
||||
|
||||
// This can be done easily with win32 apis but for some reason it doesn't work on all machines
|
||||
Future<bool> injectDll(int pid, String dll) async {
|
||||
var shell = Shell(workingDirectory: binariesDirectory);
|
||||
var process = await shell.run("./injector.exe -p $pid --inject \"$dll\"");
|
||||
var success = process.outText.contains("Successfully injected module");
|
||||
if (!success) {
|
||||
injectLogFile.writeAsString(process.outText, mode: FileMode.append);
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
Reference in New Issue
Block a user