Esempio n. 1
0
        static void Main(string[] args)
        {
            //Opcodes.populateFromWPP();
            nameDB = new NameDB(String.Concat(Directory.GetCurrentDirectory(), "/Resources/Names.db"));

            if (args.Length == 1)
                dumpDB = new DumpDB(args[0]);
            else if (args.Length == 2)
            {
                dumpDB = new DumpDB(args[0]);
                funcDiff = new DiffDB(args[1]);
            }
            else
                dumpDB = new DumpDB("Dump.db");

            Logger.CreateOutputStream("Dump.txt");
            Logger.PrepOutputStram();

            for (int i = 0; i <= MAX_OPCODE; i++)
            {
                CMSG cmsg = dumpDB.CMSG_Get(i);
                if ( cmsg != null )
                {
                    LoadedCMSG.Add(cmsg);
                }

                SMSG smsg = dumpDB.SMSG_Get(i);
                if ( smsg != null )
                {
                    LoadedSMSG.Add(smsg);
                }

            }

            if(funcDiff != null && funcDiff.isOpen())
            {
                Namer.populateFromDiff();
            }

            Logger.WriteLine(LoadedCMSG.First().getTableHeader());
            foreach(CMSG cmsg in LoadedCMSG)
            {
                Logger.WriteLine(cmsg.ToString());
            }

            Logger.WriteLine();
            Logger.WriteLine(LoadedSMSG.First().getTableHeader());
            foreach(SMSG smsg in LoadedSMSG)
            {
                Logger.WriteLine(smsg.ToString());
            }

            Console.WriteLine("Diff complete! Press any key to close...");
            Console.ReadKey();

            //if (Config.BinDiff != string.Empty && Config.Opcode != string.Empty)
            //{
            //    Console.WriteLine(">> Opening Diff...");
            //    funcDiff = new BinDiff(Config.BinDiff);
            //    if (!funcDiff.OpenConnection())
            //    {
            //        Console.WriteLine(">> Failed to open diff!");
            //        return;
            //    }

            //    Console.WriteLine(">> Opening OpcodeTable...");
            //    OpTable = new OpcodeTable(Config.Opcode);
            //    if (!OpTable.OpenConnection())
            //    {
            //        Console.WriteLine(">> Failed to open OpcodeTable!");
            //        return;
            //    }
            //}
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            //Opcodes.populateFromWPP();
            nameDB = new NameDB(String.Concat(Directory.GetCurrentDirectory(), "/Resources/Names.db"));

            if (args.Length == 1)
            {
                dumpDB = new DumpDB(args[0]);
            }
            else if (args.Length == 2)
            {
                dumpDB   = new DumpDB(args[0]);
                funcDiff = new DiffDB(args[1]);
            }
            else
            {
                dumpDB = new DumpDB("Dump.db");
            }

            Logger.CreateOutputStream("Dump.txt");
            Logger.PrepOutputStram();

            for (int i = 0; i <= MAX_OPCODE; i++)
            {
                CMSG cmsg = dumpDB.CMSG_Get(i);
                if (cmsg != null)
                {
                    LoadedCMSG.Add(cmsg);
                }

                SMSG smsg = dumpDB.SMSG_Get(i);
                if (smsg != null)
                {
                    LoadedSMSG.Add(smsg);
                }
            }

            if (funcDiff != null && funcDiff.isOpen())
            {
                Namer.populateFromDiff();
            }

            Logger.WriteLine(LoadedCMSG.First().getTableHeader());
            foreach (CMSG cmsg in LoadedCMSG)
            {
                Logger.WriteLine(cmsg.ToString());
            }

            Logger.WriteLine();
            Logger.WriteLine(LoadedSMSG.First().getTableHeader());
            foreach (SMSG smsg in LoadedSMSG)
            {
                Logger.WriteLine(smsg.ToString());
            }

            Console.WriteLine("Diff complete! Press any key to close...");
            Console.ReadKey();

            //if (Config.BinDiff != string.Empty && Config.Opcode != string.Empty)
            //{
            //    Console.WriteLine(">> Opening Diff...");
            //    funcDiff = new BinDiff(Config.BinDiff);
            //    if (!funcDiff.OpenConnection())
            //    {
            //        Console.WriteLine(">> Failed to open diff!");
            //        return;
            //    }

            //    Console.WriteLine(">> Opening OpcodeTable...");
            //    OpTable = new OpcodeTable(Config.Opcode);
            //    if (!OpTable.OpenConnection())
            //    {
            //        Console.WriteLine(">> Failed to open OpcodeTable!");
            //        return;
            //    }
            //}
        }