-
Notifications
You must be signed in to change notification settings - Fork 2
/
FastBasicAdministrator.cs
56 lines (55 loc) · 1.2 KB
/
FastBasicAdministrator.cs
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
using System;
namespace Hacknet
{
// Token: 0x02000165 RID: 357
internal class FastBasicAdministrator : Administrator
{
// Token: 0x060008FF RID: 2303 RVA: 0x000957E0 File Offset: 0x000939E0
public override void disconnectionDetected(Computer c, OS os)
{
base.disconnectionDetected(c, os);
for (int i = 0; i < c.ports.Count; i++)
{
c.closePort(c.ports[i], "LOCAL_ADMIN");
}
if (c.firewall != null)
{
c.firewall.resetSolutionProgress();
c.firewall.solved = false;
}
if (c.hasProxy)
{
c.proxyActive = true;
c.proxyOverloadTicks = c.startingOverloadTicks;
}
double time = 20.0 * Utils.random.NextDouble();
Action action = delegate()
{
if (os.connectedComp == null || os.connectedComp.ip != c.ip)
{
for (int j = 0; j < c.ports.Count; j++)
{
c.closePort(c.ports[j], "LOCAL_ADMIN");
}
if (this.ResetsPassword)
{
c.setAdminPassword(PortExploits.getRandomPassword());
}
c.adminIP = c.ip;
if (c.firewall != null)
{
c.firewall.resetSolutionProgress();
}
}
};
if (this.IsSuper)
{
action();
}
else
{
os.delayer.Post(ActionDelayer.Wait(time), action);
}
}
}
}