SBoT 1.0 decompiled with CFR 0.152
Full source recovered from SBoT.jar (July 2004) plus the three bundled example scripts (BoneBury, GuildFish, GuildFisher). Class names are the original RSC-era single-letter obfuscation (a.java-z.java); mudclient.java and Script.java kept their real names since those weren't obfuscated.
This commit is contained in:
@@ -0,0 +1,486 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.Socket;
|
||||
|
||||
public class x
|
||||
extends w
|
||||
implements Runnable {
|
||||
private InputStream E;
|
||||
private OutputStream F;
|
||||
private Socket G;
|
||||
private boolean H = false;
|
||||
private byte[] I;
|
||||
private int J;
|
||||
private int K;
|
||||
private boolean L = true;
|
||||
private static String[] M;
|
||||
|
||||
public x(Socket socket, a a2) throws IOException {
|
||||
this.G = socket;
|
||||
this.E = socket.getInputStream();
|
||||
this.F = socket.getOutputStream();
|
||||
this.L = false;
|
||||
a2.a(this);
|
||||
}
|
||||
|
||||
/*
|
||||
* WARNING - Removed try catching itself - possible behaviour change.
|
||||
*/
|
||||
public void a() {
|
||||
block11: {
|
||||
boolean bl = q.d;
|
||||
super.a();
|
||||
this.H = true;
|
||||
try {
|
||||
x x2 = this;
|
||||
if (!bl) {
|
||||
if (x2.E != null) {
|
||||
this.E.close();
|
||||
}
|
||||
x2 = this;
|
||||
}
|
||||
if (!bl) {
|
||||
if (x2.F != null) {
|
||||
this.F.close();
|
||||
}
|
||||
x2 = this;
|
||||
}
|
||||
Socket socket = x2.G;
|
||||
if (!bl) {
|
||||
if (socket == null) break block11;
|
||||
socket = this.G;
|
||||
}
|
||||
socket.close();
|
||||
}
|
||||
catch (IOException iOException) {
|
||||
System.out.println(M[1]);
|
||||
}
|
||||
}
|
||||
this.L = true;
|
||||
x x3 = this;
|
||||
synchronized (x3) {
|
||||
this.notify();
|
||||
}
|
||||
this.I = null;
|
||||
}
|
||||
|
||||
public int h() throws IOException {
|
||||
int n2 = this.H;
|
||||
if (!q.d) {
|
||||
if (n2 != 0) {
|
||||
return 0;
|
||||
}
|
||||
n2 = this.E.read();
|
||||
}
|
||||
return n2;
|
||||
}
|
||||
|
||||
public int d() throws IOException {
|
||||
int n2 = this.H;
|
||||
if (!q.d) {
|
||||
if (n2 != 0) {
|
||||
return 0;
|
||||
}
|
||||
n2 = this.E.available();
|
||||
}
|
||||
return n2;
|
||||
}
|
||||
|
||||
public void a(int n2, int n3, byte[] byArray) throws IOException {
|
||||
boolean bl = q.d;
|
||||
int n4 = this.H;
|
||||
if (!bl) {
|
||||
if (n4 != 0) {
|
||||
return;
|
||||
}
|
||||
n4 = 0;
|
||||
}
|
||||
int n5 = n4;
|
||||
boolean bl2 = false;
|
||||
while (n5 < n2) {
|
||||
int n6 = this.E.read(byArray, n5 + n3, n2 - n5);
|
||||
if (!bl) {
|
||||
int n7;
|
||||
if (n6 <= 0) {
|
||||
throw new IOException(M[0]);
|
||||
}
|
||||
n6 = n5 = n5 + n7;
|
||||
}
|
||||
if (!bl) continue;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* WARNING - Removed try catching itself - possible behaviour change.
|
||||
*/
|
||||
public void b(byte[] byArray, int n2, int n3) throws IOException {
|
||||
boolean bl = q.d;
|
||||
x x2 = this;
|
||||
if (!bl) {
|
||||
if (x2.H) {
|
||||
return;
|
||||
}
|
||||
x2 = this;
|
||||
}
|
||||
if (!bl) {
|
||||
if (x2.I == null) {
|
||||
this.I = new byte[5000];
|
||||
}
|
||||
x2 = this;
|
||||
}
|
||||
x x3 = x2;
|
||||
synchronized (x2) {
|
||||
block11: {
|
||||
x x4;
|
||||
int n4 = 0;
|
||||
while (n4 < n3) {
|
||||
this.I[this.K] = byArray[n4 + n2];
|
||||
this.K = (this.K + 1) % 5000;
|
||||
if (!bl) {
|
||||
x4 = this;
|
||||
if (bl) break block11;
|
||||
if (x4.K == (this.J + 4900) % 5000) {
|
||||
throw new IOException(M[3]);
|
||||
}
|
||||
++n4;
|
||||
}
|
||||
if (!bl) continue;
|
||||
}
|
||||
this.notify();
|
||||
x4 = x3;
|
||||
}
|
||||
// ** MonitorExit[v1] (shouldn't be in output)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* WARNING - Removed try catching itself - possible behaviour change.
|
||||
*/
|
||||
public void run() {
|
||||
boolean bl = q.d;
|
||||
boolean bl2 = false;
|
||||
while (!this.L) {
|
||||
int n2;
|
||||
int n3;
|
||||
block21: {
|
||||
x x2 = this;
|
||||
synchronized (x2) {
|
||||
int n4;
|
||||
int n5;
|
||||
block19: {
|
||||
block20: {
|
||||
int n6 = this.K;
|
||||
if (!bl) {
|
||||
if (n6 == this.J) {
|
||||
try {
|
||||
this.wait();
|
||||
}
|
||||
catch (InterruptedException interruptedException) {
|
||||
// empty catch block
|
||||
}
|
||||
}
|
||||
n6 = this.L ? 1 : 0;
|
||||
}
|
||||
if (!bl) {
|
||||
if (n6 != 0) {
|
||||
return;
|
||||
}
|
||||
n6 = this.J;
|
||||
}
|
||||
n3 = n6;
|
||||
n5 = this.K;
|
||||
n4 = this.J;
|
||||
if (bl) break block19;
|
||||
if (n5 < n4) break block20;
|
||||
n2 = this.K - this.J;
|
||||
if (!bl) break block21;
|
||||
}
|
||||
n5 = 5000;
|
||||
n4 = this.J;
|
||||
}
|
||||
n2 = n5 - n4;
|
||||
}
|
||||
}
|
||||
if (n2 <= 0) continue;
|
||||
try {
|
||||
this.F.write(this.I, n3, n2);
|
||||
}
|
||||
catch (IOException iOException) {
|
||||
this.y = true;
|
||||
this.C = M[2] + iOException;
|
||||
}
|
||||
this.J = (this.J + n2) % 5000;
|
||||
try {
|
||||
x x3 = this;
|
||||
if (!bl) {
|
||||
if (x3.K != this.J) continue;
|
||||
x3 = this;
|
||||
}
|
||||
x3.F.flush();
|
||||
}
|
||||
catch (IOException iOException) {
|
||||
this.y = true;
|
||||
this.C = M[2] + iOException;
|
||||
if (!bl) continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Handled impossible loop by duplicating code
|
||||
* Enabled aggressive block sorting
|
||||
*/
|
||||
static {
|
||||
char[] cArray;
|
||||
String[] stringArray;
|
||||
block43: {
|
||||
int n2;
|
||||
int n3;
|
||||
char[] cArray2;
|
||||
int n4;
|
||||
block42: {
|
||||
char[] cArray3;
|
||||
Object var0;
|
||||
block41: {
|
||||
int n5;
|
||||
int n6;
|
||||
char[] cArray4;
|
||||
block40: {
|
||||
char[] cArray5;
|
||||
block39: {
|
||||
int n7;
|
||||
int n8;
|
||||
char[] cArray6;
|
||||
block38: {
|
||||
char[] cArray7;
|
||||
block37: {
|
||||
int n9;
|
||||
int n10;
|
||||
char[] cArray8;
|
||||
block36: {
|
||||
stringArray = new String[4];
|
||||
var0 = null;
|
||||
char[] cArray9 = "\u0005\u0013|".toCharArray();
|
||||
n4 = 0;
|
||||
int n11 = cArray9.length;
|
||||
cArray8 = cArray9;
|
||||
n10 = n11;
|
||||
if (n11 <= 1) break block36;
|
||||
cArray7 = cArray8;
|
||||
n9 = n10;
|
||||
if (n10 <= n4) break block37;
|
||||
}
|
||||
do {
|
||||
char[] cArray10 = cArray8;
|
||||
char[] cArray11 = cArray8;
|
||||
int n12 = n4;
|
||||
while (true) {
|
||||
int n13;
|
||||
char c2 = cArray10[n12];
|
||||
switch (n4 % 5) {
|
||||
case 0: {
|
||||
n13 = 64;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
n13 = 92;
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
n13 = 58;
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
n13 = 92;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
n13 = 11;
|
||||
}
|
||||
}
|
||||
cArray10[n12] = (char)(c2 ^ n13);
|
||||
++n4;
|
||||
cArray8 = cArray11;
|
||||
n10 = n10;
|
||||
if (n10 != 0) break;
|
||||
cArray11 = cArray8;
|
||||
n9 = n10;
|
||||
n12 = n10;
|
||||
cArray10 = cArray8;
|
||||
}
|
||||
cArray7 = cArray8;
|
||||
n9 = n10;
|
||||
} while (n10 > n4);
|
||||
}
|
||||
stringArray[0] = new String(cArray7).intern();
|
||||
var0 = null;
|
||||
char[] cArray12 = "\u0005.H3y`?V3x)2]|x4._=f".toCharArray();
|
||||
n4 = 0;
|
||||
int n14 = cArray12.length;
|
||||
cArray6 = cArray12;
|
||||
n8 = n14;
|
||||
if (n14 <= 1) break block38;
|
||||
cArray5 = cArray6;
|
||||
n7 = n8;
|
||||
if (n8 <= n4) break block39;
|
||||
}
|
||||
do {
|
||||
char[] cArray13 = cArray6;
|
||||
char[] cArray14 = cArray6;
|
||||
int n15 = n4;
|
||||
while (true) {
|
||||
int n16;
|
||||
char c3 = cArray13[n15];
|
||||
switch (n4 % 5) {
|
||||
case 0: {
|
||||
n16 = 64;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
n16 = 92;
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
n16 = 58;
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
n16 = 92;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
n16 = 11;
|
||||
}
|
||||
}
|
||||
cArray13[n15] = (char)(c3 ^ n16);
|
||||
++n4;
|
||||
cArray6 = cArray14;
|
||||
n8 = n8;
|
||||
if (n8 != 0) break;
|
||||
cArray14 = cArray6;
|
||||
n7 = n8;
|
||||
n15 = n8;
|
||||
cArray13 = cArray6;
|
||||
}
|
||||
cArray5 = cArray6;
|
||||
n7 = n8;
|
||||
} while (n8 > n4);
|
||||
}
|
||||
stringArray[1] = new String(cArray5).intern();
|
||||
var0 = null;
|
||||
char[] cArray15 = "\u0014+H5\u007f%.\u0000".toCharArray();
|
||||
n4 = 0;
|
||||
int n17 = cArray15.length;
|
||||
cArray4 = cArray15;
|
||||
n6 = n17;
|
||||
if (n17 <= 1) break block40;
|
||||
cArray3 = cArray4;
|
||||
n5 = n6;
|
||||
if (n6 <= n4) break block41;
|
||||
}
|
||||
do {
|
||||
char[] cArray16 = cArray4;
|
||||
char[] cArray17 = cArray4;
|
||||
int n18 = n4;
|
||||
while (true) {
|
||||
int n19;
|
||||
char c4 = cArray16[n18];
|
||||
switch (n4 % 5) {
|
||||
case 0: {
|
||||
n19 = 64;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
n19 = 92;
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
n19 = 58;
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
n19 = 92;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
n19 = 11;
|
||||
}
|
||||
}
|
||||
cArray16[n18] = (char)(c4 ^ n19);
|
||||
++n4;
|
||||
cArray4 = cArray17;
|
||||
n6 = n6;
|
||||
if (n6 != 0) break;
|
||||
cArray17 = cArray4;
|
||||
n5 = n6;
|
||||
n18 = n6;
|
||||
cArray16 = cArray4;
|
||||
}
|
||||
cArray3 = cArray4;
|
||||
n5 = n6;
|
||||
} while (n6 > n4);
|
||||
}
|
||||
stringArray[2] = new String(cArray3).intern();
|
||||
var0 = null;
|
||||
char[] cArray18 = "\")\\:n2|U*n2:V3|".toCharArray();
|
||||
n4 = 0;
|
||||
int n20 = cArray18.length;
|
||||
cArray2 = cArray18;
|
||||
n3 = n20;
|
||||
if (n20 <= 1) break block42;
|
||||
cArray = cArray2;
|
||||
n2 = n3;
|
||||
if (n3 <= n4) break block43;
|
||||
}
|
||||
do {
|
||||
char[] cArray19 = cArray2;
|
||||
char[] cArray20 = cArray2;
|
||||
int n21 = n4;
|
||||
while (true) {
|
||||
int n22;
|
||||
char c5 = cArray19[n21];
|
||||
switch (n4 % 5) {
|
||||
case 0: {
|
||||
n22 = 64;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
n22 = 92;
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
n22 = 58;
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
n22 = 92;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
n22 = 11;
|
||||
}
|
||||
}
|
||||
cArray19[n21] = (char)(c5 ^ n22);
|
||||
++n4;
|
||||
cArray2 = cArray20;
|
||||
n3 = n3;
|
||||
if (n3 != 0) break;
|
||||
cArray20 = cArray2;
|
||||
n2 = n3;
|
||||
n21 = n3;
|
||||
cArray19 = cArray2;
|
||||
}
|
||||
cArray = cArray2;
|
||||
n2 = n3;
|
||||
} while (n3 > n4);
|
||||
}
|
||||
stringArray[3] = new String(cArray).intern();
|
||||
M = stringArray;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user