Created
August 20, 2013 13:06
-
-
Save DinisCruz/6281106 to your computer and use it in GitHub Desktop.
Helper scripts when getting Jni4net
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
var apiZap = new API_Zap(); | |
apiZap.Launch(); | |
var process = apiZap.ZapProcess; | |
process.waitFor_MainWindowHandle(); | |
var o2Injector = new API_O2_Injector(); | |
o2Injector.injectIntoProcess(process, false,true); | |
//using OWASP | |
//O2File:API_Zap.cs | |
//O2File:API_O2_Injector.cs | |
//using O2.XRules.Database.APIs |
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
var visualStudio = new VisualStudio_2010(); | |
var processes = visualStudio.dte().Debugger.LocalProcesses; | |
Func<string, EnvDTE.Process> findProcess = | |
(name)=>{ | |
foreach(EnvDTE.Process process in processes) //linq doesn't work here | |
if (process.Name.contains(name)) | |
return process; | |
return null; | |
}; | |
EnvDTE.Process targetProcess = findProcess("java.exe"); | |
targetProcess.Attach(); | |
return targetProcess; |
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
addClassPath( new URL("file:///E:\\O2\\_Source_Code\\test\\jni4net\\jni4net\\target\\jni4net-0.8.7.0-bin\\lib\\jni4net.j-0.8.7.0.jar") ); | |
name="net.sf.jni4net.Bridge"; | |
c = getClass( name ); | |
print(c) |
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
Environment.SetEnvironmentVariable("JAVA_HOME", @"C:\Program Files (x86)\Java\jre7"); | |
Bridge.CreateJVM( new BridgeSetup(){Verbose=true}); | |
Properties javaSystemProperties = java.lang.System.getProperties(); | |
foreach (java.lang.String key in Adapt.Enumeration(javaSystemProperties.keys())) | |
"key: {0}".info(key); | |
//using java.io; | |
//using java.lang; | |
//using java.util; | |
//using net.sf.jni4net; | |
//using net.sf.jni4net.adaptors; | |
//O2Ref:E:\O2\_Source_Code\test\jni4net\jni4net\target\jni4net-0.8.7.0-bin\lib\jni4net.n-0.8.7.0.dll |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment