Skip to content

Commit 1f60cd9

Browse files
author
oxygencraft125
authored
2.0-beta2
2 parents 9ebe4b7 + 8757c5c commit 1f60cd9

File tree

6 files changed

+359
-14
lines changed

6 files changed

+359
-14
lines changed

DebugMod/AlwaysActiveAdmin.cs

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using Hacknet;
6+
7+
namespace DebugMod
8+
{
9+
class AlwaysActiveAdmin : Administrator
10+
{
11+
public override void disconnectionDetected(Computer c, OS os)
12+
{
13+
base.disconnectionDetected(c, os);
14+
for (int index = 0; index < c.ports.Count; ++index)
15+
c.closePort(c.ports[index], "LOCAL_ADMIN");
16+
if (c.firewall != null)
17+
{
18+
c.firewall.resetSolutionProgress();
19+
c.firewall.solved = false;
20+
}
21+
if (c.hasProxy)
22+
{
23+
c.proxyActive = true;
24+
c.proxyOverloadTicks = c.startingOverloadTicks;
25+
}
26+
Action action = (Action)(() =>
27+
{
28+
if (os.connectedComp != null && !(os.connectedComp.ip != c.ip))
29+
return;
30+
for (int index = 0; index < c.ports.Count; ++index)
31+
c.closePort(c.ports[index], "LOCAL_ADMIN");
32+
if (this.ResetsPassword)
33+
c.setAdminPassword(PortExploits.getRandomPassword());
34+
c.adminIP = c.ip;
35+
if (c.firewall != null)
36+
c.firewall.resetSolutionProgress();
37+
});
38+
action();
39+
double time;
40+
if (c.securityLevel == 0)
41+
{
42+
time = 60;
43+
} else if (c.securityLevel == 2) {
44+
time = 50.5;
45+
} else if (c.securityLevel == 4)
46+
{
47+
time = 25;
48+
} else
49+
{
50+
time = 10;
51+
}
52+
os.delayer.Post(ActionDelayer.Wait(time), action);
53+
os.timerExpired();
54+
}
55+
}
56+
}

DebugMod/Commands.cs

