Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Project LoadInstaller()
- {
- Project p = new Project();
- ReadInt(); // id;
- ReadInt(); // version;
- m_obfuscation.Seed = ReadInt(); // seed
- ReadInt(); // version
- p.Hidden = ReadBool();
- p.Name = ReadString();
- p.TempDirectory = ReadString();
- p.Version = ReadString();
- p.Author = ReadString();
- p.DateModified = ReadString();
- p.License = ReadString();
- p.Information = ReadString();
- p.HelpFile = ReadString();
- p.Hidden = ReadBool();
- int count = ReadInt();
- while ((count--) > 0)
- p.Uses.Add(ReadString());
- count = ReadInt();
- while((count--) > 0)
- {
- IncludeFile file = new IncludeFile();
- ReadInt();
- file.Name = ReadString();
- file.Path = ReadString();
- file.Type = (FileType)ReadInt();
- file.InitializeCode = ReadString();
- file.FinalizeCode = ReadString();
- int tmpCount = ReadInt();
- while ((tmpCount--) > 0)
- {
- Function function = new Function();
- ReadInt();
- function.Name = ReadString();
- function.ExternalName = ReadString();
- function.HelpLine = ReadString();
- function.Hidden = ReadBool();
- int argCount = ReadInt();
- while ((argCount--) > 0)
- function.Arguments.Add((ResultType)ReadInt());
- function.ResultType = (ResultType)ReadInt();
- }
- tmpCount = ReadInt();
- while ((tmpCount--) > 0)
- file.Constants.Add(ReadString());
- p.Files.Add(file);
- }
- if (!string.IsNullOrEmpty(p.HelpFile))
- {
- byte[] b = ReadBytes(ReadInt());
- Inflater inf = new Inflater();
- inf.SetInput(b);
- using (BinaryWriter w = new BinaryWriter(new FileStream(Path.GetFileName(p.HelpFile), FileMode.OpenOrCreate, FileAccess.ReadWrite)))
- {
- while (!inf.IsFinished)
- {
- byte[] output = new byte[1000];
- long size = inf.Inflate(output);
- w.Write(output, 0, (int)size);
- }
- }
- }
- for (int i = 0; i < p.Files.Count; i++)
- {
- if (!string.IsNullOrEmpty(p.Files[i].Name))
- {
- byte[] b = ReadBytes(ReadInt());
- Inflater inf = new Inflater();
- inf.SetInput(b);
- using (BinaryWriter w = new BinaryWriter(new FileStream(p.Files[i].Name, FileMode.OpenOrCreate, FileAccess.ReadWrite)))
- {
- while (!inf.IsFinished)
- {
- byte[] output = new byte[1000];
- long size = inf.Inflate(output);
- w.Write(output, 0, (int)size);
- }
- }
- }
- }
- return p;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement