Click here to Skip to main content
15,887,683 members
Everything / Injection

Injection

Injection

Great Reads

by DotNetSteve
A gentle introduction for DI and IOC in the first program most of us have written - Hello World
by Fiyaz Hasan
Learn how dependency injection mechanism has evolved from ASP.NET to ASP.NET Core
by Hein Pauwelyn
This is an application made for Windows (Universal) 10 devices made with MVVM, IoC-containers and dependency injection. There is also an API from Yahoo and SQLite service.
by Alexander Eremeev
The Windows kernel-hacking library and development framework written on C++17

Latest Articles

by Jason Sultana
A look at some injection-style vulnerabilities
by Jason Sultana
Understanding and preventing Newline Injection
by Chinmaya C
Explanation about DIP and its need in the real time scenario
by L. Michael
This article provides a recipe on how to avoid producing legacy code at the speed of typing by using a proper architecture and unit testing.

All Articles

Sort by Updated

Injection 

12 Mar 2024 by Jason Sultana
A look at some injection-style vulnerabilities
3 Mar 2024 by Jason Sultana
Understanding and preventing Newline Injection
20 Nov 2023 by wseng
You need to run flutter packages pub run build_runner build after flutter pub run build_runner watch --delete-conflicting-outputs
19 Oct 2023 by 10. Gunawan.Widya.Nugraha XI RPL 2
I'm facing a problem in my Flutter project where I'm trying to generate the $initGetIt function using Injectable, but it's not being generated as expected. Here are the details of the issue: I've checked my pubspec.yaml, and the dependencies...
13 Mar 2023 by Masis Levin
Redis with .NET | Redis Documentation Center[^]
8 Mar 2023 by Khushboo Dewani
what is the code for add data in redis database using hash datatype of redis in C# asp.net core 3.1?Also what is the concept of master key in it? I have to analyse the code for add in api and rewrite the code for add so that my data should be...
8 Oct 2022 by reverser69
hi all i want to do an inline asm and i want to see if a given location of memory is non-writable-executable code or its writable data; if its data, skip the overwrite. i want to do it in pure asm + win api. i partially achieved it by checking...
8 Oct 2022 by merano99
Access to main memory is usually realized with an MMU. Since the MMU is a critical resource, the operating system takes care of it. Access to the MMU requires operating system rights and good hardware knowledge. If you had access to the MMU, you...
17 Jun 2020 by Richard MacCutchan
See Unity - Scripting API: Application.productName[^]
17 Jun 2020 by G44Gonzalo [ G44 YT ]
I have an executable, and I can't do this through code. I want to inject a little conditional when running the file. This will prevent people of changing the name of the executable. It would be like: If this.filename != "RightName" then STOP...
16 Jun 2020 by honey the codewitch
I used to do this some time ago to support an aspect oriented framework over the top of COM and automation. I eventually abandoned the effort even though it worked. There are several problems with this approach. It will flag most virus...
16 Jun 2020 by MadMyche
When all is said and done; you cannot. The only real way to do this would be within the code of the actual application. While you could wrap the executable inside of another package, but then you could also subvert that by calling the file...
27 May 2020 by Charrlay
I already have Parameterized Stored Proc. I want to know how I would prevent single quotes or sql statements like "select..." from being entered into a textbox. Currently this is my process, I "edit top 200 rows of table" in sql and put in...
27 May 2020 by Patrice T
Quote: I want to know how I would prevent single quotes or sql statements like "select..." from being entered into a textbox. You don't need to, if stored proc is done properly. But you didn't show that stored proc. A couple articles avout sql...
27 May 2020 by ZurdoDev
In your code you should also use parameters. For example ... using (SqlCommand cmd = new SqlCommand("SP_Name", sqlCon){ ... cmd.Parameters.AddWithValue ("@param1", textField1.Text); ... } In theory, this is sufficient for preventing sql...
28 Apr 2020 by Chinmaya C
Explanation about DIP and its need in the real time scenario
19 Sep 2019 by MadMyche
I would suggest you find some other tutorials, as the code you have presented is ripe for an SQL Injection attack; which was identified over 20 years ago- before YouTube even existed. Search this site and elsewhere to find out all you need to know and then some SQL Injection; it is seen here...
19 Sep 2019 by Member 14597659
This is my beginning. I have SQL server on my local machine. I an trying to display data in grid view using visual basic. I tried the codes by watching online tutorials from YouTube. I have written following codes but it stuck somewhere. What I have tried: Imports System.Data.SqlClient ...
26 Feb 2019 by L. Michael
This article provides a recipe on how to avoid producing legacy code at the speed of typing by using a proper architecture and unit testing.
1 Nov 2018 by Alexander Eremeev
The Windows kernel-hacking library and development framework written on C++17
22 Oct 2018 by Bartje_
I think it could be one of two things: Use the Application.Run method to start the form (More info: Application.Run Method (System.Windows.Forms) | Microsoft Docs ) Or try adding the STAThread attribute to your EntryPoint method (More info: STAThreadAttribute ) According to the documentation...
22 Oct 2018 by Member 13911570
I have a C++ dll which is calling my C# code after an injection with CLR. So this is my C++ (dll) code: #include "stdafx.h" #include #include #include #include #pragma comment(lib, "mscoree.lib") #define IfFailRet(expr) { hr =...
12 Oct 2018 by kanangandhi
File.Copy(op.FileName, Application.StartupPath + "\\" + op.SafeFileName); Assembly.LoadFrom(Application.StartupPath + "\\" + op.SafeFileName); foreach (Assembly a in AppDomain.CurrentDomain.GetAssemblies()) { foreach (Type t in...
10 Jun 2018 by OriginalGriff
The problem may be that you are passing the command text string into the method as a string - so the actual text passed to SQL as a command could be anything, regardless of how careful the method itself is with using parameters. It's OK if you call it like this: ActionQuery("SELECT * FROM...
10 Jun 2018 by Wai Phyo Thu
Anybody who would help me solve this problem? Please guide me to the right way. Following is a common DB function which is called from all data access functions. All SQL commands are stored procedures, and problem is at line aryOutputParam.Add(sqlParam) Public Function ActionQuery(ByVal...
9 Apr 2018 by Sunasara Imdadhusen
Hello you might get more help from here Prevent cross-site scripting attacks by encoding HTML responses[^]
9 Apr 2018 by Member 13734676
For the below code, how do I resolve the cross scripting flaw? Is there a another way to write window.open?
9 Apr 2018 by Dave Kreskowiak
Simple. Don't EVER directly use user input in your response. You're using Request.QueryString("filename") and Request.QueryString("path") directly in the response without ever processing the filename and path strings to make sure they 1) Have values at all (not null or empty) 2) Does not have...
27 Mar 2018 by HusseinAl-haj
Using Dyninst API, we can perform both static and dynamic binary instrumentation. In static instrumentation, we can rewrite a binary file and inject an extra code (snippets) at a specific points. I have tested the following code in order to patch a binary code. However, this code inject the...
7 Mar 2018 by HusseinAl-haj
I have different pieces of code which are going to be inserted at the end of each basic block in CFG (Control Flow Graph). We don't have the source code. An executable file is available. I have readed a lot about code injection. Basically, I have readed about binary instrumentation, there are...
7 Mar 2018 by Richard MacCutchan
See Dyninst API | Putting the Performance in High Performance Computing[^]
19 Feb 2018 by syed shanu
How to use Dependency Injection in ASP.NET Core 2.0 and use the result to bind in our View page
30 Dec 2016 by Johnny2121
I've been studying crypters for well over a month now and people seem to be very secretive about the code that they want to share.. I have no idea why but it's really hard to learn about this subject so I thought I'd come to the place where are the knowledgable coders are.What I want to...
30 Dec 2016 by Dave Kreskowiak
You mean like this? Injecting .Net Assemblies Into Unmanaged Processes[^]
28 Dec 2016 by Fiyaz Hasan
Learn how dependency injection mechanism has evolved from ASP.NET to ASP.NET Core
15 Nov 2016 by shikhar gilhotra
Hi friends, Can we use abstract class in Dependency injection instead of an Interface. please give answer if u have implemented it. no fake replies please. ?What I have tried:i tried adding an abstract class but ut does not work.
13 Oct 2016 by MaDOnos
Adapter implemantation to mock DbContext easily
7 Sep 2016 by Member 12480887
HiI have the task of parameterising an old Classic ASP web app. There are literally thousands of SQL strings in the app. My question is: Is it necessary to parameterise secondary/derived variables/data? For example, assuming there is a form that gets submitted by the user. Clearly all the...
7 Sep 2016 by Member 12480887
Thanks to OriginalGriff, Mika and Dave for your valuable input. I guess there is no sortcut! Here goes...
7 Sep 2016 by Dave Kreskowiak
Your thinking is flawed. Parameterizing queries is not for preventing SQL injection attacks, though in some cases it does help.You parameterize queries for a variety of reasons, some benefits of which are your code writing experience, code maintainability, easier debugging experience, query...
7 Sep 2016 by Wendelius
I can't see any benefit of not using parameters, instead varying programming style introduces several problems:1. Program changes, while in the beginning it could be that some of the statements would only be used internally by the program, what if the design changes. You may have completely...
7 Sep 2016 by OriginalGriff
Generally, I'd say "Parameterise everything".Think about it: if you SELECT a string that the user entered from a DB, that has the same risk when concatenated into an INSERT command as it was when it was first presented to the DB. Getting x';DROP TABLES Clients;--from a DB column doesn't make...
10 Aug 2016 by Aless Alessio
Design your solution and code your classes as loosely-coupled objects. Learn how to use MOQ and Ninject for mocking your Service and injecting it at runtime with Ninject.
29 Jul 2016 by Hein Pauwelyn
This is an application made for Windows (Universal) 10 devices made with MVVM, IoC-containers and dependency injection. There is also an API from Yahoo and SQLite service.
9 May 2016 by xszaboj
Dependecy injection with ninja
26 Feb 2016 by DotNetSteve
A gentle introduction for DI and IOC in the first program most of us have written - Hello World
28 Dec 2015 by Purbasha Ghosh
Initialize MVC controllers with multiple instance resolutions of same interface
14 Dec 2015 by Ciumac Sergiu
A simple way of using dependency injection and service locator in you class library
17 Nov 2015 by sanjay243657
Hi,You have execute alter table query and stored procedure on particular database.
17 Nov 2015 by bhadresh123456
I have multiple database for single application.I want to alter table/store procedure in all database . so what is shortest way for this.?
21 Mar 2015 by Priyank Modi
In Depth Look: Strategy Design Pattern, Dependency Injection (DI), Open/Closed principle (OCP) and Loose Coupling vs Tight Coupling
1 Mar 2015 by Bankey Sharma
Some general guidelines to make application source agnostic and business adaptive
23 Feb 2015 by Veronica S. Zotali
How to use TypedFactoryFacility using Castle.Windsor
14 Jan 2015 by Pheonyx
Hi Guys,This may be a silly question, but I've been trying to improve my knowledge on Dependency Injection and am re-working an existing (fairly simple) project to utilise my new knowledge.However, I have the following question and I'm not certain what the correct approach is.I have...
27 Oct 2014 by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
Of course, as the name suggests, it is the upcoming version of ASP.NET.
20 Oct 2014 by Nathan Minier
The primary issue with your code sample is the calling of the MainForm from your Main thread. After dusting off my constructor injection knowledge (I don't use it terribly much) it looks like you do have a good constructor injection model in place. if (Settings.GlobalSettings.LoginSuccess...
17 Oct 2014 by srilekhamenon
How to inject a my dataclass in winform using dependency injection my code isin my program.cs [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); ...
21 Aug 2014 by Manoj Kumar Choubey
Dear all I would like to make application with the combination of web api controllers and mvc controllers both I installed following nuget packages1. unity.mvc43. unity.webapi4. webapiand I want to impliment dependency injection but I am having problem with dependency...
8 May 2014 by Halil ibrahim Kalkan
An implementation of dependency injection, repository and unit of work patterns using Castle Windsor and NHibernate.
21 Mar 2014 by Baxter P
Dependency Injection Data Demo with Lazy Loading and Data Mocking
7 Mar 2014 by _Ravikant Tiwari_
Code Injection - A Generic Approach for 32bit and 64bit Versions
28 Feb 2014 by Aditya Magotra
Hi Maciej,I implemented it in below fashion. Can you please let me know whether i implemented properly :Register Windsor Container in Global.asax :- -----------------------------------------------------private static WindsorContainer _container = null; /// ...
28 Feb 2014 by _Ravikant Tiwari_
This program will demonstrate the process of injecting code into already running processes. Here we have choosen to inject into Explorer
27 Feb 2014 by Maciej Los
Have a look here: Castle Windsor Tutorial in Asp.Net MVC[^]
27 Feb 2014 by Aditya Magotra
Hi,Can anybody please let me know how to register interface using Castle.Winsdor in Application_Start Event of Global.asax & then how to access the registered interface on the web.page.If there is another appropriate approach please let me know.Any help will be highly...
13 Jan 2014 by Jeremy Likness
Learn how to perform interception of services using Angular's decorator feature.
6 Jan 2014 by Nagaraj Muthuchamy
This article gives an introduction on SQL Injection attacks and tips to prevent it.
31 Dec 2013 by Shivprasad koirala
Dependency Injection (DI) vs. Inversion of Control (IOC).
23 Oct 2013 by OriginalGriff
We do not support, condone or assist in the production, distribution or otherwise of any form of malware. Please disable your firewall, turn off your antivirus and follow some google links to hacking sites. Have your credit card ready.
3 Sep 2013 by Nitin Singh India
How to identify dependencies and resolve them using Unity App Block. Simple Hello World.
7 Jun 2013 by Sarvesh Kushwaha
This article descirbes what SQL injection is and how to prevent from SQL injection.
20 Mar 2013 by Dave Kreskowiak
It's not very clear what you're talking about, but have you looked into NotMyFault[^]?? (Its near the bottom of that page)
20 Mar 2013 by Deenuji
Actually i created my own virtual machine like by giving physical memory usage of my computer system, cpu usage,memory usage....now my virtual machine was created by giving those configuration details...now i wanna inject the three type of fault i.e input fault,execution fault,allocation...
25 Oct 2012 by Member 3783976
Implement function in C# to emulate functionality of mysql_real_escape_string() C API function.
4 Sep 2012 by Martijn Kok
In a book I recently read about dependency injection (Dependency Injection in .NET by Mark Seemann [^]) there is a chapter (chapter 9) that might interest you. The chapter is about interception. Dynamic interception is discussed and compared with using the decorator pattern and using attributes...
3 Sep 2012 by jim lahey
Hello everyone,I'm using PostSharp to implement logging and security aspects in my application. PostSharp uses attributes to decorate methods with aspects which are then modified at compile time. Does anyone know of a way that I can use dependency injection with these aspects? I'm...
30 Jul 2012 by Mike-MadBadger
A tour of various methods for protecting against PHP mail header injection and e-mail validation
28 Jun 2012 by Bhupindra Singh
Dependency Injection in ASP.NET MVC4 and webapi using Ninject
22 Jun 2012 by jgauffin
Griffin.Container: Introducing the Command Support
6 Feb 2012 by Apriorit Inc, Kotik Anton
In his article, we will consider an interesting, universal and rarely used method of code injection into a Windows process using KnownDlls sections. To demonstrate the method work we will develop a sample project to inject into all running processes and intercept some calls from ws2_32.dll.
25 Jun 2011 by dawmail333
Using my non-existent knowledge of C++ (hey, at least I know what a pointer is :P ), I managed to throw together some code samples to create a solution that will inject a DLL file into another program.Unfortunately, it's the DLL I'm INJECTING that's not working properly: it successfully...
15 May 2011 by M@dHatter
They need to make javascript only execute in scoped containers within the browser. Don't ask me how, I'm sure the browser companies can make some kinda sandbox element.