Beispiel #1
0
        public static void analyze(string record)
        {
            ESM.open(Config.Paths.mw_esm);
            Log lg = new Log("explore.txt");

            while (ESM.find(record))
            {
                TES3.Record rec = new TES3.Record();
                rec.read();

                lg.log(new string(rec.Name));

                foreach (SubRecord sr in rec.subRecords)
                {
                    lg.log("    " + new string(sr.name) + "       " + sr.size);

                    if (sr.isType("BYDT"))
                    {
                        byte[] flgs = sr.getData().ReadBytes(4);
                        lg.log(Text.toHex(flgs[2]));
                    }

                    else
                    {
                        lg.log(sr.readString());
                    }
                }
            }

            lg.show();
        }
Beispiel #2
0
        public static void analyze2(string record)
        {
            ESM.open(Config.Paths.mw_esm);
            Log lg = new Log("explore.txt");

            while (ESM.find(record))
            {
                TES3.Record rec = new TES3.Record();
                rec.read();

                byte[] flgs = rec.find_first("BYDT").getData().ReadBytes(4);

                if (flgs[0] == 0 && flgs[3] == 0)
                {
                    string edid = rec.find_first("NAME").readString();
                    string rnam = rec.find_first("FNAM").readString();
                    string sex  = "";

                    if (BinaryFlag.isSet((int)flgs[2], (int)0x01))
                    {
                        sex = "Female";
                    }
                    else
                    {
                        sex = "Male";
                    }



                    lg.log(rnam + "," + sex + "," + edid);
                }
            }

            lg.show();
        }
Beispiel #3
0
        public int read(int readable_size)
        {
            int read_size = 0;

            while (read_size < readable_size)
            {
                SubRecord subrec = new SubRecord();
                subrec.read();
                read_size = read_size + subrec.size + 8;

                BinaryReader srec_data = subrec.getData();

                if (subrec.isType("FRMR"))
                {
                    ESM.rewind(subrec.size + 8);
                    return(read_size - subrec.size - 8);
                }
                else if (subrec.isType("NAME"))
                {
                    editor_id = Text.trim(new string(srec_data.ReadChars(subrec.size)));
                }
                else if (subrec.isType("XSCL"))
                {
                    scale = srec_data.ReadSingle();
                }
                else if (subrec.isType("DATA"))
                {
                    x  = srec_data.ReadSingle();
                    y  = srec_data.ReadSingle();
                    z  = srec_data.ReadSingle();
                    xR = srec_data.ReadSingle();
                    yR = srec_data.ReadSingle();
                    zR = srec_data.ReadSingle();
                }
                else if (subrec.isType("DNAM"))
                {
                    isPortal = true;
                    portal.destination_cell = Text.trim(new string (srec_data.ReadChars(subrec.size)));
                }
                else if (subrec.isType("DODT"))
                {
                    editor_id = editor_id + "_zload";
                    isPortal  = true;
                    portal.x  = srec_data.ReadSingle();
                    portal.y  = srec_data.ReadSingle();
                    portal.z  = srec_data.ReadSingle();

                    portal.xR = srec_data.ReadSingle();
                    portal.yR = srec_data.ReadSingle();
                    portal.zR = srec_data.ReadSingle();
                }

                else if (subrec.isType("ANAM"))
                {
                    owner = Text.trim(new string(srec_data.ReadChars(subrec.size)));
                }
            }
            return(read_size);
        }