mirror of
https://ghfast.top/https://github.com/StarCitizenToolBox/app.git
synced 2025-06-28 07:54:44 +08:00
feat: unp4kTools extract_memory
This commit is contained in:
@ -223,4 +223,23 @@ class Unp4kCModel extends _$Unp4kCModel {
|
||||
rsPid: _rsPid!, data: "$mode<:,:>$filePath<:,:>$outputPath\n");
|
||||
}
|
||||
}
|
||||
|
||||
static Future<Uint8List> unp4kTools(
|
||||
String applicationBinaryModuleDir, List<String> args) async {
|
||||
await BinaryModuleConf.extractModule(
|
||||
["unp4kc"], applicationBinaryModuleDir);
|
||||
final execDir = "$applicationBinaryModuleDir\\unp4kc";
|
||||
final exec = "$execDir\\unp4kc.exe";
|
||||
final r = await Process.run(exec, args);
|
||||
if (r.exitCode != 0) {
|
||||
throw Exception(
|
||||
"error: ${r.exitCode} , info= ${r.stdout} , err= ${r.stderr}");
|
||||
}
|
||||
final eventJson = await compute(json.decode, r.stdout.toString());
|
||||
if (eventJson["action"] == "data: Uint8List") {
|
||||
final data = eventJson["data"];
|
||||
return Uint8List.fromList((data as List).cast<int>());
|
||||
}
|
||||
throw Exception("error: data error");
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ part of 'unp4kc.dart';
|
||||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$unp4kCModelHash() => r'0f1bff187bbc4e043405f60e95c08af6e1159b57';
|
||||
String _$unp4kCModelHash() => r'69117c5857797683e2d080da9238bfecc5948898';
|
||||
|
||||
/// See also [Unp4kCModel].
|
||||
@ProviderFor(Unp4kCModel)
|
||||
|
Reference in New Issue
Block a user