Lines changed: 153 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -219,12 +219,12 @@ public static bool AddIRCMessage(OS os, List<string> args)
219219
}
220220
public static bool StrikerAttack(OS os, List<string> args)
221221
{
222-
HackerScriptExecuter.runScript("DLC/ActionScripts/Hackers/SystemHack.txt", (object)os, (string)null, (string)null);
222+
HackerScriptExecuter.runScript("DLC/ActionScripts/Hackers/SystemHack.txt", (object)os, (string)null);
223223
return false;
224224
}
225225
public static bool ThemeAttack(OS os, List<string> args)
226226
{
227-
HackerScriptExecuter.runScript("HackerScripts/ThemeHack.txt", (object)os, (string)null, (string)null);
227+
HackerScriptExecuter.runScript("HackerScripts/ThemeHack.txt", (object)os, (string)null);
228228
return false;
229229
}
230230
public static bool CallThePoliceSoTheyCanTraceYou(OS os, List<string> args)
@@ -374,8 +374,14 @@ public static bool DeleteWhitelistDLL(OS os, List<string> args)
374374
List<int> FolderPath = new List<int>();
375375
FolderPath.Add(5);
376376
Folder folder = computer.files.root.searchForFolder("Whitelist");
377-
378-
folder.files.Remove(folder.files[0]);
377+
for (int index = 0; index < folder.files.Count; ++index)
378+
{
379+
if (folder.files[index].name.Equals("authenticator.dll"))
380+
{
381+
folder.files.Remove(folder.files[index]);
382+
os.execute("connect " + computer.ip);
383+
}
384+
}
379385
return false;
380386
}
381387
public static bool ChangeMusic(OS os, List<string> args)
@@ -593,12 +599,12 @@ public static bool RemoveProxy(OS os, List<string> args)
593599
computer.hasProxy = false;
594600
return false;
595601
}
596-
/*public static bool RemoveFirewall(OS os, List<string> args)
602+
public static bool RemoveFirewall(OS os, List<string> args)
597603
{
598604
Computer computer = os.connectedComp;
599-
computer.
605+
computer.firewall = null;
600606
return false;
601-
} */
607+
}
602608
public static bool AddComputer(OS os, List<string> args)
603609
{
604610
if (args.Count < 5)
@@ -705,7 +711,7 @@ public static bool OxygencraftStorageFaciltyCache(OS os, List<string> args) // D
705711
{
706712
if (computer.users[index].name.ToLower().Equals("admin")) {
707713
UserDetail user = computer.users[index];
708-
if (os.username == "oxygencraft")
714+
if (os.username == "oxygencraft" || os.username == "oxygencraft2" || os.username == "oxygencraft3" || os.username == "oxygencraft4")
709715
{
710716
user.known = true;
711717
}
@@ -775,9 +781,15 @@ public static bool WhitelistBypass(OS os, List<string> args)
775781
{
776782
Computer computer = Programs.getComputer(os, args[1]);
777783
Folder folder = computer.files.root.searchForFolder("Whitelist");
778-
folder.files.Remove(folder.files[1]);
779-
folder.files.Add(new FileEntry(os.thisComputer.ip, "list.txt"));
780-
os.execute("connect " + computer.ip);
784+
for (int index = 0; index < folder.files.Count; ++index)
785+
{
786+
if (folder.files[index].name.Equals("list.txt") || folder.files[index].name.Equals("source.txt"))
787+
{
788+
folder.files.Remove(folder.files[index]);
789+
folder.files.Add(new FileEntry(os.thisComputer.ip, "list.txt"));
790+
os.execute("connect " + computer.ip);
791+
}
792+
}
781793
return false;
782794
}
783795
public static bool SetTheme(OS os, List<string> args)
@@ -1073,5 +1085,135 @@ public static bool ForkbombProof(OS os, List<string> args)
10731085
os.totalRam = 1000000000;
10741086
return false;
10751087
}
1088+
public static bool ChangeCompIcon(OS os, List<string> args)
1089+
{
1090+
Computer computer = Programs.getComputer(os, args[1]);
1091+
computer.icon = args[2];
1092+
return false;
1093+
}
1094+
public static bool RemoveSongChangerDaemon(OS os, List<string> args)
1095+
{
1096+
Computer computer = Programs.getComputer(os, args[1]);
1097+
Daemon daemon = computer.getDaemon(typeof (SongChangerDaemon));
1098+
computer.daemons.Remove(daemon);
1099+
return false;
1100+
}
1101+
public static bool RemoveRicerConnectDaemon(OS os, List<string> args)
1102+
{
1103+
Computer computer = Programs.getComputer(os, args[1]);
1104+
Daemon daemon = computer.getDaemon(typeof(CustomConnectDisplayDaemon));
1105+
computer.daemons.Remove(daemon);
1106+
return false;
1107+
}
1108+
public static bool RemoveDLCCreditsDaemon(OS os, List<string> args)
1109+
{
1110+
Computer computer = Programs.getComputer(os, args[1]);
1111+
Daemon daemon = computer.getDaemon(typeof(DLCCreditsDaemon));
1112+
computer.daemons.Remove(daemon);
1113+
return false;
1114+
}
1115+
public static bool RemoveIRCDaemon(OS os, List<string> args)
1116+
{
1117+
Computer computer = Programs.getComputer(os, args[1]);
1118+
Daemon daemon = computer.getDaemon(typeof(IRCDaemon));
1119+
computer.daemons.Remove(daemon);
1120+
return false;
1121+
}
1122+
public static bool RemoveISPDaemon(OS os, List<string> args)
1123+
{
1124+
Computer computer = Programs.getComputer(os, args[1]);
1125+
Daemon daemon = computer.getDaemon(typeof(ISPDaemon));
1126+
computer.daemons.Remove(daemon);
1127+
return false;
1128+
}
1129+
public static bool ForkbombVirus(OS os, List<string> args) // Bugged
1130+
{
1131+
for (int index = 1; index < os.netMap.nodes.Count; ++index)
1132+
os.netMap.nodes[index].crash(os.thisComputer.ip);
1133+
1134+
1135+
1136+
return false;
1137+
}
1138+
public static bool InstallInviolabilty(OS os, List<string> args)
1139+
{
1140+
Computer computer = Programs.getComputer(os, args[1]);
1141+
computer.portsNeededForCrack = 9999999;
1142+
return false;
1143+
}
1144+
public static bool RemoveAllDaemons(OS os, List<string> args)
1145+
{
1146+
Computer computer = Programs.getComputer(os, args[1]);
1147+
computer.daemons.Clear();
1148+
return false;
1149+
}
1150+
public static bool ShowIPNamesAndID(OS os, List<string> args)
1151+
{
1152+
Computer computer = Programs.getComputer(os, args[1]);
1153+
os.write("ID: " + computer.idName);
1154+
os.write("Name: " + computer.name);
1155+
os.write("IP: " + computer.ip);
1156+
return false;
1157+
}
1158+
public static bool SummonDebugModDaemonComp(OS os, List<string> args)
1159+
{
1160+
Computer computer = new Computer("DebugMod Comp", NetworkMap.generateRandomIP(), os.netMap.getRandomPosition(), 50000, 2, os);
1161+
computer.idName = "debugMod";
1162+
os.netMap.nodes.Add(computer);
1163+
Dictionary<string, string> dict = new Dictionary<string, string>();
1164+
Daemon daemon = Pathfinder.Daemon.Instance.CreateInstance("DebugModDaemon", computer, dict);
1165+
//computer.daemons.Add(daemon);
1166+
os.execute("connect " + computer.ip);
1167+
return false;
1168+
}
1169+
public static bool ChangeAdmin(OS os, List<string> args)
1170+
{
1171+
Computer computer = Programs.getComputer(os, args[1]);
1172+
if (args[2] == "basic")
1173+
{
1174+
computer.admin = new BasicAdministrator();
1175+
} else if (args[2] == "fastbasic")
1176+
{
1177+
computer.admin = new FastBasicAdministrator();
1178+
} else if (args[2] == "fastprogress")
1179+
{
1180+
computer.admin = new FastProgressOnlyAdministrator();
1181+
} else if (args[2] == "alwaysactive")
1182+
{
1183+
computer.admin = new AlwaysActiveAdmin();
1184+
} else if (args[2] == "none")
1185+
{
1186+
computer.admin = null;
1187+
}
1188+
else
1189+
{
1190+
os.write("Usage: changeAdmin (IDORIPORName) (Admin)");
1191+
os.write("Valid options: basic,fastbasic,fastprogress,alwaysactive,none");
1192+
}
1193+
return false;
1194+
}
1195+
public static bool ViewAdmin(OS os, List<string> args)
1196+
{
1197+
Computer computer = Programs.getComputer(os, args[1]);
1198+
if (computer.admin == new BasicAdministrator())
1199+
{
1200+
os.write("Basic Admin");
1201+
} else if (computer.admin == new FastBasicAdministrator())
1202+
{
1203+
os.write("Fast Basic Admin");
1204+
} else if (computer.admin == new FastProgressOnlyAdministrator())
1205+
{
1206+
os.write("Fast Progress Admin");
1207+
} else if (computer.admin == new AlwaysActiveAdmin())
1208+
{
1209+
os.write("Always Active Admin");
1210+
}
1211+
else
1212+
{
1213+
os.write("You may of entered the computer incorrectly or there is no admin for the computer");
1214+
os.write("Usage: viewAdmin (IPORIDORName)");
1215+
}
1216+
return false;
1217+
}
10761218
}
10771219
}

