Created
May 31, 2012 01:13
-
-
Save DinisCruz/2840056 to your computer and use it in GitHub Desktop.
O2 Script to Inject Snoop into process with WPF control
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//return "Util - DiagramDesigner Editor.h2".local().startProcess(); | |
var process = "O2 Xaml Editor (PoC).h2".local().startProcess(); | |
this.sleep(2000); | |
var hwnd = process.MainWindowHandle; | |
if (hwnd == IntPtr.Zero) | |
return "Could not get MainWindow handle"; | |
"Got main Window Handle: {0}".info(hwnd); | |
var snoopAssembly = @"Snoop\Snoop.exe".assembly(); | |
var directoryName = snoopAssembly.Location.directoryName(); | |
var suffix = snoopAssembly.type("Injector") | |
.invokeStatic("Suffix", hwnd); | |
var fileName = directoryName.pathCombine("ManagedInjectorLauncher" + suffix+ ".exe"); | |
var windowHandle= hwnd; | |
var className = "Snoop.SnoopUI"; | |
var methodName = "GoBabyGo"; | |
var arguments = string.Concat(new object[] | |
{ | |
windowHandle, " \"", snoopAssembly.Location,"\" \"", className, "\" \"", methodName,"\"" | |
}); | |
return fileName.startProcess(arguments); | |
//using Snoop; | |
//O2Ref:Snoop\Snoop.exe |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment