Ejemplo n.º 1
0
        private void GrepButton_Click(object sender, EventArgs e)
        {
            string filename = SRCFileTextBox.Text;

            if (!File.Exists(filename))
            {
                return;
            }
            string searchFunction = this.TargtFunctionTextBox.Text;
            uint   addr           = U.atoh(searchFunction);

            if (addr != 0)
            {
                searchFunction = U.To0xHexString(U.toPointer(addr));
            }

            string searchReg = " " + this.SearhRegister.Text;

            string ret = Grep(filename, searchFunction, searchReg, (int)this.AllowRowsNumbe.Value);

            DumpStructSelectToTextDialogForm f = (DumpStructSelectToTextDialogForm)InputFormRef.JumpFormLow <DumpStructSelectToTextDialogForm>();

            f.Init("ArgGrep_" + searchFunction + " " + this.SearhRegister.Text + ".TXT"
                   , ret, new Dictionary <string, string>());
            f.ShowDialog();
        }
Ejemplo n.º 2
0
        public static void ShowDumpSelectDialog(InputFormRef ifr, string selectAddress)
        {
            uint addr = U.atoh(selectAddress);

            if (U.is_RAMPointer(addr))
            {//RAMの場合Dumpできないので、代わりにポインタツールの選択画面を開こう
                PointerToolCopyToForm ptcopyForm = (PointerToolCopyToForm)InputFormRef.JumpFormLow <PointerToolCopyToForm>();
                ptcopyForm.Init((uint)addr);
                ptcopyForm.ShowDialog();

                return;
            }
            if (!U.isSafetyOffset(addr))
            {
                return;
            }

            DumpStructSelectDialogForm f = (DumpStructSelectDialogForm)InputFormRef.JumpFormLow <DumpStructSelectDialogForm>();

            f.Init(addr);
            f.ShowDialog();


            DumpStructSelectDialogForm.Func ff = f.GetCallFunc();
            if (ff == DumpStructSelectDialogForm.Func.Func_Binary)
            {
                HexEditorForm hexeditor = (HexEditorForm)InputFormRef.JumpForm <HexEditorForm>(U.NOT_FOUND);
                hexeditor.JumpTo(addr);
                return;
            }
            else if (ff == DumpStructSelectDialogForm.Func.Func_Clipbord_Pointer)
            {
                U.SetClipboardText(U.ToHexString(U.toPointer(addr)));
                return;
            }
            else if (ff == DumpStructSelectDialogForm.Func.Func_Clipbord_Copy)
            {
                U.SetClipboardText(U.ToHexString(addr));
                return;
            }
            else if (ff == DumpStructSelectDialogForm.Func.Func_Clipbord_LittleEndian)
            {
                uint a = U.toPointer(addr);
                uint r = (((a & 0xFF) << 24)
                          + ((a & 0xFF00) << 8)
                          + ((a & 0xFF0000) >> 8)
                          + ((a & 0xFF000000) >> 24));

                U.SetClipboardText(U.ToHexString(r));
                return;
            }
            else if (ff == DumpStructSelectDialogForm.Func.Func_Clipbord_NoDollBreakPoint)
            {
                U.SetClipboardText("[" + U.ToHexString(U.toPointer(addr)) + "]?");
                return;
            }

            string text;
            string filename;
            Dictionary <string, string> addFiles = new Dictionary <string, string>();

            if (ff == DumpStructSelectDialogForm.Func.Func_STRUCT)
            {
                filename = ifr.SelfForm.Name + ifr.Prefix + ".h";
                text     = f.MakeStructString(ifr);
            }
            else if (ff == DumpStructSelectDialogForm.Func.Func_CSV)
            {
                filename = ifr.SelfForm.Name + ifr.Prefix + "_" + U.ToHexString8(ifr.BaseAddress) + ".csv";
                text     = f.MakeTSVString(ifr, true);
            }
            else if (ff == DumpStructSelectDialogForm.Func.Func_TSV)
            {
                filename = ifr.SelfForm.Name + ifr.Prefix + "_" + U.ToHexString8(ifr.BaseAddress) + ".tsv";
                text     = f.MakeTSVString(ifr, false);
            }
            else if (ff == DumpStructSelectDialogForm.Func.Func_EA)
            {
                filename = ifr.SelfForm.Name + ifr.Prefix + "_" + U.ToHexString8(ifr.BaseAddress) + ".event";
                text     = f.MakeEAString(ifr);
            }
            else if (ff == DumpStructSelectDialogForm.Func.Func_NMM)
            {
                string basename = ifr.SelfForm.Name + "_" + ifr.Prefix;
                filename = ifr.SelfForm.Name + ifr.Prefix + "_" + U.ToHexString8(ifr.BaseAddress) + ".nmm";
                text     = f.MakNMMString(ifr, basename, addFiles);
            }
            else if (ff == DumpStructSelectDialogForm.Func.Func_Import)
            {
                f.ImportTSV(ifr);
                return;
            }
            else
            {
                return;
            }

            DumpStructSelectToTextDialogForm showForm = (DumpStructSelectToTextDialogForm)InputFormRef.JumpFormLow <DumpStructSelectToTextDialogForm>();

            showForm.Init(filename, text, addFiles);
            showForm.ShowDialog();
        }