Esempio n. 1
0
 private void Reinitialize()
 {
     endOfFile = false;
     normalizerContext.hasSpace = false;
     normalizerContext.eatSpace = false;
     normalizerContext.oneNL    = false;
     normalizerContext.lastCh   = '\0';
     lineStarted = false;
     wideGap     = false;
     nextParagraphCloseWideGap = true;
     afterFirstParagraph       = false;
     ignoreNextP   = false;
     insideComment = false;
     insidePre     = false;
     insideAnchor  = false;
     if (urlCompareSink != null)
     {
         urlCompareSink.Reset();
     }
     listLevel   = 0;
     listIndex   = 0;
     listOrdered = false;
     if (!convertFragment && injection != null)
     {
         injection.Reset();
         if (injection.HaveHead)
         {
             injection.Inject(true, output);
         }
     }
     textMapping = TextMapping.Unicode;
 }
Esempio n. 2
0
        private IClient BuildClient(ProcessHandler onprocess, ThreadHandler onthread)
        {
            Client curclient;

            //- inject our assembly into the client process (where an instance of the Client class is created!
            Injection.Inject(onprocess, onthread, Assembly.GetExecutingAssembly(), typeof(InjectedProcess));

            //- create a proxy to the remote client object
            curclient = (Client)Server.GetObject(typeof(Client), (int)onprocess.PID);

            //- wait for server to become available
            System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
            sw.Start();
            while ((!IsValid(curclient) && (sw.ElapsedMilliseconds < 1000)))
            {
                Thread.Sleep(0);
            }
            sw.Stop();

            if (IsValid(curclient))
            {
                return(curclient.ActualClient);
            }
            else
            {
                return(null);
            }
        }
Esempio n. 3
0
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);

            // Injeção de dependencia do Automapper
            var     config = AutoMapperInjection.Config();
            IMapper mapper = config.CreateMapper();

            services.AddSingleton(mapper);

            // Injeção de dependencia do projeto em geral.
            Injection.Inject(services);

            // Configurando o serviço de documentação do Swagger
            services.AddSwaggerGen(c =>
            {
                c.SwaggerDoc("v1",
                             new Microsoft.OpenApi.Models.OpenApiInfo
                {
                    Title       = "Cadastro de Usuários",
                    Version     = "v1",
                    Description = "Exemplo de API REST criada com o ASP.NET Core para teste na Confitec",
                });

                string caminhoAplicacao =
                    AppDomain.CurrentDomain.BaseDirectory;
                string nomeAplicacao =
                    AppDomain.CurrentDomain.FriendlyName;
                string caminhoXmlDoc =
                    Path.Combine(caminhoAplicacao, $"{nomeAplicacao}.xml");

                c.IncludeXmlComments(caminhoXmlDoc);
            });
        }
Esempio n. 4
0
 protected void Application_Start()
 {
     AreaRegistration.RegisterAllAreas();
     FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     BundleConfig.RegisterBundles(BundleTable.Bundles);
     Injection.Inject();
 }
Esempio n. 5
0
        static void Main(string[] args)
        {
            Console.Title = "SharpInjector - by Cyberhound#5672 [Roblox DAC Bypassed Injector]";

            DACInjectionResult result;
            string             dllPath = "";
            bool waitForRoblox         = false;

            if (args.Length > 0 && args.Length <= 2)
            {
                if (args[0] != "-path")
                {
                    dllPath = args[0];

                    if (!File.Exists(dllPath))
                    {
                        dllPath = Path.GetFullPath(dllPath);
                    }

                    if (!File.Exists(dllPath))
                    {
                        Console.WriteLine("What the hell did you give me? I don't understand what {0} is. (Exiting in 5 seconds).", args[1]);
                        Thread.Sleep(5000);
                        return;
                    }
                }
                else
                {
                    dllPath = args[1];
                }

                if (!Injection.Load())
                {
                    Console.WriteLine("Failed to load library for Injector. (DACInjector.dll) Exiting in 5 seconds...");
                    Thread.Sleep(5000);
                    return;
                }

                if ((result = Injection.Inject(dllPath, waitForRoblox)) == DACInjectionResult.RobloxNotFound)
                {
                    Console.Write("Do you want to wait for Roblox to open before injection (y/n)? ");
                    {
                        string input = Console.ReadLine().ToLower();
                        waitForRoblox = input[0] == 'y' && !input.Contains("no");

                        if (input[0] == 'y' && input.Length > 2 && input[1] != 'e')
                        {
                            Console.WriteLine("I'll just take that as a yes?");
                        }
                    }
                    Console.WriteLine();

                    result = Injection.Inject(dllPath, waitForRoblox);
                }

                /* unload, and give result */
                Console.WriteLine("Injection result: {0}", result.ToString());
                Injection.Unload();
                return;
            }

            /* No args given... Prompt user about the arguments. */
            Console.WriteLine("Greetings, user!\r\n\tHi I'm Cyberhound.\r\n");
            Console.WriteLine("You did not give me a path for your DLL (or too many arguments). To do so, you can drag a DLL onto the injector or put a \"-path\" argument then your DLL's path.");
            Console.WriteLine("But, I will still accept you and let you type the DLL path here.");

            /* Prompt for Path */
            Console.Write("Path: ");
            dllPath = Console.ReadLine();

            if (!Injection.Load())
            {
                Console.WriteLine("Failed to load library for Injector. (DACInjector.dll) Exiting in 5 seconds...");
                Thread.Sleep(5000);
                return;
            }

            if ((result = Injection.Inject(dllPath, false)) == DACInjectionResult.RobloxNotFound)
            {
                Console.Write("Do you want to wait for Roblox to open before injection (y/n)? ");
                {
                    string input = Console.ReadLine().ToLower();
                    waitForRoblox = input[0] == 'y' && !input.Contains("no");

                    if (input[0] == 'y' && input.Length > 2 && input[1] != 'e')
                    {
                        Console.WriteLine("I'll just take that as a yes?");
                    }
                }
                Console.WriteLine();

                result = Injection.Inject(dllPath, waitForRoblox);
            }

            /* unload, and give result */
            Console.WriteLine("Injection result: {0}\r\nExiting in 5 seconds...", result.ToString());
            Injection.Unload();

            Thread.Sleep(5000);
        }
Esempio n. 6
0
        protected void Process(TextTokenId tokenId)
        {
            if (!started)
            {
                if (!convertFragment)
                {
                    output.OpenDocument();

                    if (injection != null && injection.HaveHead)
                    {
                        injection.Inject(true, output);
                    }
                }

                output.SetQuotingLevel(0);
                started = true;
            }

            switch (tokenId)
            {
            case TextTokenId.Text:

                OutputFragmentSimple(parser.Token);
                break;

            case TextTokenId.EncodingChange:

                if (!convertFragment)
                {
                    if (output.OutputCodePageSameAsInput)
                    {
                        var codePage = parser.Token.Argument;

                            #if DEBUG
                        Encoding newOutputEncoding;
                        // we should have already checked this in parser before reporting change
                        InternalDebug.Assert(Charset.TryGetEncoding(codePage, out newOutputEncoding));
                            #endif

                        output.OutputEncoding = Charset.GetEncoding(codePage);
                    }
                }
                break;

            case TextTokenId.EndOfFile:

                if (!convertFragment)
                {
                    if (injection != null && injection.HaveTail)
                    {
                        if (!output.LineEmpty)
                        {
                            output.OutputNewLine();
                        }

                        injection.Inject(false, output);
                    }

                    output.Flush();
                }
                else
                {
                    output.CloseParagraph();
                }

                endOfFile = true;

                break;
            }
        }