Uh oh!
There was an error while loading. Please reload this page.
forked from forkification/OpenHacknet
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExeModule.cs
More file actions
Latest commit
161 lines (139 loc) · 4.61 KB
/
Copy pathExeModule.cs
File metadata and controls
161 lines (139 loc) · 4.61 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
usingSystem;
usingHacknet.Gui;
usingMicrosoft.Xna.Framework;
namespaceHacknet
{
// Token: 0x0200005E RID: 94
internalclassExeModule:Module
{
// Token: 0x060001C1 RID: 449 RVA: 0x00018094 File Offset: 0x00016294
publicExeModule(Rectanglelocation,OSoperatingSystem):base(location,operatingSystem)
{
this.targetIP=((operatingSystem.connectedComp==null)?operatingSystem.thisComputer.ip:operatingSystem.connectedComp.ip);
boolflag;
byterandomByte;
do
{
flag=false;
randomByte=Utils.getRandomByte();
for(inti=0;i<this.os.exes.Count;i++)
{
if(this.os.exes[i].PID==(int)randomByte)
{
flag=true;
break;
}
}
}
while(flag);
this.os.currentPID=(int)randomByte;
this.PID=(int)randomByte;
this.bounds=location;
}
// Token: 0x060001C2 RID: 450 RVA: 0x000181A0 File Offset: 0x000163A0
publicoverridevoidLoadContent()
{
this.bounds.Height=this.ramCost;
}
// Token: 0x060001C3 RID: 451 RVA: 0x000181B4 File Offset: 0x000163B4
publicoverridevoidUpdate(floatt)
{
this.bounds.Height=this.ramCost;
if(this.isExiting)
{
if(this.fade>=1f)
{
this.baseRamCost=this.ramCost;
}
this.ramCost=(int)((float)this.baseRamCost*this.fade);
this.bounds.Height=this.ramCost;
this.fade-=t*ExeModule.FADEOUT_RATE;
if(this.fade<=0f)
{
this.needsRemoval=true;
}
}
if(this.moveUpBy>=0f)
{
intnum=(int)(ExeModule.MOVE_UP_RATE*t);
this.bounds.Y=this.bounds.Y-num;
this.moveUpBy-=(float)num;
this.bounds.Y=Math.Max(this.bounds.Y,this.os.ram.bounds.Y+RamModule.contentStartOffset);
}
}
// Token: 0x060001C4 RID: 452 RVA: 0x000182C7 File Offset: 0x000164C7
publicoverridevoidDraw(floatt)
{
}
// Token: 0x060001C5 RID: 453 RVA: 0x000182CA File Offset: 0x000164CA
publicvirtualvoidCompleted()
{
}
// Token: 0x060001C6 RID: 454 RVA: 0x000182CD File Offset: 0x000164CD
publicvirtualvoidKilled()
{
}
// Token: 0x060001C7 RID: 455 RVA: 0x000182D0 File Offset: 0x000164D0
publicvirtualvoiddrawOutline()
{
Rectanglebounds=this.bounds;
RenderedRectangle.doRectangleOutline(bounds.X,bounds.Y,bounds.Width,bounds.Height,1,newColor?(this.os.moduleColorSolid));
bounds.X++;
bounds.Y++;
bounds.Width-=2;
bounds.Height-=2;
this.spriteBatch.Draw(Utils.white,bounds,this.os.moduleColorBacking*this.fade);
}
// Token: 0x060001C8 RID: 456 RVA: 0x0001837C File Offset: 0x0001657C
publicvirtualvoiddrawTarget(stringtypeName="app:")
{
if(this.bounds.Height>14)
{
stringtext="IP: "+this.targetIP;
Rectanglebounds=this.bounds;
bounds.Height=Math.Min(this.bounds.Height,14);
bounds.X++;
bounds.Width-=2;
this.spriteBatch.Draw(Utils.white,bounds,this.os.exeModuleTopBar);
RenderedRectangle.doRectangleOutline(bounds.X,bounds.Y,bounds.Width,bounds.Height,1,newColor?(this.os.topBarColor));
if(bounds.Height>=14)
{
Vector2vector=GuiData.detailfont.MeasureString(text);
this.spriteBatch.DrawString(GuiData.detailfont,text,newVector2((float)(this.bounds.X+this.bounds.Width)-vector.X,(float)this.bounds.Y),this.os.exeModuleTitleText);
this.spriteBatch.DrawString(GuiData.detailfont,typeName+this.IdentifierName,newVector2((float)(this.bounds.X+2),(float)this.bounds.Y),this.os.exeModuleTitleText);
}
}
}
// Token: 0x060001C9 RID: 457 RVA: 0x000184FC File Offset: 0x000166FC
publicRectangleGetContentAreaDest()
{
returnnewRectangle(this.bounds.X+1,this.bounds.Y+Module.PANEL_HEIGHT,this.bounds.Width-2,this.bounds.Height-Module.PANEL_HEIGHT-1);
}
// Token: 0x040001D3 RID: 467
publicstaticfloatFADEOUT_RATE=0.5f;
// Token: 0x040001D4 RID: 468
publicstaticfloatMOVE_UP_RATE=350f;
// Token: 0x040001D5 RID: 469
publicstaticintDEFAULT_RAM_COST=246;
// Token: 0x040001D6 RID: 470
publicintPID=0;
// Token: 0x040001D7 RID: 471
publicfloatfade=1f;
// Token: 0x040001D8 RID: 472
publicboolisExiting=false;
// Token: 0x040001D9 RID: 473
publicboolneedsRemoval=false;
// Token: 0x040001DA RID: 474
publicfloatmoveUpBy=0f;
// Token: 0x040001DB RID: 475
publicintramCost=ExeModule.DEFAULT_RAM_COST;
// Token: 0x040001DC RID: 476
privateintbaseRamCost=0;
// Token: 0x040001DD RID: 477
publicstringtargetIP="";
// Token: 0x040001DE RID: 478
publicboolneedsProxyAccess=false;
// Token: 0x040001DF RID: 479
publicstringIdentifierName="UNKNOWN";
}
}