예제 #1
0
        AsmMapFile MakeFullLow()
        {
            AsmMapFile map = new AsmMapFile(this.BaseSymbol);

            if (IsStopFlag)
            {
                return(map);
            }

            //LDRマップのクリア
            this.LDRMapCache = new List <DisassemblerTrumb.LDRPointer>(0x1000);
            this.FELintCache = new Dictionary <uint, List <FELint.ErrorSt> >();

            List <DisassemblerTrumb.LDRPointer> ldrmap;

            try
            {
                ldrmap           = DisassemblerTrumb.MakeLDRMap(Program.ROM.Data, 0x100);
                this.LDRMapCache = ldrmap;
                if (IsStopFlag)
                {
                    return(map);
                }
            }
            catch (Exception e)
            {
                Log.Error(e.ToString());
                Debug.Assert(false);
                return(map);
            }

            try
            {
                MakeHardCodeWarning(); //ハードコーディングされているデータの警告
                if (IsStopFlag)
                {
                    return(map);
                }
            }
            catch (Exception e)
            {
                Log.Error(e.ToString());
                Debug.Assert(false);
            }

            try
            {
                ScanFELintByThread(ldrmap);
                if (IsStopFlag)
                {
                    return(map);
                }
            }
            catch (Exception e)
            {
                Log.Error(e.ToString());
                Debug.Assert(false);
                return(map);
            }

            Dictionary <uint, bool> knownDic = new Dictionary <uint, bool>();
            List <Address>          structlist;

            try
            {
                structlist = U.MakeAllStructPointersList(false); //既存の構造体
                if (IsStopFlag)
                {
                    return(map);
                }
            }
            catch (Exception e)
            {
                Log.Error(e.ToString());
                Debug.Assert(false);
                return(map);
            }

            try
            {
                PatchForm.MakePatchStructDataList(structlist, true, true, false); //パッチが知っている領域.
                if (IsStopFlag)
                {
                    return(map);
                }
            }
            catch (Exception e)
            {
                Log.Error(e.ToString());
                Debug.Assert(false);
            }

            try
            {
                //参照の逆追跡
                this.VarsIDArray = U.MakeVarsIDArray(map);
                if (IsStopFlag)
                {
                    return(map);
                }
            }
            catch (Exception e)
            {
                Log.Error(e.ToString());
                Debug.Assert(false);
            }

            try
            {
                GraphicsToolForm.MakeLZ77DataList(structlist); //lz77で圧縮されたもの(主に画像)
                if (IsStopFlag)
                {
                    return(map);
                }
            }
            catch (Exception e)
            {
                Log.Error(e.ToString());
                Debug.Assert(false);
            }

            try
            {
                ProcsScriptForm.MakeAllDataLength(structlist, ldrmap);
                if (IsStopFlag)
                {
                    return(map);
                }
            }
            catch (Exception e)
            {
                Log.Error(e.ToString());
                Debug.Assert(false);
            }

            try
            {
                OAMSPForm.MakeAllDataLength(structlist, structlist, ldrmap);
                if (IsStopFlag)
                {
                    return(map);
                }
            }
            catch (Exception e)
            {
                Log.Error(e.ToString());
                Debug.Assert(false);
            }

            try
            {
                knownDic = AsmMapFile.MakeKnownListToDic(structlist);
                AsmMapFile.MakeFreeDataList(structlist, knownDic, 0x100, 0x00, 16); //フリー領域
                if (IsStopFlag)
                {
                    return(map);
                }
            }
            catch (Exception e)
            {
                Log.Error(e.ToString());
                Debug.Assert(false);
            }

            try
            {
                AsmMapFile.MakeFreeDataList(structlist, knownDic, 0x100, 0xFF, 16); //フリー領域
                if (IsStopFlag)
                {
                    return(map);
                }
            }
            catch (Exception e)
            {
                Log.Error(e.ToString());
                Debug.Assert(false);
            }

            try
            {
                map.AppendMAP(structlist);
                if (IsStopFlag)
                {
                    return(map);
                }
            }
            catch (Exception e)
            {
                Log.Error(e.ToString());
                Debug.Assert(false);
            }

            Dictionary <uint, uint> ldrtable = new Dictionary <uint, uint>();  //LDR参照データがある位置を記録します. コードの末尾などにあります. 数が多くなるのでマップする.

            try
            {
                AsmMapFile.MakeSwitchDataList(ldrtable, 0x100, 0);
                if (IsStopFlag)
                {
                    return(map);
                }
            }
            catch (Exception e)
            {
                Log.Error(e.ToString());
                Debug.Assert(false);
            }

            try
            {
                map.AppendMAP(ldrtable);
                if (IsStopFlag)
                {
                    return(map);
                }
            }
            catch (Exception e)
            {
                Log.Error(e.ToString());
                Debug.Assert(false);
            }

            //近場リスト生成.
            map.MakeNearSearchSortedList();

            return(map);
        }
예제 #2
0
        AsmMapFile MakeFullLow()
        {
            AsmMapFile map = MakeInstant();

            if (IsStopFlag)
            {
                return(map);
            }

            //LDRマップのクリア
            this.LDRMapCache = new List <DisassemblerTrumb.LDRPointer>();
            this.FELintCache = new Dictionary <uint, List <FELint.ErrorSt> >();

            List <DisassemblerTrumb.LDRPointer> ldrmap;

#if !DEBUG
            try
            {
#endif
            ldrmap           = DisassemblerTrumb.MakeLDRMap(Program.ROM.Data, 0x100);
            this.LDRMapCache = ldrmap;
            if (IsStopFlag)
            {
                return(map);
            }
#if !DEBUG
        }

        catch (Exception e)
        {
            Log.Error(e.ToString());
            return(map);
        }
#endif
#if !DEBUG
            try
            {
#endif
            MakeHardCodeWarning(); //ハードコーディングされているデータの警告
            if (IsStopFlag)
            {
                return(map);
            }
#if !DEBUG
        }
        catch (Exception e)
        {
            Log.Error(e.ToString());
        }
#endif
#if !DEBUG
            try
            {
#endif
            ScanFELintByThread(ldrmap);
            if (IsStopFlag)
            {
                return(map);
            }
#if !DEBUG
        }
        catch (Exception e)
        {
            Log.Error(e.ToString());
            return(map);
        }
#endif
            List <Address> structlist;
#if !DEBUG
            try
            {
#endif
            structlist = U.MakeAllStructPointersList(false); //既存の構造体
            if (IsStopFlag)
            {
                return(map);
            }
#if !DEBUG
        }
        catch (Exception e)
        {
            Log.Error(e.ToString());
            return(map);
        }
#endif

#if !DEBUG
            try
            {
#endif
            PatchForm.MakePatchStructDataList(structlist, true, true, false); //パッチが知っている領域.
            if (IsStopFlag)
            {
                return(map);
            }
#if !DEBUG
        }
        catch (Exception e)
        {
            Log.Error(e.ToString());
        }
#endif
#if !DEBUG
            try
            {
#endif
            map.MakeTextIDArray(); //全テキストIDの検出
            if (IsStopFlag)
            {
                return(map);
            }
#if !DEBUG
        }
        catch (Exception e)
        {
            Log.Error(e.ToString());
        }
#endif
#if !DEBUG
            try
            {
#endif
            GraphicsToolForm.MakeLZ77DataList(structlist); //lz77で圧縮されたもの(主に画像)
            if (IsStopFlag)
            {
                return(map);
            }
#if !DEBUG
        }
        catch (Exception e)
        {
            Log.Error(e.ToString());
        }
#endif
#if !DEBUG
            try
            {
#endif
            ProcsScriptForm.MakeAllDataLength(structlist, ldrmap);
            if (IsStopFlag)
            {
                return(map);
            }
#if !DEBUG
        }
        catch (Exception e)
        {
            Log.Error(e.ToString());
        }
#endif


#if !DEBUG
            try
            {
#endif
            OAMSPForm.MakeAllDataLength(structlist, structlist, ldrmap);
            if (IsStopFlag)
            {
                return(map);
            }
#if !DEBUG
        }
        catch (Exception e)
        {
            Log.Error(e.ToString());
        }
#endif
#if !DEBUG
            try
            {
#endif
            AsmMapFile.MakeFreeDataList(structlist, 0x100, 0x00, 16); //フリー領域
            if (IsStopFlag)
            {
                return(map);
            }
#if !DEBUG
        }
        catch (Exception e)
        {
            Log.Error(e.ToString());
        }
#endif
#if !DEBUG
            try
            {
#endif
            AsmMapFile.MakeFreeDataList(structlist, 0x100, 0xFF, 16); //フリー領域
            if (IsStopFlag)
            {
                return(map);
            }
#if !DEBUG
        }
        catch (Exception e)
        {
            Log.Error(e.ToString());
        }
#endif
#if !DEBUG
            try
            {
#endif
            map.AppendMAP(structlist);
            if (IsStopFlag)
            {
                return(map);
            }
#if !DEBUG
        }
        catch (Exception e)
        {
            Log.Error(e.ToString());
        }
#endif
            Dictionary <uint, uint> ldrtable = new Dictionary <uint, uint>();  //LDR参照データがある位置を記録します. コードの末尾などにあります. 数が多くなるのでマップする.
#if !DEBUG
            try
            {
#endif

            AsmMapFile.MakeSwitchDataList(ldrtable, 0x100, 0);
            if (IsStopFlag)
            {
                return(map);
            }
#if !DEBUG
        }
        catch (Exception e)
        {
            Log.Error(e.ToString());
        }
#endif
#if !DEBUG
            try
            {
#endif

            map.AppendMAP(ldrtable);
            if (IsStopFlag)
            {
                return(map);
            }
#if !DEBUG
        }
        catch (Exception e)
        {
            Log.Error(e.ToString());
        }
#endif

            //近場リスト生成.
            map.MakeNearSearchSortedList();

            return(map);
        }