So, I am trying to create an test application for online Unity game but to do what I need it to do, I must read datas from a hex offset located in a .prefab file. And then, i will load prefabs on server-side from data. For an anti-collider hack from client-side.
I must read datas like unityVer, localScale, localPosition, localSize, collider size… etc.
Edit: I must make it on a simple console application, not in Unity.
My not working code :
try {
string[] prefabFiles = Directory.GetFiles(Path.Combine(Environment.CurrentDirectory, "data\\prefabs\\"));
foreach (var prefab in prefabFiles) {
if (prefab != null && prefab.Split('.')[1] == "prefab") {
try {
using (var reader = new BinaryReader(new FileStream(prefab, FileMode.Open, FileAccess.Read))) {
FileInfo info = new FileInfo(prefab);
Console.WriteLine("Analyzing File : " + info.Name);
reader.BaseStream.Position = 0xA;
//string unityVer = reader...
//float localPositionX = reader...
//float localPositionY = reader...
//float localPositionZ = reader...
//float localScaleX = reader...
//float localScaleY = reader...
//float localScaleZ = reader...
//float colliderRadius = reader...
}
Console.WriteLine("File parse success.");
} catch { Console.WriteLine("Parse error in the data file."); }
}
}
} catch (Exception e_Ex) {
Console.WriteLine(e_Ex.ToString());
}
My Prefab’s Hex Tree:
I am new to reading and writing data located in a hex data location so any help would be awesome!