Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.46 KB | None | 0 0
  1. public Project LoadInstaller()
  2. {
  3. Project p = new Project();
  4. ReadInt(); // id;
  5. ReadInt(); // version;
  6. m_obfuscation.Seed = ReadInt(); // seed
  7.  
  8. ReadInt(); // version
  9. p.Hidden = ReadBool();
  10. p.Name = ReadString();
  11. p.TempDirectory = ReadString();
  12. p.Version = ReadString();
  13. p.Author = ReadString();
  14. p.DateModified = ReadString();
  15. p.License = ReadString();
  16. p.Information = ReadString();
  17. p.HelpFile = ReadString();
  18. p.Hidden = ReadBool();
  19. int count = ReadInt();
  20.  
  21. while ((count--) > 0)
  22. p.Uses.Add(ReadString());
  23.  
  24. count = ReadInt();
  25.  
  26. while((count--) > 0)
  27. {
  28. IncludeFile file = new IncludeFile();
  29. ReadInt();
  30. file.Name = ReadString();
  31. file.Path = ReadString();
  32. file.Type = (FileType)ReadInt();
  33. file.InitializeCode = ReadString();
  34. file.FinalizeCode = ReadString();
  35. int tmpCount = ReadInt();
  36.  
  37. while ((tmpCount--) > 0)
  38. {
  39. Function function = new Function();
  40. ReadInt();
  41. function.Name = ReadString();
  42. function.ExternalName = ReadString();
  43. function.HelpLine = ReadString();
  44. function.Hidden = ReadBool();
  45. int argCount = ReadInt();
  46. while ((argCount--) > 0)
  47. function.Arguments.Add((ResultType)ReadInt());
  48.  
  49. function.ResultType = (ResultType)ReadInt();
  50. }
  51.  
  52. tmpCount = ReadInt();
  53.  
  54. while ((tmpCount--) > 0)
  55. file.Constants.Add(ReadString());
  56.  
  57. p.Files.Add(file);
  58. }
  59.  
  60. if (!string.IsNullOrEmpty(p.HelpFile))
  61. {
  62. byte[] b = ReadBytes(ReadInt());
  63. Inflater inf = new Inflater();
  64. inf.SetInput(b);
  65.  
  66. using (BinaryWriter w = new BinaryWriter(new FileStream(Path.GetFileName(p.HelpFile), FileMode.OpenOrCreate, FileAccess.ReadWrite)))
  67. {
  68. while (!inf.IsFinished)
  69. {
  70. byte[] output = new byte[1000];
  71. long size = inf.Inflate(output);
  72. w.Write(output, 0, (int)size);
  73. }
  74. }
  75.  
  76. }
  77. for (int i = 0; i < p.Files.Count; i++)
  78. {
  79. if (!string.IsNullOrEmpty(p.Files[i].Name))
  80. {
  81. byte[] b = ReadBytes(ReadInt());
  82. Inflater inf = new Inflater();
  83. inf.SetInput(b);
  84.  
  85. using (BinaryWriter w = new BinaryWriter(new FileStream(p.Files[i].Name, FileMode.OpenOrCreate, FileAccess.ReadWrite)))
  86. {
  87. while (!inf.IsFinished)
  88. {
  89. byte[] output = new byte[1000];
  90. long size = inf.Inflate(output);
  91. w.Write(output, 0, (int)size);
  92. }
  93. }
  94.  
  95. }
  96. }
  97. return p;
  98. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement