Ver código fonte

Merge branch 'master' of repo.nplusc.de:masterX244/iZinked

LH 1 ano atrás
pai
commit
fb81cd1358

+ 310 - 163
EatShitWürgaround/QuickHaxx/Program.cs

@@ -14,170 +14,314 @@ namespace QuickHaxx
         static void Main(string[] args)
         {
             int[] repull_lines = {
-                0,
-                48,
-                64,
-                80,
-                96,
-                112,
-                128,
-                144,
-                160,
-                176,
-                192,
-                224,
-                240,
-                256,
-                272,
-                288,
-                304,
-                320,
-                336,
-                352,
-                368,
-                384,
-                400,
-                416,
-                432,
-                448,
-                464,
-                480,
-                496,
-                800,
-                1216,
-                1232,
-                1584,
-                2208,
-                2960,
-                3408,
-                3600,
-                4144,
-                4480,
-                4704,
-                5296,
-                5328,
-                5440,
-                5472,
-                5840,
-                6512,
-                6560,
-                6592,
-                6736,
-                6752,
-                7120,
-                7968,
-                8096,
-                8160,
-                9968,
-                10464,
-                10672,
-                10912,
-                11712,
-                12128,
-                12576,
-                14064,
-                14176,
-                14464,
-                14960,
-                16048,
-                16912,
-                17968,
-                18160,
-                18816,
-                18928,
-                19488,
-                19536,
-                20528,
-                20704,
-                20880,
-                21216,
-                21280,
-                21376,
-                21728,
-                21808,
-                21856,
-                21888,
-                21936,
-                22032,
-                23472,
-                23728,
-                24240,
-                24400,
-                24976,
-                26656,
-                26672,
-                26816,
-                27120,
-                27280,
-                27488,
-                28352,
-                28816,
-                28960,
-                29264,
-                30400,
-                30864,
-                31056,
-                31216,
-                31280,
-                34288,
-                35744,
-                36160,
-                37520,
-                39072,
-                39552,
-                39664,
-                39920,
-                39984,
-                40000,
-                40512,
-                40960,
-                41184,
-                41536,
-                41632,
-                41920,
-                42320,
-                43584,
-                44192,
-                44944,
-                44960,
-                44992,
-                45424,
-                45584,
-                46064,
-                46224,
-                46544,
-                46976,
-                48016,
-                48176,
-                48432,
-                48736,
-                50864,
-                51216,
-                52096,
-                52896,
-                53376,
-                54352,
-                54672,
-                55376,
-                55536,
-                55568,
-                57968,
-                58672,
-                59504,
-                59552,
-                59568,
-                59664,
-                59840,
-                60464,
-                60912,
-                62704,
-                62992,
-                64192,
+0,
+48,
+64,
+80,
+96,
+112,
+128,
+144,
+160,
+176,
+192,
+208,
+224,
+240,
+256,
+272,
+288,
+304,
+320,
+336,
+352,
+368,
+384,
+400,
+416,
+432,
+448,
+464,
+480,
+496,
+3664,
+3792,
+4592,
+9504,
+15520,
+15760,
+16960,
+17072,
+17152,
+17200,
+17232,
+17280,
+17600,
+17680,
+17712,
+17952,
+18000,
+18032,
+24592,
+31408,
+31728,
+40560,
+42016,
+57664,
+58224,
+66592,
+69632,
+77440,
+77840,
+78800,
+91808,
+93440,
+95200,
+95568,
+96240,
+96400,
+101280,
+130096,
+135504,
+135520,
+135536,
+135552,
+135568,
+135584,
+135600,
+135616,
+135632,
+135648,
+135664,
+135680,
+135696,
+135712,
+135728,
+135744,
+135760,
+135776,
+135792,
+135808,
+135824,
+135840,
+135856,
+135872,
+135888,
+135904,
+135920,
+135936,
+135952,
+135968,
+135984,
+136000,
+136016,
+136032,
+136048,
+136064,
+136080,
+136096,
+136112,
+136128,
+136144,
+136160,
+136176,
+136192,
+136208,
+136224,
+136240,
+136256,
+136272,
+136288,
+136304,
+136320,
+136336,
+136352,
+136368,
+136384,
+136400,
+136416,
+136432,
+136448,
+136464,
+136480,
+136496,
+136512,
+136528,
+136544,
+136560,
+136576,
+136592,
+136608,
+136624,
+136640,
+136656,
+136672,
+136688,
+136704,
+136720,
+136736,
+136752,
+136768,
+136784,
+136800,
+136816,
+136832,
+136848,
+136864,
+136880,
+136896,
+136912,
+136928,
+136944,
+136960,
+136976,
+136992,
+137008,
+137024,
+137040,
+137056,
+137072,
+137088,
+137104,
+137120,
+137136,
+137152,
+137168,
+137184,
+137200,
+137216,
+137232,
+137248,
+137264,
+137280,
+137296,
+137312,
+137328,
+137344,
+137360,
+137376,
+137392,
+137408,
+137424,
+137440,
+137456,
+137472,
+137488,
+137504,
+137520,
+137536,
+137552,
+137568,
+137584,
+137600,
+137616,
+137632,
+137648,
+137664,
+137680,
+137696,
+137712,
+137728,
+137744,
+137760,
+137776,
+137792,
+137808,
+137824,
+137840,
+137856,
+137872,
+137888,
+137904,
+137920,
+137936,
+137952,
+137968,
+137984,
+138000,
+138016,
+138032,
+138048,
+138064,
+138080,
+138096,
+138112,
+138128,
+138144,
+138160,
+138176,
+138192,
+138208,
+138224,
+138240,
+138256,
+138272,
+138288,
+138304,
+138320,
+138336,
+138352,
+138368,
+138384,
+138400,
+138416,
+138432,
+138448,
+138464,
+138480,
+138496,
+138512,
+138528,
+138544,
+138560,
+138576,
+138592,
+138608,
+138624,
+138640,
+138656,
+138672,
+138688,
+138704,
+138720,
+138736,
+138752,
+138768,
+138784,
+138800,
+138816,
+138832,
+138848,
+138864,
+138880,
+138896,
+138912,
+138928,
+138944,
+138960,
+138976,
+138992,
+139008,
+139024,
+139040,
+139056,
+139072,
+139088,
+139104,
+139120,
+139136,
+139152,
+139168,
+139184,
+139200,
+139216,
+139232,
+139248,
             };
 
 
-            SerialPort _serialPort = new SerialPort("COM8", 115200, Parity.None, 8, StopBits.One);
-            StreamWriter w = new StreamWriter("C:\\LMAA\\085-flash\\flashhaxx-rehaxx"+(DateTime.Now.ToBinary())+".txt");
+            SerialPort _serialPort = new SerialPort("/dev/ttyUSB0", 115200, Parity.None, 8, StopBits.One);
+            StreamWriter w = new StreamWriter("/mnt/F40AD6B30AD671DA/src/iZinked/EatShitWürgaround/QuickHaxx/Dump-"+(DateTime.Now.ToBinary())+".txt");
             _serialPort.Handshake = Handshake.None;
             _serialPort.DataReceived += new SerialDataReceivedEventHandler((sender,e)=> 
             {
@@ -207,9 +351,9 @@ namespace QuickHaxx
             _serialPort.WriteLine("W"); //normal
             Thread.Sleep(100);
             //*/
-            for(int i=0;i<0x010000;i+=16)
+            for(int i=0;i<0x022000;i+=16)
             {
-                if (repull_lines.Contains(i))
+                if (repull_lines.Contains(i))//true == haxx
                 {
                     String hexed = i.ToString("x6");
                     Console.WriteLine(hexed);
@@ -218,6 +362,9 @@ namespace QuickHaxx
                     String a3 = hexed.Substring(4, 2);
                     _serialPort.WriteLine("[0x03 0x" + a1 + " 0x" + a2 + " 0x" + a3 + " r:16]"); //normal
                     Thread.Sleep(100);
+                    string data = _serialPort.ReadExisting();
+                    w.WriteLine(data);
+                    Console.WriteLine("R:"+data);
                 }
 
             }

+ 27 - 27
PlaceDECSVWiggler/build.gradle

@@ -1,27 +1,27 @@
-defaultTasks 'distZip'
-
-apply plugin: 'java-library'
-apply plugin: 'application'
-
-
-sourceCompatibility = 1.17
-version = 'SNAPSHOT'
-mainClassName = 'de.nplusc.izc.placeDE.Cookies.CSVWiggler'
-
-
-jar{
-	manifest{
-		attributes 'Implementation-Title': 'senabitwiggler',
-					'Implementation-Version': 'SNAPSHOT',
-					'Main-Class': 'de.nplusc.izc.placeDE.Cookies.CSVWiggler'
-					
-	}
-}
-
-repositories{
-	mavenCentral()
-}
-
-dependencies{
-	implementation 'com.eclipsesource.minimal-json:minimal-json:0.9.5'
-}
+defaultTasks 'distZip'
+
+apply plugin: 'java-library'
+apply plugin: 'application'
+
+
+sourceCompatibility = 1.17
+version = 'SNAPSHOT'
+mainClassName = 'de.nplusc.izc.placeDE.Cookies.CSVWiggler'
+
+
+jar{
+	manifest{
+		attributes 'Implementation-Title': 'senabitwiggler',
+					'Implementation-Version': 'SNAPSHOT',
+					'Main-Class': 'de.nplusc.izc.placeDE.Cookies.CSVWiggler'
+					
+	}
+}
+
+repositories{
+	mavenCentral()
+}
+
+dependencies{
+	implementation 'com.eclipsesource.minimal-json:minimal-json:0.9.5'
+}

+ 170 - 127
PlaceDECSVWiggler/src/main/java/de/nplusc/izc/placeDE/Cookies/CSVWiggler.java

@@ -1,127 +1,170 @@
-package de.nplusc.izc.placeDE.Cookies;
-
-import java.io.*;
-import java.util.HashSet;
-
-import com.eclipsesource.json.*;
-
-public class CSVWiggler {
-    private static final String EVT_SYS_ID = "958372977714540574";
-    public static void main(String[] args) {
-
-        if(args.length<1)
-        {
-            System.err.println("Filename missing");
-        }
-
-
-        File checkme = new File(args[0]);
-        if(!checkme.exists())
-        {
-            System.err.println("File not found");
-        }
-        try {
-            String intermediateFile = args[0] + ".converted.csv";
-            String cookies = args[0] + ".cookiemetadata.csv";
-            String mionutely = args[0] + ".minutemetadata.csv";
-
-            JsonObject obj = Json.parse(new FileReader(args[0])).asObject();
-            JsonArray arr = obj.get("messages").asArray();
-            PrintWriter w = new PrintWriter(new FileWriter(intermediateFile));
-            w.println("type;author;length;cookiecount;timestamp");
-            for (int i = 0; i < arr.size(); i++) {
-                boolean isEventSys = false;
-                JsonObject msg = arr.get(i).asObject();
-                JsonObject author = msg.get("author").asObject();
-                String id = author.getString("id", "---");
-                if (id.equals(EVT_SYS_ID)) {
-                    isEventSys = true;
-                    System.out.println("Eventsys");
-                }
-
-                String message = msg.getString("content", "");
-
-                int len = message.length();
-                String timestamp = msg.getString("timestamp", "");//.substring(0, 19);
-                int cookiecount = 0;
-                String type = "default";
-                if (isEventSys) {
-                    type = "leaderboard";
-                    JsonArray embeds = msg.get("embeds").asArray();
-                    if (!(embeds.size() == 0)) {
-                        JsonObject embed = embeds.get(0).asObject();
-                        String title = embed.getString("title", "");
-                        if (title.equals("Gesammelte Cookies")) {
-                            type = "cookie";
-                            String description = embed.getString("description", "0");
-                            String cntS = description.replace("Ihr konntet ", "").replace(" Cookies sammeln.", "").replace(" Cookie sammeln.", "");
-                            cookiecount = Integer.valueOf(cntS);
-                        }
-                    }
-                }
-                w.println(type + ";" + id + ";" + len + ";" + cookiecount + ";" + timestamp);
-            }
-            w.close();
-
-            w = new PrintWriter(new FileWriter(cookies));
-            PrintWriter w2 = new PrintWriter(new FileWriter(mionutely));
-
-            BufferedReader r = new BufferedReader(new FileReader(intermediateFile));
-            int lns = -100000;
-            int lnsMinutely = -100000;
-            String line = r.readLine();
-            line = r.readLine(); //datei köpfen
-            HashSet<String> users = new HashSet<>();
-            HashSet<String> usersMinutely = new HashSet<>();
-            String previousLineTS = "";
-
-            w.println("cookiedelta;usercount;type;author;length;cookiecount;timestamp");
-            w2.println("usercount;msgsMinute;timestamp");
-            while (line != null) {
-                String[] splitted = line.split(";");
-                if (line.contains("cookie;")) {
-                    String lnp = lns+"";
-                    if (lns < 0) {
-                        lnp = "-";
-                    }
-                    System.out.println(lns+"|"+lnp);
-                    w.println(lnp+";" +users.size()+";"+ line);
-                    lns = 0;
-                    users=new HashSet<>();
-                } else {
-                    String uid = splitted[1];
-                    if(!uid.equals(EVT_SYS_ID))
-                    {
-                        lns++;
-                        users.add(uid);
-                    }
-                }
-
-                String tsMinutely = splitted[4].substring(0, 16);
-                if(!previousLineTS.equals(tsMinutely))
-                {
-                    previousLineTS=tsMinutely;
-                    if(lnsMinutely>=0)
-                    {
-                        w2.println(+usersMinutely.size()+";"+lnsMinutely+";"+previousLineTS);
-                    }
-                    lnsMinutely=0;
-                    usersMinutely=new HashSet<>();
-                }
-                String uid = splitted[1];
-                if(!uid.equals(EVT_SYS_ID))
-                {
-                    lnsMinutely++;
-                    usersMinutely.add(uid);
-                }
-                line = r.readLine();
-            }
-            w.close();
-            w2.close();
-        }
-        catch (IOException ex)
-        {
-            ex.printStackTrace();
-        }
-    }
-}
+package de.nplusc.izc.placeDE.Cookies;
+
+import java.io.*;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.time.Instant;
+import java.time.temporal.ChronoUnit;
+import java.time.temporal.TemporalUnit;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+import java.util.HashSet;
+
+import com.eclipsesource.json.*;
+
+public class CSVWiggler {
+    private static final String EVT_SYS_ID = "958372977714540574";
+    public static void main(String[] args) {
+
+        if(args.length<1)
+        {
+            System.err.println("Filename missing");
+        }
+
+
+        File checkme = new File(args[0]);
+        if(!checkme.exists())
+        {
+            System.err.println("File not found");
+        }
+        try {
+            String intermediateFile = args[0] + ".converted.csv";
+            String cookies = args[0] + ".cookiemetadata.csv";
+            String mionutely = args[0] + ".minutemetadata.csv";
+
+            JsonObject obj = Json.parse(new FileReader(args[0])).asObject();
+            JsonArray arr = obj.get("messages").asArray();
+            PrintWriter w = new PrintWriter(new FileWriter(intermediateFile));
+            w.println("type;author;length;cookiecount;timestamp");
+            for (int i = 0; i < arr.size(); i++) {
+                boolean isEventSys = false;
+                JsonObject msg = arr.get(i).asObject();
+                JsonObject author = msg.get("author").asObject();
+                String id = author.getString("id", "---");
+                if (id.equals(EVT_SYS_ID)) {
+                    isEventSys = true;
+                    System.out.println("Eventsys");
+                }
+
+                String message = msg.getString("content", "");
+
+                int len = message.length();
+                String timestamp = msg.getString("timestamp", "").substring(0, 19);
+                int cookiecount = 0;
+                String type = "default";
+                if (isEventSys) {
+                    type = "leaderboard";
+                    JsonArray embeds = msg.get("embeds").asArray();
+                    if (!(embeds.size() == 0)) {
+                        JsonObject embed = embeds.get(0).asObject();
+                        String title = embed.getString("title", "");
+                        String content = embed.getString("title", "");
+                        if (title.equals("Gesammelte Cookies")) {
+                            type = "cookie";
+                            String description = embed.getString("description", "0");
+                            String cntS = description.replace("Ihr konntet ", "").replace(" Cookies sammeln.", "").replace(" Cookie sammeln.", "");
+                            cookiecount = Integer.valueOf(cntS);
+                        }
+                        else
+                        {
+                            if (title.equals("Ein Cookie!"))
+                            {
+                                type = "cookie";
+                                JsonArray fields = embed.get("fields").asArray();
+                                JsonObject countField = fields.get(0).asObject();
+                                String cntS = countField.getString("value","0");
+                                cookiecount = Integer.valueOf(cntS);
+                            }
+                        }
+                    }
+                }
+                w.println(type + ";" + id + ";" + len + ";" + cookiecount + ";" + timestamp);
+            }
+            w.close();
+
+            w = new PrintWriter(new FileWriter(cookies));
+            PrintWriter w2 = new PrintWriter(new FileWriter(mionutely));
+
+            BufferedReader r = new BufferedReader(new FileReader(intermediateFile));
+            int lns = -100000;
+            int lnsMinutely = -100000;
+            String line = r.readLine();
+            line = r.readLine(); //datei köpfen
+            HashSet<String> users = new HashSet<>();
+            HashSet<String> usersMinutely = new HashSet<>();
+            String previousLineTS = "";
+
+            w.println("cookiedelta;usercount;type;author;length;cookiecount;timestamp");
+            w2.println("usercount;msgsMinute;timestamp");
+            while (line != null) {
+                String[] splitted = line.split(";");
+                if (line.contains("cookie;")) {
+                    String lnp = lns+"";
+                    if (lns < 0) {
+                        lnp = "-";
+                    }
+                    System.out.println(lns+"|"+lnp);
+                    w.println(lnp+";" +users.size()+";"+ line);
+                    lns = 0;
+                    users=new HashSet<>();
+                } else {
+                    String uid = splitted[1];
+                    //if(!uid.equals(EVT_SYS_ID))
+                    //{
+                    lns++;
+                    users.add(uid);
+                    //}
+                }
+
+                String tsMinutely = splitted[4].substring(0, 16);
+                if(!previousLineTS.equals(tsMinutely))
+                {
+                    SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd_HH:mm");
+                    if(previousLineTS.length()>0)//suppress calc on head of file
+                    {
+                        int minutesToSynthesize = 0;
+                        try {
+                            Date old = parser.parse(previousLineTS.replace("T","_"));
+                            Instant calc= old.toInstant();
+                            Date current = parser.parse(tsMinutely.replace("T","_"));
+                            Long gap = ChronoUnit.MINUTES.between(old.toInstant(),current.toInstant());
+                            if(gap>1)
+                            {
+                                System.out.println("Gap:"+gap+"||"+previousLineTS+"|"+tsMinutely);
+                                System.out.println(">>"+old+"|"+current);
+                                for(int g=1;g<gap;g++)
+                                {
+                                    String ts = parser.format(Date.from(calc.plus(g, ChronoUnit.MINUTES)));
+                                    w2.println("0;0;"+(ts.replace("_","T")));
+                                }
+                            }
+                        } catch (ParseException e) {
+                            throw new RuntimeException(e);
+                        }
+                    }
+                    previousLineTS=tsMinutely;
+                    if(lnsMinutely>=0)
+                    {
+                        w2.println(+usersMinutely.size()+";"+lnsMinutely+";"+previousLineTS);
+                    }
+                    lnsMinutely=0;
+                    usersMinutely=new HashSet<>();
+                }
+                String uid = splitted[1];
+                if(!uid.equals(EVT_SYS_ID))
+                {
+                    lnsMinutely++;
+                    usersMinutely.add(uid);
+                }
+                line = r.readLine();
+            }
+            w.close();
+            w2.close();
+        }
+        catch (IOException ex)
+        {
+            ex.printStackTrace();
+        }
+    }
+}

+ 6 - 6
QuickStuff/src/main/java/QuickVerifyCrap/MajorityOfThreeReader.java

@@ -9,12 +9,12 @@ import java.io.PrintStream;
 
 public class MajorityOfThreeReader {
     public static void main(String[] args) throws FileNotFoundException {
-        String[] file1 = FileTK.fileload("C:\\LMAA\\085-flash\\filtered1.txt");
-        String[] file2 = FileTK.fileload("C:\\LMAA\\085-flash\\filtered2.txt");
-        String[] file3 = FileTK.fileload("C:\\LMAA\\085-flash\\filtered3.txt");
-        String[] patchfile = FileTK.fileload("C:\\LMAA\\085-flash\\filtered-rehaxx1.txt");
-        PrintStream s = new PrintStream(new FileOutputStream("C:\\LMAA\\085-flash\\filteredMerged.txt"));
-        PrintStream s_desussed = new PrintStream(new FileOutputStream("C:\\LMAA\\085-flash\\filteredMerged-patched.txt"));
+        String[] file1 = FileTK.fileload("/mnt/F40AD6B30AD671DA/src/iZinked/EatShitWürgaround/QuickHaxx/clean1.txt");
+        String[] file2 = FileTK.fileload("/mnt/F40AD6B30AD671DA/src/iZinked/EatShitWürgaround/QuickHaxx/clean2.txt");
+        String[] file3 = FileTK.fileload("/mnt/F40AD6B30AD671DA/src/iZinked/EatShitWürgaround/QuickHaxx/clean3.txt");
+        String[] patchfile = FileTK.fileload("/mnt/F40AD6B30AD671DA/src/iZinked/EatShitWürgaround/QuickHaxx/patchfix1.txt");
+        PrintStream s = new PrintStream(new FileOutputStream("/mnt/F40AD6B30AD671DA/src/iZinked/EatShitWürgaround/QuickHaxx/filteredMerged.txt"));
+        PrintStream s_desussed = new PrintStream(new FileOutputStream("/mnt/F40AD6B30AD671DA/src/iZinked/EatShitWürgaround/QuickHaxx/filteredMerged-patched.txt"));
         String susline = "00000000000000000000000000000000 ";
         String sus1 = "00000";
         String sus2 = "FFFFF";