public ME3Class(ObjectReader data, ExportTableEntry exp, PCCFile pcc) : base(data, exp, pcc) { _ImplInterfaces = new List<InterfaceMapEntry>(); _Components = new List<ComponentMapEntry>(); _FunctionRefs = new List<Int32>(); }
public bool LoadFromSource(PCCFile source) { SourcePCC = source; var entry = PCCFile.GetExportFromImport(this); if (entry == null) return false; SourceEntry = entry as ExportTableEntry; Object = SourceEntry.Object; ObjectType = SourceEntry.ObjectType; OuterObject = entry.OuterObject; OuterName = entry.OuterName; FullyLoaded = true; return true; }
public FloatPropertyValue(ObjectReader data, PCCFile pcc) : base(data, pcc, 4) { }
public GUIDPropertyValue(ObjectReader data, PCCFile pcc) : base(data, pcc, 16) { }
public ScalePropertyValue(ObjectReader data, PCCFile pcc) : base(data, pcc, 17) { }
public RwMatrix44PropertyValue(ObjectReader data, PCCFile pcc) : base(data, pcc, 64) { }
public ME3Object(ObjectReader data, ExportTableEntry exp, PCCFile pcc) { PCC = pcc; Data = data; ExportEntry = exp; }
public StrPropertyValue(ObjectReader data, PCCFile pcc, UInt32 size) : base(data, pcc, size) { }
public RwVector3PropertyValue Min; // TODO: figure out if this is really the correct syntax #endregion Fields #region Constructors public BioRwBoxPropertyValue(ObjectReader data, PCCFile pcc) : base(data, pcc, 25) { }
public ExportTableEntry(PCCFile current, ObjectReader data) : base(current, data) { }
public NamePropertyValue(ObjectReader data, PCCFile pcc) : base(data, pcc, 8) { }
public DefaultPropertyValue(ObjectReader data, PCCFile pcc, UInt32 size) { Data = data; PCC = pcc; Size = size; }
public ME3DefaultProperty(ObjectReader data, PCCFile pccObj) { Data = data; PCC = pccObj; }
int decompileFile(string file) { string name = Path.GetFileNameWithoutExtension(file); var stream = new FileStream(file, FileMode.Open); var pcc = new PCCFile(new PCCStreamReader(stream), name); pcc.DeserializeTables(); pcc.DeserializeObjects(); var deps = pcc.ImportPackageNames; pcc.ResolveLinks(); var dumpPath = outputTextField.Text +@"\" + pcc.Name + @"\"; System.IO.Directory.CreateDirectory(dumpPath); foreach (var exp in pcc.Exports.Where(e => e.ClassName.ToLower() == "class")) { var obj = exp.Object as ME3Class; var convert = new ME3ObjectConverter(obj); var ast = convert.ConvertClass(); var CodeBuilder = new CodeBuilderVisitor(); ast.AcceptVisitor(CodeBuilder); File.WriteAllLines(dumpPath + exp.ObjectName + ".txt", CodeBuilder.GetCodeLines()); } stream.Close(); return 1; }
public ObjectTableEntry(PCCFile current, ObjectReader data) { CurrentPCC = current; Data = data; }
public ME3State(ObjectReader data, ExportTableEntry exp, PCCFile pcc) : base(data, exp, pcc) { _FunctionMap = new List<FunctionMapEntry>(); }
public Int32 OuterIndex; // Object that contains the assigned delegate #endregion Fields #region Constructors public DelegatePropertyValue(ObjectReader data, PCCFile pcc, String name) : base(data, pcc, 12) { DelegateName = name;//name.Substring(2, name.Length - 12); }
public RotatorPropertyValue(ObjectReader data, PCCFile pcc) : base(data, pcc, 12) { }
public BioMask4PropertyValue(ObjectReader data, PCCFile pcc) : base(data, pcc, 1) { }
public StringRefPropertyValue(ObjectReader data, PCCFile pcc) : base(data, pcc, 4) { }
public NavReferencePropertyValue(ObjectReader data, PCCFile pcc) : base(data, pcc, 20) { }
public InterfacePropertyValue(ObjectReader data, PCCFile pcc) : base(data, pcc, 4) { }
public CoverReferencePropertyValue(ObjectReader data, PCCFile pcc) : base(data, pcc) { Size = 28; }
public void TestLoadUncompressed() { var loaded = new List<PCCFile>(); /*var corepath = @"G:\Code\ME3\temp\Core.pcc"; var corestream = new FileStream(corepath, FileMode.Open); var corepcc = new PCCFile(new PCCStreamReader(corestream), "Core"); Assert.IsTrue(corepcc.DeserializeTables()); Assert.IsTrue(corepcc.DeserializeObjects()); corepcc.ResolveLinks(); loaded.Add(corepcc); var enginepath = @"G:\Code\ME3\temp\Engine.pcc"; var enginestream = new FileStream(enginepath, FileMode.Open); var enginepcc = new PCCFile(new PCCStreamReader(enginestream), "Engine"); Assert.IsTrue(enginepcc.DeserializeTables()); Assert.IsTrue(enginepcc.DeserializeObjects()); Assert.IsTrue(enginepcc.ResolveLinks()); enginepcc.LoadDependencies(loaded); loaded.Add(enginepcc); var frameworkpath = @"G:\Code\ME3\temp\GameFramework.pcc"; var frameworkstream = new FileStream(frameworkpath, FileMode.Open); var frameworkpcc = new PCCFile(new PCCStreamReader(frameworkstream), "GameFramework"); Assert.IsTrue(frameworkpcc.DeserializeTables()); Assert.IsTrue(frameworkpcc.DeserializeObjects()); Assert.IsTrue(frameworkpcc.ResolveLinks()); frameworkpcc.LoadDependencies(loaded); loaded.Add(frameworkpcc); var onlinepath = @"G:\Code\ME3\temp\SFXOnlineFoundation.pcc"; var onlinestream = new FileStream(onlinepath, FileMode.Open); var onlinepcc = new PCCFile(new PCCStreamReader(onlinestream), "SFXOnlineFoundation"); Assert.IsTrue(onlinepcc.DeserializeTables()); Assert.IsTrue(onlinepcc.DeserializeObjects()); Assert.IsTrue(onlinepcc.ResolveLinks()); onlinepcc.LoadDependencies(loaded); loaded.Add(onlinepcc); var uipath = @"G:\Code\ME3\temp\GFxUI.pcc"; var uistream = new FileStream(uipath, FileMode.Open); var uipcc = new PCCFile(new PCCStreamReader(uistream), "GFxUI"); Assert.IsTrue(uipcc.DeserializeTables()); Assert.IsTrue(uipcc.DeserializeObjects()); Assert.IsTrue(uipcc.ResolveLinks()); uipcc.LoadDependencies(loaded); loaded.Add(uipcc); var wwisepath = @"G:\Code\ME3\temp\WwiseAudio.pcc"; var wwisestream = new FileStream(wwisepath, FileMode.Open); var wwisepcc = new PCCFile(new PCCStreamReader(wwisestream), "WwiseAudio"); Assert.IsTrue(wwisepcc.DeserializeTables()); Assert.IsTrue(wwisepcc.DeserializeObjects()); Assert.IsTrue(wwisepcc.ResolveLinks()); wwisepcc.LoadDependencies(loaded); loaded.Add(wwisepcc); var SFXGamepath = @"G:\Code\ME3\temp\SFXGame.pcc"; var SFXGamestream = new FileStream(SFXGamepath, FileMode.Open); var SFXGamepcc = new PCCFile(new PCCStreamReader(SFXGamestream), "SFXGame"); Assert.IsTrue(SFXGamepcc.DeserializeTables()); Assert.IsTrue(SFXGamepcc.DeserializeObjects()); Assert.IsTrue(SFXGamepcc.ResolveLinks()); SFXGamepcc.LoadDependencies(loaded); loaded.Add(SFXGamepcc); */ //var path = @"G:\Code\ME3\temp\SFXWeapon_Pistol_Carnifex.pcc"; //var stream = new FileStream(path, FileMode.Open); //var pcc = new PCCFile(new PCCStreamReader(stream), "SFXWeapon_Pistol_Carnifex"); //var path = @"G:\Code\ME3\temp\SFXWeapon_Heavy_ArcProjector.pcc"; //var stream = new FileStream(path, FileMode.Open); //var pcc = new PCCFile(new PCCStreamReader(stream), "SFXWeapon_Heavy_ArcProjector"); //var path = @"G:\Code\ME3\temp\SFXPawn_Brute.pcc"; //var stream = new FileStream(path, FileMode.Open); //var pcc = new PCCFile(new PCCStreamReader(stream), "SFXPawn_Brute"); //var path = @"G:\Code\ME3\temp\Asari_Adept_MP.pcc"; //var stream = new FileStream(path, FileMode.Open); //var pcc = new PCCFile(new PCCStreamReader(stream), "Asari_Adept_MP"); var path = @"G:\Code\ME3\temp\SFXGame.pcc"; var stream = new FileStream(path, FileMode.Open); var pcc = new PCCFile(new PCCStreamReader(stream), "SFXGame"); //var path = @"G:\Code\ME3\temp\BIOP_MP_COMMON.pcc"; //var stream = new FileStream(path, FileMode.Open); //var pcc = new PCCFile(new PCCStreamReader(stream), "BIOP_MP_COMMON"); //var path = @"G:\Code\ME3\temp\TM\BioD_ProMar_750Finale.pcc"; //var stream = new FileStream(path, FileMode.Open); //var pcc = new PCCFile(new PCCStreamReader(stream), "BioD_ProMar_750Finale"); Assert.IsTrue(pcc.DeserializeTables()); Assert.IsTrue(pcc.DeserializeObjects()); var deps = pcc.ImportPackageNames; /*foreach (var dep in deps.Where(x => !loaded.Any(p => p.Name == x))) { var depPath = @"G:\Code\ME3\temp\" + dep + ".pcc"; var depStream = new FileStream(depPath, FileMode.Open); var depPCC = new PCCFile(new PCCStreamReader(depStream), dep); Assert.IsTrue(depPCC.DeserializeTables()); Assert.IsTrue(depPCC.DeserializeObjects()); loaded.Add(depPCC); } pcc.LoadDependencies(loaded);*/ Assert.IsTrue(pcc.ResolveLinks()); var dumpPath = @"G:\Code\ME3\temp\dump\" + pcc.Name + @"\"; System.IO.Directory.CreateDirectory(dumpPath); foreach (var exp in pcc.Exports.Where(e => e.ClassName.ToLower() == "class")) { var obj = exp.Object as ME3Class; var convert = new ME3ObjectConverter(obj); var ast = convert.ConvertClass(); var CodeBuilder = new CodeBuilderVisitor(); ast.AcceptVisitor(CodeBuilder); File.WriteAllLines(dumpPath + exp.ObjectName + ".txt", CodeBuilder.GetCodeLines()); } /*foreach (var exp in pcc.Exports.Where(e => e.ClassName.ToLower() == "class")) { var obj = exp.Object as ME3Class; var convert = new ME3ObjectConverter(obj); var ast = convert.ConvertClass(); foreach (var func in ast.Functions) { Console.WriteLine("------------------------------" + func.Name + "------------------------------"); var CodeBuilder = new CodeBuilderVisitor(); func.AcceptVisitor(CodeBuilder); Console.Write(CodeBuilder.GetCodeString()); Console.WriteLine(""); } }*/ stream.Close(); }
public ME3ScriptStruct(ObjectReader data, ExportTableEntry exp, PCCFile pccObj) : base(data, exp, pccObj) { }
public StructPropertyValue(ObjectReader data, PCCFile pcc, UInt32 size, String name) : base(data, pcc, size) { StructName = name; }
public ME3ArrayProperty(ObjectReader data, ExportTableEntry exp, PCCFile pcc) : base(data, exp, pcc) { }
public AimTransformPropertyValue(ObjectReader data, PCCFile pcc) : base(data, pcc, 28) { }
public RwVector2PropertyValue(ObjectReader data, PCCFile pcc) : base(data, pcc, 8) { }
public ME3Enum(ObjectReader data, ExportTableEntry exp, PCCFile pcc) : base(data, exp, pcc) { }
public IntPointPropertyValue(ObjectReader data, PCCFile pcc) : base(data, pcc, 8) { }