injection

Dependency injection for Silverlight?

I normally use StructureMap.dll (from MvcContrib) for dependency injection in .NET. Is there an equivalent for Silverlight, or any tools anyone uses? I can do it by hand, obviously, and it's not difficult. But I wondered if there was something formalised like StructureMap but for Silverlight. ...

Inject code into native process

Hello I'm in trouble injecting a process with C# code. I'm using CreateRemoteThread method by Mike Stall. However I get Last Win32 Error 1008 when trying to inject process. (btw. I tried injecting DLL (which runs my code) but I didn't succeed. I would post links to codes, but I can't) ...

Using Javascript in an element with injected HTML in jQuery

Hi, I'm trying to reference some javascript files in a remotely loaded (injected) HTML file via jQuery's .load() function. The javascript files I'm attempting to utilize in the loaded HTML file are already included in the loaded HTML's parent HTML page. Initially, I thought that making references to these files in the loaded HTML woul...

Sanitize user input destined for database in PHP

I have this code: $query = "select id from votes where username = '$user' and article_id = $this->id"; I tried this code to sanitize it: $query = sprintf("select id from votes where username = '$user' and article_id = $this->id", mysql_real_escape_string($user), mysql_real_escape_string($password)); but I get this error ...

Unity interception and constructors

I'd like to use interception with Unity, here is my code : UnityContainer container = new UnityContainer(); container.AddNewExtension<Interception>(); container.RegisterType<T, T>(); container.Configure<Interception>().SetDefaultInterceptorFor<T>(new VirtualMethodInterceptor()); return container.Resolve<T>(); If T is a class with a co...

Spy++ for PowerBuilder applications

Hi, I'm trying to write a tool which lets me inspect the state of a PowerBuilder-based application. What I'm thinking of is something like Spy++ (or, even nicer, 'Snoop' as it exists for .NET applications) which lets me inspect the object tree (and properties of objects) of some PowerBuilder-based GUI. I did the same for ordinary (MFC-...

What is the best way to inject HTML into the DOM with jQuery?

Hi, I'm working on a calendar page that allows a user to click on a day, and enter an entry for that day with a form that pops up. I'm no stranger to DOM manipulation with jQuery, but this is something I've done before and I'm beginning to wonder if there's a more efficient way to do this? Would building the HTML manually within JavaS...

Disabling/Overriding some Javascript from Webbrowser Control using Inject?

I am trying to access a page that has certain javascript that causes errors and prevents the page from fully rendering. <script language="Javascript"> parent.hidden.vPageState = parent.hidden.NEW_LIST; </script> and <body onload="top.menu.activateCell(3);"> Both of these errors are related to the fact that I am accessing the page ...

What is the best way to make TCP and UDP packet spoofing and injection?

Hy folks, I'm kinda new to low level networking. I need to intercepts all TCP/UDP packets and potentially filter or substitute them with new ones. What would be the best way to intercept these packets and inject new one? I'm only targeting Windows platforms. ...

How can I load a web page into a new window and inject JavaScript code into it?

Using JavaScript, how can i open a new window (loading, say, http://www.google.com in the process) and inject/insert this code into its body: <script type="text/javascript">alert(document.title);</script> I know how to open a new window, but i don't know how to add the script to the new window and run it: var ww = window.open('http:/...

Configuration Injection Framework

I recently stumbled upon the following Configuration Injection Framework. Seems interesting and seems to fit my needs. Has anyone tried it or knows about some other Configuration Injection frameworks? As far as I know Spring and Google Guice does not support this kinds of injection? ...

howto replace document object of a window/iframe

Hi, I need to inject in an iframe window a document object that I instanciated previously, and I cannot serialize it into a string or a remote url (those are solutions proposed on previous stackoverflow posts), because elements of this document objects are bound to other objects in my code. How can I do it ? thanks, b. ...

Depedency injection: injecting partially-initialized objects

Hi! This question is about Unity Container but I guess it is applicable to any dependency container. I have two classes with circular dependencies: class FirstClass { [Dependency] public SecondClass Second { get; set; } } class SecondClass { public readonly FirstClass First; public SecondClass(FirstClass first) {...

How to reconstruct a data-structure from injected process' memory space?

Dears, I've got this DLL I made. It's injected to another process. Inside the other process, I do a search from it's memory space with the following function: void MyDump(const void *m, unsigned int n) { const char *p = reinterpret_cast(m); for (unsigned int i = 0; i < n; ++i) { // Do something with p[...

Using a PHP as a Javascript file - Security?

What are the issues with using a php file instead of a .js file in a javascript include; <script type='text/javascript' src='myjavascript.php'></script> Obviously I will go through and plug register globals issues and such, but are there other vulnerabilities that could occur from this? Consider that 100,000+ people will be viewing th...

AppDomain.CreateInstanceFromAndUnwrap - Unable to cast transparent proxy

I'm writing a .NET library to inject managed DLLs into external processes. My current approach is: Use CreateRemoteThread to force the target process to call LoadLibrary on an unmanaged bootstrap DLL. From this point we're executing code in the target process. My bootstrap DLL then creates an instance of the CLR and calls ExecuteInDefa...

spring ioc and JSR168 Portlets

Is it possible to do dependency injection using spring into a jsr168 Portlet? ...

xaml injection (modify) from code behind file means dynamically

hi, I am working on NHibernate with wpf. I want to inject (insert) XAML from code behind file. for example I have a xaml grid at user interface level. Now i want to enter xaml string in xaml grid tag from code behind file. How can i achieve that? I want dynamically insert/remove xaml from .cs file. please help. ...

Force x86 CLR on 'Any CPU' .NET assembly

In .NET, the 'Platform Target: Any CPU' compiler option allows a .NET assembly to run as 64bit on a x64 machine, and 32bit on an x86 machine. It is also possible to force an assembly to run as x86 on an x64 machine using the 'Platform Target: x86' compiler option. Is it possible to run an assembly with the 'Any CPU' flag, but determine ...

How to MySQL Injection this!

Hello everyone, and thanks for looking at my question. I like to note first that this is an education attempt on my own database to better understand mysql injections to protect my own code. I need to work out a couple of examples of how a mysql injection can be constructed against the following code. It's a basic user login system whe...