Esempio n. 1
0
    // Start is called before the first frame update
    void Start()
    {
        SERVER_HOST = hostAddress;

        if (offlineMode)
        {
            // = (TextAsset)Resources.Load("db.json", typeof(TextAsset));

            string           res = txt.text;
            HostDataPackage2 hdp = JsonUtility.FromJson <HostDataPackage2>(res);

            foreach (HostNode2 h in hdp.data)
            {
                byte[] bs = h.macAddress.Select(p => { byte b; byte.TryParse(p + "", out b); return(b); }).ToArray();
                h.tMacAddress = ByteArrayToString(bs);
                //Debug.Log($"{h.octets[0]}.{h.octets[1]}.{h.octets[2]}.{h.octets[3]}");
                //Debug.Log(h.tMacAddress);
            }

            Nodes = hdp.data;

            if (finishedLoadingData != null)
            {
                finishedLoadingData(new LoadingNetworkDataArgs(hdp), this);
            }

            // actions:
            //  - scan port
            //  - suggest possible exploits
            //      - system vulnerable to keylogger
            //      - root kit
            //      - DDOS attack on unprotected HTTP port.
        }
    }
 public LoadingNetworkDataArgs(HostDataPackage2 hdp) : base()
 {
     this.HDP2 = hdp;
 }