コード例 #1
0
        public AheadlibCodeGenerator(string codeGenPath, string oldDllName, bool isCodegenFunctionTrace, CodeGenDllMode dllMode, string logPath, DisplayModuleInfo dlltarget, string cfg)
        {
            CodeGenPath            = codeGenPath;
            OldDllName             = oldDllName;
            IsCodegenFunctionTrace = isCodegenFunctionTrace;
            DllMode = dllMode;
            LogPath = logPath;

            DllTarget         = dlltarget;
            Functions         = new List <AheadlibFunction>();
            ReplaceRuleLoader = ReplaceRuleLoader.GetReplaceRules(cfg);
            PhSymbolProvider symbolProvider = new PhSymbolProvider();

            foreach (var expfunction in dlltarget.Exports)
            {
                AheadlibFunction function = new AheadlibFunction();
                function.Ordinal = expfunction.Ordinal;
                function.Name    = expfunction.Name;
                var dx = new DisplayPeExport(expfunction, symbolProvider);
                function.UndecorateName = dx.Name;
                //function.SubstituteSymbol = function.UndecorateName; //ReplaceRuleLoader.Get_NameInSourceCode_From_Name(function.Name);
                function.ExportByOrdinal = expfunction.ExportByOrdinal;
                function.VirtualAddress  = expfunction.VirtualAddress;
                Functions.Add(function);
            }
        }