Beispiel #1
0
        public static void msg_coverage(object sender, Frida.ScriptMessageEventArgs e)
        {
            lock (FileWriteLock)
            {
                // For coverage we use both messages and data
                // |-> Deserialize JSON message
                FridaMessage messageContent = JsonConvert.DeserializeObject <FridaMessage>(e.Message);
                if (messageContent.Type == "send")
                {
                    if (!String.IsNullOrEmpty(messageContent.Payload))
                    {
                        FileWriteWrapper(messageContent.Payload, null, OutputPath);
                    }
                }
                else
                {
                    Console.WriteLine("[!] Runtime error: " + messageContent.Payload, Color.FromArgb(255, 153, 153));
                }

                // Handle data
                if (e.Data != null)
                {
                    BBTableCount += (UInt64)(e.Data.Length / 8);
                    Console.WriteLine("[+] Block trace Length: " + e.Data.Length, Color.FromArgb(0, 255, 255));
                    Console.WriteLine("    |-> BBS slice: " + (e.Data.Length / 8) + "; Total BBS: " + BBTableCount, Color.FromArgb(0, 255, 255));

                    // Concat byte array
                    BBTableArray = BBTableArray.Concat(e.Data).ToArray();
                }
            }
        }
Beispiel #2
0
        public static void msg_script(object sender, Frida.ScriptMessageEventArgs e)
        {
            // For script payloads we only care about message content, not data
            // |-> Deserialize JSON message
            FridaMessage messageContent = JsonConvert.DeserializeObject <FridaMessage>(e.Message);

            if (messageContent.Type == "send")
            {
                if (!String.IsNullOrEmpty(messageContent.Payload))
                {
                    Console.WriteLine(messageContent.Payload, Color.FromArgb(0, 255, 255));
                }
            }
            else
            {
                Console.WriteLine("[!] Runtime error: " + messageContent.Payload, Color.FromArgb(255, 153, 153));
            }
        }