delete irrelevant and test code

This commit is contained in:
sirjonasxx 2018-06-13 00:39:16 +02:00
parent 78d7fbf691
commit 5d8cbcbf9d
3 changed files with 0 additions and 131 deletions

View File

@ -1,11 +0,0 @@
package main.irrelevant;
public class Timer {
private long time0 = System.nanoTime(), time1 = time0;
private boolean ended = false;
public void start() { time0 = System.nanoTime(); ended = false; }
public void end() { time1 = System.nanoTime(); ended = true; }
public double delta() {
if ( ! ended) { end(); }
return 1e-6 * (time1 - time0); }
}

View File

@ -761,32 +761,4 @@ public class HPacket {
return expression.toString().replace("{i:0}{b:false}{b:true}", "{s:}{i:1}");
}
public static void main(String[] args) {
// HPacket packet = new HPacket("[0][0][0]4[15] [0]!PRODUCTION-201802201205-141713395[0][5]FLASH[0][0][0][1][0][0][0][0]");
// packet.replaceFirstString("FLASH", "HTML");
// System.out.println(packet);
HPacket packet = new HPacket("[0][0][0]![14][134][0][21]99% kans je leest dit[0][0][0][0][0][0][0][29]");
System.out.println(packet.toExpression());
packet = new HPacket("[0][0][0]+[0]µ[0][10]Navigation[0][0][0][11]go.official[0][8]27636336[0][0][0][0]");
System.out.println(packet.toExpression());
packet = new HPacket("[0][0][0][11][7]/[0][0][0][2][0][0][0][0][0]");
System.out.println(packet.toExpression());
packet = new HPacket("[0][0][4]ÿ[5]×[0][0][0]<[0][7]new_ads[0][14]friend_finding[0][10]staffpicks[0][15]campaign_target[0][13]friends_rooms[0][6]groups[0][8]metadata[0][12]history_freq[0][13]highest_score[0][11]competition[0][21]category__Habbo Leven[0] category__Global Chat & Discussi[0] category__GLOBAL BUILDING AND DE[0][25]category__global official[0][22]category__global party[0][22]category__global games[0][22]category__global trade[0][24]category__global fansite[0][21]category__global help[0][31]category__global personal space[0][24]category__global reviews[0][19]category__global bc[0][31]category__global personal space[0] eventcategory__Vetste Evenemente[0][31]eventcategory__Feesten & Muziek[0][25]eventcategory__Rollenspel[0][24]eventcategory__Help Desk[0][21]eventcategory__Ruilen[0][20]eventcategory__Games[0][22]eventcategory__Bouwers[0] eventcategory__Debatten & Discus[0][24]eventcategory__Friending[0][25]eventcategory__Habbo Werk[0][24]eventcategory__Evenement[0] eventcategory__Groepsevenementen[0][9]favorites[0][16]eventcategory__2[0][15]official_134070[0][15]official_134072[0][15]official_134073[0][15]official_134074[0][15]official_134910[0][15]official_134912[0][15]official_134913[0][15]official_135420[0][15]official_135422[0][15]official_135423[0][15]official_135424[0][16]eventcategory__5[0][15]official_144124[0][15]official_144126[0][15]official_144127[0][16]category__Ruilen[0] category__Global Chat & Discussi[0] category__GLOBAL BUILDING AND DE[0][15]official_148980[0][15]official_148981[0][15]official_148982[0][15]official_148984[0][15]official_148985");
System.out.println(packet.toExpression());
packet = new HPacket("[0][0][0][18][2][144][0][12]myworld_view[0][0]");
System.out.println(packet.toExpression());
packet = new HPacket("[0][0][0]ã[4]Ù[0][0][0][12][0][0][0][1][0][18]Vetste Evenementen[0][0][0][0][2][0][16]Feesten & Muziek[1][0][0][0][3][0][10]Rollenspel[1][0][0][0][4][0][9]Help Desk[1][0][0][0][5][0][6]Ruilen[1][0][0][0][6][0][5]Games[1][0][0][0][7][0][7]Bouwers[1][0][0][0][8][0][21]Debatten & Discussies[1][0][0][0][9][0][9]Friending[1][0][0][0][10][0][10]Habbo Werk[1][0][0][0][11][0][9]Evenement[1][0][0][0][12][0][17]Groepsevenementen[0]");
System.out.println(packet.toExpression());
packet = new HPacket("[0][0][0][14][12]ã[0][0][0][4][0][0][0][0][1][26]#»");
System.out.println(packet.toExpression());
}
}

View File

@ -203,96 +203,4 @@ public class RC4 {
}
}
public void printKey() {
System.out.println(new HPacket(state).toString());
}
private static void printState(byte[] booleans) {
StringBuilder builder = new StringBuilder("state: ");
for (byte bool : booleans) {
builder.append(bool);
builder.append(",");
}
System.out.println(builder);
}
public static void main(String[] args) {
byte[] sharedKey = new byte[27];
List<Byte> allbytesEncrypted = new ArrayList<>();
RC4 p1 = new RC4(sharedKey);
System.out.println("original:");
printState(p1.state);
System.out.println("x: " + p1.x + ", y: " + p1.y);
byte[] enc1 = p1.rc4("hallo dit istoch wel redelijk veel tekst ofzo denk k".getBytes());
for (int i = 0; i < enc1.length; i++) {
allbytesEncrypted.add(enc1[i]);
}
byte[] enc2 = p1.rc4("dit is ook redelijk wa tekst maar mag nog veel meer zijn eigelijk in principe hoor".getBytes());
for (int i = 0; i < enc2.length; i++) {
allbytesEncrypted.add(enc2[i]);
}
System.out.println("-----------");
System.out.println("after being sent:");
printState(p1.state);
System.out.println("x: " + p1.x + ", y: " + p1.y);
byte[] allencrypted = new byte[allbytesEncrypted.size()];
for (int i = 0; i < allbytesEncrypted.size(); i++) {
allencrypted[i] = allbytesEncrypted.get(i);
}
p1.undoRc4(allencrypted);
System.out.println("-----------");
System.out.println("after undo:");
printState(p1.state);
System.out.println("x: " + p1.x + ", y: " + p1.y);
// byte[] sharedKey = new byte[27];
//
// RC4 p1 = new RC4(sharedKey);
// RC4 p2 = new RC4(sharedKey);
//
// p1.printKey();
// p2.printKey();
// byte[] enc = p1.rc4("hallo".getBytes());
// System.out.println(new String(p2.rc4(enc)));
//
// p1.printKey();
// p2.printKey();
//
// enc = p1.rc4("hallo".getBytes());
// System.out.println(new String(p2.rc4(enc)));
//
// p1.printKey();
// p2.printKey();
//
// enc = p1.rc4("meneeeer dit zijn echt veel meer dan 27 characters dus latne we dit even proberen".getBytes());
// System.out.println(new String(p2.rc4(enc)));
//
// p1.printKey();
// p2.printKey();
}
// public static void main(String[] args) {
// byte[] plainData = "abc123".getBytes();
// byte[] key = "Key".getBytes();
// RC4 rc4 = new RC4(key);
// byte[] cipherData = rc4.rc4(plainData);
// System.out.println("加密后: " + new String(cipherData));
// byte[] _plainData = rc4.rc4(cipherData);
// System.out.println("解密后: " + new String(_plainData));
// System.out.println(Arrays.equals(plainData, _plainData));
// }
}