Added CLI

This commit is contained in:
Alessandro Autiero
2022-10-06 23:36:37 +02:00
parent c27dbaa306
commit 000a2a53ed
12 changed files with 543 additions and 116 deletions

View File

@@ -7,8 +7,12 @@ 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
// Update: it was a missing permission error, it could be refactored now
Future<bool> injectDll(int pid, String dll) async {
var shell = Shell(workingDirectory: internalBinariesDirectory);
Future<bool> injectDll(int pid, String dll, [bool useSafeBinariesHome = false]) async {
var shell = Shell(
commandVerbose: false,
commentVerbose: false,
workingDirectory: useSafeBinariesHome ? safeBinariesDirectory : internalBinariesDirectory
);
var process = await shell.run("./injector.exe -p $pid --inject \"$dll\"");
var success = process.outText.contains("Successfully injected module");
if (!success) {