Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Helper scripts when getting Jni4net
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
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;
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)
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
You can’t perform that action at this time.