DebugMod/DebugApp.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using Hacknet;
6+
using Pathfinder;
7+
8+
namespace DebugMod
9+
{
10+
class DebugAppExe : Pathfinder.Executable.Interface
11+
{
12+
public override string Identifier => "DebugAppExe";
13+
public override bool NeedsProxyAccess => false;
14+
public override int RamCost => 500;
15+
16+
public override bool? Update(Pathfinder.Executable.Instance instance, float time)
17+
{
18+
return true;
19+
}
20+
}
21+
}

DebugMod/DebugDaemon.cs

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using Microsoft.Xna.Framework;
6+
using Microsoft.Xna.Framework.Graphics;
7+
using Pathfinder.Daemon;
8+
using Hacknet;
9+
using Hacknet.Gui;
10+
11+
namespace DebugMod
12+
{
13+
class DebugDaemon : IInterface
14+
{
15+
public string InitialServiceName => "DebugMod";
16+
private DebugModState State;
17+
18+
public void Draw(Instance instance, Rectangle bounds, SpriteBatch sb) // Draws stuff on the screen, will need
19+
{
20+
Rectangle bounds1 = new Rectangle(bounds.X + 40, bounds.Y + 40, bounds.Width - 80, bounds.Height - 80);
21+
switch (State)
22+
{
23+
case DebugModState.HomePage:
24+
DrawHome(bounds1);
25+
break;
26+
case DebugModState.Page1:
27+
break;
28+
case DebugModState.Page2:
29+
break;
30+
case DebugModState.Page3:
31+
break;
32+
case DebugModState.Page4:
33+
break;
34+
case DebugModState.Page5:
35+
break;
36+
}
37+
}
38+
39+
private void DrawHome(Rectangle rect)
40+
{
41+
string text = "IT WORKS! IT WORKS!";
42+
Vector2 pos = new Vector2(20, 20);
43+
TextItem.doLabel(pos, text, null);
44+
}
45+
46+
public void InitFiles(Instance instance) // IDK what this does, maybe creates the files, in that case no
47+
{
48+
throw new NotImplementedException();
49+
}
50+
51+
public void LoadInit(Instance instance) // IDK what this does
52+
{
53+
throw new NotImplementedException();
54+
}
55+
56+
public void LoadInstance(Instance instance, Dictionary<string, string> objects) // IDK what this does
57+
{
58+
throw new NotImplementedException();
59+
}
60+
61+
public void OnCreate(Instance instance) // May or may not need this
62+
{
63+
64+
}
65+
66+
public void OnNavigatedTo(Instance instance) // Won't need this
67+
{
68+
State = DebugModState.HomePage;
69+
}
70+
71+
public void OnUserAdded(Instance instance, string name, string pass, byte type) // Won't need this
72+
{
73+
74+
}
75+
internal void NewCommand()
76+
{
77+
78+
}
79+
private enum DebugModState {
80+
HomePage,
81+
Page1,
82+
Page2,
83+
Page3,
84+
Page4,
85+
Page5,
86+
}
87+
}
88+
}

0 commit comments

Comments
 (0)