示例#1
0
        public static string SaveDumpAutomatic(InputFormRef ifr
                                               , DumpStructSelectDialogForm.Func ff
                                               , string saveDir
                                               )
        {
            DumpStructSelectDialogForm f = (DumpStructSelectDialogForm)InputFormRef.JumpFormLow <DumpStructSelectDialogForm>();

            f.Init(ifr.BaseAddress);

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

            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
            {
                return("");
            }

            string fullfilename = Path.Combine(saveDir, filename);

            U.WriteAllText(fullfilename, text);
            return(fullfilename);
        }
示例#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();
        }