This commit is contained in:
Alessandro Autiero
2024-06-03 16:26:04 +02:00
parent 3069f3aa05
commit 46034aa1fa
24 changed files with 242 additions and 189 deletions

View File

@@ -70,7 +70,7 @@ void _onGameOutput(String line, String dll, bool hosting, bool verbose) {
_injectOrShowError("console.dll");
}
_injectOrShowError("memoryleak.dll");
_injectOrShowError("memoryFix.dll");
}
}
@@ -87,12 +87,12 @@ Future<void> _injectOrShowError(String binary, [bool locate = true]) async {
try {
stdout.writeln("Injecting $binary...");
var dll = locate ? File("${assetsDirectory.path}\\dlls\\$binary") : File(binary);
var dll = locate ? File("${dllsDirectory.path}\\$binary") : File(binary);
if(!dll.existsSync()){
throw Exception("Cannot inject $dll: missing file");
}
await injectDll(_gameProcess!.pid, dll.path);
await injectDll(_gameProcess!.pid, dll);
} catch (exception) {
throw Exception("Cannot inject binary: $binary");
}

View File

@@ -7,12 +7,12 @@ import 'package:reboot_common/common.dart';
// TODO: Use github
const String _baseDownload = "https://cdn.discordapp.com/attachments/1095351875961901057/1110968021373169674/cobalt.dll";
const String _consoleDownload = "https://cdn.discordapp.com/attachments/1095351875961901057/1110968095033524234/console.dll";
const String _memoryFixDownload = "https://cdn.discordapp.com/attachments/1095351875961901057/1110968141556756581/memoryleak.dll";
const String _memoryFixDownload = "https://cdn.discordapp.com/attachments/1095351875961901057/1110968141556756581/memoryFix.dll";
const String _embeddedConfigDownload = "https://cdn.discordapp.com/attachments/1026121175878881290/1040679319351066644/embedded.zip";
Future<void> downloadRequiredDLLs() async {
stdout.writeln("Downloading necessary components...");
var consoleDll = File("${assetsDirectory.path}\\dlls\\console.dll");
var consoleDll = File("${dllsDirectory.path}\\console.dll");
if(!consoleDll.existsSync()){
var response = await http.get(Uri.parse(_consoleDownload));
if(response.statusCode != 200){
@@ -22,7 +22,7 @@ Future<void> downloadRequiredDLLs() async {
await consoleDll.writeAsBytes(response.bodyBytes);
}
var craniumDll = File("${assetsDirectory.path}\\dlls\\cobalt.dll");
var craniumDll = File("${dllsDirectory.path}\\cobalt.dll");
if(!craniumDll.existsSync()){
var response = await http.get(Uri.parse(_baseDownload));
if(response.statusCode != 200){
@@ -32,11 +32,11 @@ Future<void> downloadRequiredDLLs() async {
await craniumDll.writeAsBytes(response.bodyBytes);
}
var memoryFixDll = File("${assetsDirectory.path}\\dlls\\memoryleak.dll");
var memoryFixDll = File("${dllsDirectory.path}\\memoryFix.dll");
if(!memoryFixDll.existsSync()){
var response = await http.get(Uri.parse(_memoryFixDownload));
if(response.statusCode != 200){
throw Exception("Cannot download memoryleak.dll");
throw Exception("Cannot download memoryFix.dll");
}
await memoryFixDll.writeAsBytes(response.bodyBytes);