Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathFileEntry.cs
More file actions
Latest commit
102 lines (91 loc) · 3.05 KB
/
Copy pathFileEntry.cs
File metadata and controls
102 lines (91 loc) · 3.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
usingSystem;
usingSystem.Collections.Generic;
usingSystem.IO;
usingMicrosoft.Xna.Framework.Content;
namespaceHacknet
{
// Token: 0x0200010F RID: 271
publicclassFileEntry:FileType
{
// Token: 0x06000664 RID: 1636 RVA: 0x0006A2F8 File Offset: 0x000684F8
publicFileEntry()
{
intindex=Utils.random.Next(0,FileEntry.filenames.Count-1);
this.name=FileEntry.filenames[index];
this.data=FileEntry.fileData[index];
this.size=this.data.Length*8;
this.secondCreatedAt=(int)OS.currentElapsedTime;
}
// Token: 0x06000665 RID: 1637 RVA: 0x0006A368 File Offset: 0x00068568
publicFileEntry(stringdataEntry,stringnameEntry)
{
nameEntry=nameEntry.Replace(" ","_");
this.name=nameEntry;
this.data=dataEntry;
this.size=this.data.Length*8;
this.secondCreatedAt=(int)OS.currentElapsedTime;
}
// Token: 0x06000666 RID: 1638 RVA: 0x0006A3C0 File Offset: 0x000685C0
publicstringhead()
{
intnum=0;
stringtext="";
while(num<this.data.Length&&this.data[num]!='\n'&&num<50)
{
text+=this.data[num];
num++;
}
returntext;
}
// Token: 0x06000667 RID: 1639 RVA: 0x0006A428 File Offset: 0x00068628
publicstringgetName()
{
returnthis.name;
}
// Token: 0x06000668 RID: 1640 RVA: 0x0006A440 File Offset: 0x00068640
publicstaticvoidinit(ContentManagercontent)
{
FileEntry.filenames=newList<string>(128);
FileEntry.fileData=newList<string>(128);
DirectoryInfodirectoryInfo=newDirectoryInfo(Path.Combine(content.RootDirectory,"files"));
FileInfo[]files=directoryInfo.GetFiles("*.*");
for(inti=0;i<files.Length;i++)
{
FileEntry.filenames.Add(Path.GetFileNameWithoutExtension(files[i].Name));
stringfilename="Content/files/"+Path.GetFileName(files[i].Name);
FileEntry.fileData.Add(Utils.readEntireFile(filename));
}
stringfilename2=Settings.EducationSafeBuild?"Content/BashLogs_StudentSafe.txt":"Content/BashLogs.txt";
stringtext=Utils.readEntireFile(filename2);
string[]separator=newstring[]
{
"\n#"
};
string[]array=text.Split(separator,StringSplitOptions.RemoveEmptyEntries);
for(inti=0;i<array.Length;i++)
{
array[i].Trim();
intnum=array[i].Length-array[i].IndexOf("\r\n");
FileEntry.filenames.Add("IRC_Log:"+array[i].Substring(0,array[i].IndexOf("\r\n")).Replace("- [X]","").Replace(" ",""));
stringstr=array[i].Substring(array[i].IndexOf("\r\n")).Replace("\n ","\n");
if(Settings.ActiveLocale=="en-us")
{
str=FileSanitiser.purifyStringForDisplay(str);
}
FileEntry.fileData.Add(str+"\n\nArchived Via : http://Bash.org");
}
}
// Token: 0x04000726 RID: 1830
publicstaticList<string>filenames;
// Token: 0x04000727 RID: 1831
publicstaticList<string>fileData;
// Token: 0x04000728 RID: 1832
publicstringname;
// Token: 0x04000729 RID: 1833
publicstringdata;
// Token: 0x0400072A RID: 1834
publicintsize;
// Token: 0x0400072B RID: 1835
publicintsecondCreatedAt;
}
}